mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Extract convertToMolieAmount method
This commit is contained in:
parent
b144d1e031
commit
d7577b001c
@ -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)
|
||||
|
@ -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, '.', '');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user