Closed danvbe closed 6 years ago
Since I had some requests on how I fixed this... here is a gist to point you in right direction. It is the way to bypass this issue and the one related to the send confirmation receipt part (calback from your site to validate Paypal payment).
Since the issue is already on ecommerce, I am closing this one
I tried to setup Paypal Payment method and I had some issues:
The Paypal class in the ecommerce bundle was not working well. In the
public function sendbank(OrderInterface $order)
function, where we are setting up the fields to be sent to paypal, we have:The
$order->getTotalInc()
returned the value with 3 decimals (I assume it does this because we havebcscale(3);
set inAppKernel::init()
), but this is generating an error on Paypal (it expects 2 decimal values). The$order->getCurrency()
was returning a serialized object... this is from the output:I have managed to fix this by creating in ApplicationPaymentBundle my custom Paypal class (extended from Sonata\Component\Payment\Paypal, overwriting the
sendBanck(...)
function by fixingamount
andcurrency_code
and changing thesonata.payment.method.paypal.class
parameter to point to this new class.As solution... I would suggest to implement these changes directly in the ecommerce bundle (in Paypal class) as they are directly related and specific to Paypal (and do not really require to be done at Application level, via extending).