PaypalExpress and order price is 0
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
PaypalExpress and order price is 0
Hi Aimeos-Team,
if the order price is 0 (because of a 100% voucher) and payment provider is "PaypalExpress" the order is placed but with an error at the confirm page: "Required parameter "token" is missing". The basket is not emptied and thats confusing the customer and he tries again to order maybe with a different payment provider. Now with another error "Non reoverable error..." (the order-id exists from the first try)
I´am not sure but in this case, the updateSync-method must not be called because there is no data for that order at paypal?
My workaround so far:
https://github.com/aimeos/aimeos-core/b ... s.php#L422
if the order price is 0 (because of a 100% voucher) and payment provider is "PaypalExpress" the order is placed but with an error at the confirm page: "Required parameter "token" is missing". The basket is not emptied and thats confusing the customer and he tries again to order maybe with a different payment provider. Now with another error "Non reoverable error..." (the order-id exists from the first try)

I´am not sure but in this case, the updateSync-method must not be called because there is no data for that order at paypal?
My workaround so far:
https://github.com/aimeos/aimeos-core/b ... s.php#L422
Code: Select all
if( !isset( $params['token'] ) )
{
if ($price->getValue() == 0) {
return $orderItem;
}
$msg = sprintf( $this->context()->translate( 'mshop', 'Required parameter "%1$s" is missing' ), 'token' );
throw new \Aimeos\MShop\Service\Exception( $msg );
}
Thanks a lot!
Re: PaypalExpress and order price is 0
In case the basket value is 0.00, you should only offer a payment option that doesn't require any special handling that uses e.g. the PostPay service provider. You can use the available decorators to show that option only in that situation.
The problem is that if the basket is 0.00, the customer is redirected directly to the confirmation page and not to the payment provider (PayPal in your case). Then, the corresponding Aimeos PayPal payment service provider is called and it expects that the PayPal parameters are available but they are not in this situation.
Your workaround is valid and you should create a PR on Github so it's included in the next Aimeos version. This needs to be applied to all other payment service providers as will which use external payment providers.
The problem is that if the basket is 0.00, the customer is redirected directly to the confirmation page and not to the payment provider (PayPal in your case). Then, the corresponding Aimeos PayPal payment service provider is called and it expects that the PayPal parameters are available but they are not in this situation.
Your workaround is valid and you should create a PR on Github so it's included in the next Aimeos version. This needs to be applied to all other payment service providers as will which use external payment providers.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
