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

Payflow Authorization currency missing #7719

Closed
H3dz opened this issue Dec 7, 2016 · 5 comments
Closed

Payflow Authorization currency missing #7719

H3dz opened this issue Dec 7, 2016 · 5 comments
Assignees
Labels
bug report Component: Payment Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@H3dz
Copy link

H3dz commented Dec 7, 2016

The currency is missing when doing an Authorization with Payflow.

The currency setting was already missing in other places and was fixed by @kriby in
337c63c
and was merged into the develop branch
152dbdc

but it seems that the Authorization code was forgotten.

Preconditions

  1. Magento version 2.1.2
  2. PHP 7.0.11
  3. MySQL 5.6

Steps to reproduce

  1. Set the store currency to CAD
  2. Set Payflow "Payment Action" to "Authorization"
  3. Make a purchase

Expected result

  1. The authorization should be made in CAD and the payment should be approved.

Actual result

  1. On PayPal the authorization transaction was made in USD.
  2. The payment fails with error "Invalid or unsupported currency code".

Fix

In app/code/Magento/Paypal/Model/Payflowpro.php in the buildBasicRequest method
Add

$request->setCurrency('CAD'); // Hardcoded to CAD

@joni-jones
Copy link
Contributor

Hi, @H3dz, thanks for reporting.

This issue (internal ticket MAGETWO-58376) is already fixed on develop branch and fix will be available in Magento 2.1.4 version.

Some notes: the \Magento\Paypal\Model\Payflowpro::authorize is not using for authorization the \Magento\Paypal\Model\Payflow\Transparent::authorize is used instead (the issue has been fixed in this method).

@joni-jones joni-jones added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Payment labels Dec 8, 2016
@H3dz
Copy link
Author

H3dz commented Dec 8, 2016

Hi @joni-jones it's strange because it only started to work when I updated \Magento\Paypal\Model\Payflowpro::buildBasicRequest

But I did cherry pick a lot of code from the develop branch to make my current installation work.

I'll re-open this issue if the problem persists in 2.1.4.

Thanks

@H3dz H3dz closed this as completed Dec 8, 2016
@joni-jones
Copy link
Contributor

joni-jones commented Dec 8, 2016

it's strange because it only started to work when I updated Magento\Paypal\Model\Payflowpro::buildBasicRequest

\Magento\Paypal\Model\Payflow\Transparent::authorize uses \Magento\Paypal\Model\Payflowpro::buildBasicRequest here's why it's working for you.

@mariamghalleb
Copy link

mariamghalleb commented Apr 16, 2018

i have two websites one is with CAD the other is with USD, since the authorization is always in USD, the USD website works, but the CAD website's authorization is also in CAD, if I hard code it , wouldn't it cause a problem for the US website?
Any other solution for this?

@Hailong
Copy link
Member

Hailong commented Apr 18, 2019

@mariamghalleb You can refer to my PR at #22399, which would fix the problem with CAD.

magento-devops-reposync-svc pushed a commit that referenced this issue Aug 10, 2022
ACP2E-782: Introduce an alternative way to define fixtures using PHP8 Attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Payment Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

5 participants