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

Fix the invalid currency error in credit card payment of PayPal Payflow Pro or Payments Pro #22399

Conversation

Hailong
Copy link
Member

@Hailong Hailong commented Apr 18, 2019

Needs to provide the currency code explicitly in the $0.00 verification call, otherwise the payment would fail when store's default currency is not USD.

Description (*)

When the store default currency is not USD, the credit card payment with Payflow Pro or Payments Pro would fail with an error complaining "invalid currency code"

My store's default currency is set to CAD, the Payflow Pro payment didn't go through. By PayPal support team's investigation, they found the "$0.00 verification call" is with USD currency, but the following non zero call was with CAD currency, in which condition PayPal doesn't accept the payment.

But I don't find our API calls to PayPal ever explicitly added USD, so that I can guess without a currency code is actually default to USD.

Back to the two calls from Magento to PayPal, the second one is using store default for currency code, so the change is to also add store default currency code to the first one. And by changing that, my transaction went through successfully.

Here is the original comments from PayPal support guys:

Thanks for reaching out today. Happy to help.

It looks as though this is an issue with the currency code you're passing. Right now it appears you're trying to pass USD in on the $0.00 verification call, but CAD on the actual 2.20 transaction itself. When you verify a card, the transaction you attempt against that verification must use the same currency. Try passing the subsequent transaction with USD, or create the verification in CAD and then run the transaction against it using CAD. See https://developer.paypal.com/docs/classic/payflow/integration-guide/#submitting-account-verifications for more on verifications. That's a great resource for Payflow in general as well.

That should resolve the issue you're seeing, but please let us know if you run into any other issues.

I hope that helps. Let us know if you have any questions.

Regards,
Eric B.

Fixed Issues (if relevant)

n/a

Manual testing scenarios (*)

  1. Setup PayPal Payflow payment for credit card
  2. Set store default currency to CAD
  3. Credit card payment fails

Contribution checklist (*)

  • [*] Pull request has a meaningful description of its purpose
  • [*] All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…ation call, otherwise the payment would fail when store's default currency is not USD.
@m2-assistant
Copy link

m2-assistant bot commented Apr 18, 2019

Hi @Hailong. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

Hi @kalpmehta, thank you for the review.
ENGCOM-4780 has been created to process this Pull Request

@AlexWorking AlexWorking self-assigned this Apr 18, 2019
@ghost ghost unassigned AlexWorking Apr 18, 2019
@ghost
Copy link

ghost commented Apr 18, 2019

@AlexWorking unfortunately, only members of the maintainers team are allowed to assign developers to the pull request

@VasylShvorak VasylShvorak self-assigned this Apr 19, 2019
@AlexWorking AlexWorking self-assigned this Apr 19, 2019
@ghost ghost unassigned AlexWorking Apr 19, 2019
@ghost
Copy link

ghost commented Apr 19, 2019

@AlexWorking unfortunately, only members of the maintainers team are allowed to assign developers to the pull request

@sdzhepa
Copy link
Contributor

sdzhepa commented Apr 25, 2019

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Apr 29, 2019

Hi @Hailong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@oleksandr-butenko
Copy link

Thank you.

@sdzhepa
Copy link
Contributor

sdzhepa commented May 16, 2019

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @sdzhepa. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @sdzhepa, here is your Magento instance.
Admin access: https://i-22399-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants