Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/Payment/Stripe.php
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | protected static function creditPayment(Payment $payment, $intent) | ||||
) { | ) { | ||||
$method = self::paymentMethod($pm); | $method = self::paymentMethod($pm); | ||||
} | } | ||||
// TODO: Localization? | // TODO: Localization? | ||||
$description = $payment->type == self::TYPE_RECURRING ? 'Auto-payment' : 'Payment'; | $description = $payment->type == self::TYPE_RECURRING ? 'Auto-payment' : 'Payment'; | ||||
$description .= " transaction {$payment->id} using {$method}"; | $description .= " transaction {$payment->id} using {$method}"; | ||||
$payment->wallet->credit($payment->amount, $description); | $payment->wallet->credit($payment, $description); | ||||
// Unlock the disabled auto-payment mandate | // Unlock the disabled auto-payment mandate | ||||
if ($payment->wallet->balance >= 0) { | if ($payment->wallet->balance >= 0) { | ||||
$payment->wallet->setSetting('mandate_disabled', null); | $payment->wallet->setSetting('mandate_disabled', null); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |