Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/Payment/Mollie.php
Show First 20 Lines • Show All 511 Lines • ▼ Show 20 Lines | class Mollie extends \App\Providers\PaymentProvider | ||||
{ | { | ||||
// Extract the payment method for transaction description | // Extract the payment method for transaction description | ||||
$method = self::paymentMethod($mollie_payment, 'Mollie'); | $method = self::paymentMethod($mollie_payment, 'Mollie'); | ||||
// 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 112 Lines • Show Last 20 Lines |