Method to convert to Razorpay specific-amount

This commit is contained in:
Benjamin Beganović 2021-10-07 18:01:25 +02:00
parent 87c6241947
commit ea82318218

View File

@ -94,4 +94,15 @@ class RazorpayPaymentDriver extends BaseDriver
{
return $this->payment_method->yourTokenBillingImplmentation();
}
/**
* Convert the amount to the format that Razorpay supports.
*
* @param mixed|float $amount
* @return int
*/
public function convertToRazorpayAmount($amount): int
{
return \number_format((float) $amount * 100, 0, '.', '');
}
}