Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/Payment/Coinbase.php
Show First 20 Lines • Show All 346 Lines • ▼ Show 20 Lines | class Coinbase extends \App\Providers\PaymentProvider | ||||
* Apply the successful payment's pecunia to the wallet | * Apply the successful payment's pecunia to the wallet | ||||
*/ | */ | ||||
protected static function creditPayment($payment) | protected static function creditPayment($payment) | ||||
{ | { | ||||
// TODO: Localization? | // TODO: Localization? | ||||
$description = 'Payment'; | $description = 'Payment'; | ||||
$description .= " transaction {$payment->id} using Coinbase"; | $description .= " transaction {$payment->id} using Coinbase"; | ||||
$payment->wallet->credit($payment->amount, $description); | $payment->wallet->credit($payment, $description); | ||||
mollekopf: I would prefer passing the $payment to credit, and then extract the correct amount there.
I'm… | |||||
Done Inline ActionsAccepting \App\Payment in these Wallet methods might be a good idea. machniak: Accepting \App\Payment in these Wallet methods might be a good idea. | |||||
} | } | ||||
/** | /** | ||||
* List supported payment methods. | * List supported payment methods. | ||||
* | * | ||||
* @param string $type The payment type for which we require a method (oneoff/recurring). | * @param string $type The payment type for which we require a method (oneoff/recurring). | ||||
* @param string $currency Currency code | * @param string $currency Currency code | ||||
* | * | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |
I would prefer passing the $payment to credit, and then extract the correct amount there.
I'm not yet sure why we can't just calculate the base_amount/wallet_amount from amount + tax_rate there).