diff --git a/app/PaymentDrivers/Mollie/CreditCard.php b/app/PaymentDrivers/Mollie/CreditCard.php index 16741b1c7226..75f87fff285a 100644 --- a/app/PaymentDrivers/Mollie/CreditCard.php +++ b/app/PaymentDrivers/Mollie/CreditCard.php @@ -52,7 +52,7 @@ class CreditCard public function paymentResponse(PaymentResponseRequest $request) { // TODO: Unit tests. - $amount = number_format((float) $this->mollie->payment_hash->data->amount_with_fee, 2, '.', ''); + $amount = $this->mollie->convertToMollieAmount((float) $this->mollie->payment_hash->data->amount_with_fee); $this->mollie->payment_hash ->withData('gateway_type_id', GatewayType::CREDIT_CARD) diff --git a/app/PaymentDrivers/MolliePaymentDriver.php b/app/PaymentDrivers/MolliePaymentDriver.php index 60c27321e8ed..44d6dcfac886 100644 --- a/app/PaymentDrivers/MolliePaymentDriver.php +++ b/app/PaymentDrivers/MolliePaymentDriver.php @@ -115,7 +115,7 @@ class MolliePaymentDriver extends BaseDriver public function refund(Payment $payment, $amount, $return_client_response = false) { - return $this->payment_method->yourRefundImplementationHere(); + } public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash) @@ -192,4 +192,15 @@ class MolliePaymentDriver extends BaseDriver ); } } + + /** + * Convert the amount to the format that Mollie supports. + * + * @param mixed|float $amount + * @return string + */ + public function convertToMollieAmount($amount): string + { + return \number_format((float) $amount, 2, '.', ''); + } }