diff --git a/database/migrations/upgrade_to_cashier_v2.php.stub b/database/migrations/upgrade_to_cashier_v2.php.stub index e8cc0329..0b7aa345 100644 --- a/database/migrations/upgrade_to_cashier_v2.php.stub +++ b/database/migrations/upgrade_to_cashier_v2.php.stub @@ -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) { diff --git a/src/Order/Order.php b/src/Order/Order.php index fb091f5e..61689765 100644 --- a/src/Order/Order.php +++ b/src/Order/Order.php @@ -765,4 +765,9 @@ public function retryNow() $this->processPayment(); }); } + + public function amountChargedBack(): int + { + return $this->payments()->sum('amount_charged_back'); + } }