Skip to content

Commit

Permalink
Merge branch 'mollie:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sander3 authored Dec 1, 2023
2 parents b938e68 + ec07354 commit 21edf0d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/cashier_plans.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* The default chain of subscription OrderItem preprocessors. These are called right before the Subscription's
* OrderItem is processed into an OrderItem. You can use this for calculating variable costs a.k.a. metered billing.
* Can be overridden per subscription plan. Make sure the preprocessors implement the PreprocessesOrderItems
* Can be overridden per subscription plan. Make sure the preprocessors implement the BaseOrderItemPreprocessor
* interface.
*/
'order_item_preprocessors' => [
Expand Down
1 change: 0 additions & 1 deletion database/migrations/upgrade_to_cashier_v2.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class UpgradeToCashierV2 extends Migration
{
Schema::table('orders', function (Blueprint $table) {
$table->unsignedInteger('amount_refunded')->after('total_due')->default(0);
$table->unsignedInteger('amount_charged_back')->after('amount_refunded')->default(0);
});

Schema::create('refunds', function (Blueprint $table) {
Expand Down
2 changes: 1 addition & 1 deletion src/CashierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CashierServiceProvider extends ServiceProvider
{
use RegistersMollieInteractions;

const PACKAGE_VERSION = '2.10.0';
const PACKAGE_VERSION = '2.11.0';

/**
* Bootstrap the application services.
Expand Down
5 changes: 5 additions & 0 deletions src/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,9 @@ public function retryNow()
$this->processPayment();
});
}

public function amountChargedBack(): int
{
return $this->payments()->sum('amount_charged_back');
}
}

0 comments on commit 21edf0d

Please sign in to comment.