Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paypal API: The totals of the cart item amounts do not match order amounts #22

Open
joostwaaijer opened this issue Jun 24, 2021 · 0 comments

Comments

@joostwaaijer
Copy link

Description

When using an Omnipay based gateway (In our case PayPal, https://github.com/craftcms/commerce-paypal) we've encountered some problems when trying to process a payment with a different currency than the primary currency. For example the USD as primary and GBP as secondary. I've found out that when creating the item bags to send to the gateway, the price of the items are noted in the primary currency, while in the transaction object, the price is noted in the secondary currency. This results in the following error from the gateway:
The totals of the cart item amounts do not match order amounts

I think the best way to fix this, would be to convert the price in the item bags to the currency that was selected as the paymentCurrency. (also see this related issue in commerce)

Steps to reproduce

  1. In Craft Commerce, Add a primary and secondary currency with a different rate
  2. Add some items in your shopping cart in the secondary currency
  3. Proceed to checkout with the Paypal gateway

Additional info

  • Craft version: 3.6.17
  • PHP version: 8.0.7
  • Database driver & version: PostgreSQL 12.6
  • Plugins & versions:
    • Commerce: 3.3.4.1
    • Commerce Omnipay: 3.0.2
    • Commerce Paypal: 3.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants