magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

With certain currencies invalid amount is sent to Paypal #22

Closed magento-engcom-team closed 3 years ago

magento-engcom-team commented 6 years ago

Preconditions

  1. Magento 2.1.6
  2. php 5.6

Steps to reproduce

  1. [ADMIN] Select HUF (Hungarian forint) as base & display currency
  2. [ADMIN] Turn on Paypal Express checkout
  3. [FRONTEND] Start checkout flow
  4. [FRONTEND] Try paying with Paypal

Expected result

User can successfully pay

Actual result

Paypal error is thrown, user is unable to pay via Paypal

Error message: PayPal gateway has rejected request. Item total is invalid (#10426: Transaction refused because of an invalid argument. See additional error messages for details). Tax total is invalid (#10429: Transaction refused because of an invalid argument. See additional error messages for details).

Logs: Here's the relevant part of the array: main.DEBUG: array ( 'url' => 'https://api-3t.paypal.com/nvp', 'SetExpressCheckout' => array ( 'PAYMENTACTION' => 'Sale', 'AMT' =>'2990.00', 'CURRENCYCODE' => 'HUF', 'SHIPPINGAMT' =>'0.00', 'ITEMAMT' =>'2354.33', 'TAXAMT' => '635.67',

Compare this with Paypal's official Currency Code advice for developers:

Hungarian Forint | HUF Note: Decimal amounts are not supported for this currency. Passing a decimal amount will throw an error.

Original Report: https://github.com/magento/magento2/issues/10954 by @pvj

sivaschenko commented 3 years ago

I believe the functionality failure for the specific currencies that are available in Magento is a bug rather than a feature.

Closing this feature request and reopening an original issue: https://github.com/magento/magento2/issues/10954