0

I have added Stripe Payment Gateway on sylius project. It is working well but there is just one problem. By default, USD currency is used so it multiplied to 100 (7$ * 100 = 700 cents) when sent to the Stripe server. But in my case, I am using JPY so I do not need to multiply to 100. I have checked the resources and found this on ConvertPaymentAction.php

    $this->gateway->execute($currency = new GetCurrency($payment->getCurrencyCode()));
    $divisor = pow(10, $currency->exp);

    $details = ArrayObject::ensureArrayObject($payment->getDetails());
    $details['amount'] = $payment->getTotalAmount() / $divisor

Is there a good way to solve this problem? I am new to Sylius so I am not sure how should I handle this. Should I override the Conversion Method or just make a new whole Entity for Stripe method.

NewLomter
  • 95
  • 1
  • 7
Jasurbek
  • 68
  • 9

0 Answers0