- Posts: 57
- Thank you received: 0
PayPal Checkout express buyer is charged more than they approved overseas post
28 minutes ago #100000887
by nippyzap
PayPal Checkout express buyer is charged more than they approved overseas post was created by nippyzap
-- HikaShop version -- : HikaShop Business 6.8.2
-- Joomla version -- : 6.2
-- PHP version -- : 8.4.28
-- Browser(s) name and version -- : Firefox 162.0
Hello,
With the PayPal Checkout express buttons ("Express button on the cart" / "Express button on the checkout cart"), a customer who chooses an overseas delivery address in PayPal approves one amount and is then charged a higher one, without being asked again.
Tested with PayPal Sandbox (Australian test buyer, UK shop, Royal Mail shipping methods by zone):
1. Cart: one item at £12.35. No address is entered on the site.
2. The express button is clicked. The PayPal window shows £22.10: the item plus £9.75 postage for our default zone (UK). It still shows £22.10 with the Melbourne address selected. The buyer approves £22.10 (AU$44.60).
3. HikaShop creates order with the correct Zone 2 postage, £34.10 (total £46.45). _captureExpressOrder() then Patches the PayPal order amount to £46.45 and captures it. PayPal accepts the PATCH, the order is marked paid, and the buyer is taken to the thank-you page.
4. The buyer's PayPal activity shows £46.45 (AU$93.74) taken, more than double what they approved. They were never shown the new amount.
Cause, as far as I can see in 6.8.2:
- PaypalCheckoutExpress::processExpressCallback() already does the right thing. It quotes shipping for the PayPal address through helper.express->quote() and returns shipping_options and the new amount, or COUNTRY_ERROR / ADDRESS_ERROR.
- But the Create Order request (_getExpressOrderData() / PaypalCheckoutOrderData::getOrderData()) never includes payment_source.paypal.experience_context.order_update_callback_config (callback_url to &express=callback with cart_id and express_token, callback_events SHIPPING_ADDRESS and SHIPPING_OPTIONS). It only sends the older application_context. So PayPal never calls the callback, and the amount the buyer approves is always the default-zone one.
- The same applies to a country with no shipping method: nothing stops the buyer in PayPal.
I've had to turn the cart express button off for customers. In the meantime I'm testing a workaround on Sandbox: I answer the express=create request with the same code plus order_update_callback_config, moving application_context into payment_source.paypal.experience_context. I'll report back on whether PayPal then shows the right total.
Am I missing something or if not could this be fixed in a future release, so the express buttons can safely be used before the customer has entered an address?
Thank you for any guidance in advance.
Martyn
-- Joomla version -- : 6.2
-- PHP version -- : 8.4.28
-- Browser(s) name and version -- : Firefox 162.0
Hello,
With the PayPal Checkout express buttons ("Express button on the cart" / "Express button on the checkout cart"), a customer who chooses an overseas delivery address in PayPal approves one amount and is then charged a higher one, without being asked again.
Tested with PayPal Sandbox (Australian test buyer, UK shop, Royal Mail shipping methods by zone):
1. Cart: one item at £12.35. No address is entered on the site.
2. The express button is clicked. The PayPal window shows £22.10: the item plus £9.75 postage for our default zone (UK). It still shows £22.10 with the Melbourne address selected. The buyer approves £22.10 (AU$44.60).
3. HikaShop creates order with the correct Zone 2 postage, £34.10 (total £46.45). _captureExpressOrder() then Patches the PayPal order amount to £46.45 and captures it. PayPal accepts the PATCH, the order is marked paid, and the buyer is taken to the thank-you page.
4. The buyer's PayPal activity shows £46.45 (AU$93.74) taken, more than double what they approved. They were never shown the new amount.
Cause, as far as I can see in 6.8.2:
- PaypalCheckoutExpress::processExpressCallback() already does the right thing. It quotes shipping for the PayPal address through helper.express->quote() and returns shipping_options and the new amount, or COUNTRY_ERROR / ADDRESS_ERROR.
- But the Create Order request (_getExpressOrderData() / PaypalCheckoutOrderData::getOrderData()) never includes payment_source.paypal.experience_context.order_update_callback_config (callback_url to &express=callback with cart_id and express_token, callback_events SHIPPING_ADDRESS and SHIPPING_OPTIONS). It only sends the older application_context. So PayPal never calls the callback, and the amount the buyer approves is always the default-zone one.
- The same applies to a country with no shipping method: nothing stops the buyer in PayPal.
I've had to turn the cart express button off for customers. In the meantime I'm testing a workaround on Sandbox: I answer the express=create request with the same code plus order_update_callback_config, moving application_context into payment_source.paypal.experience_context. I'll report back on whether PayPal then shows the right total.
Am I missing something or if not could this be fixed in a future release, so the express buttons can safely be used before the customer has entered an address?
Thank you for any guidance in advance.
Martyn
Please Log in or Create an account to join the conversation.
Time to create page: 0.046 seconds