subscribepro / subscribepro-magento2-ext

Subscribe Pro Magento 2 Integration Extension
MIT License
24 stars 22 forks source link

Switch credit card tokenization to use SP PaymentFields #197

Closed garthbrantley closed 10 months ago

garthbrantley commented 1 year ago

PRs: #208, #209, #211, #212, #213, #214, #226, #227, #228, #229, #230, #232

In each of the following locations:

With each config:

Other changes required:

Version

Use version 1.0.1 of PaymentFields - https://hosted.subscribepro.com/payment-fields/payment-fields-1.0.1.js

Events To Handle

Handle thevalidationresultchanged event

Use this event to change the card image and to determine if the card / cvv entered are valid yet or not.

Replace the current credit card iframe with the implementation via SP PaymentFields widget:

Iframe locations:

SP Environment configurations

The Subscribe Pro iframe should work with the following SP Environment configurations:

Enable / Disable setting

The Enable 3DS2 config setting in M2 admin should control this business logic:

Test Scenarios

Wallet Page - Config 1

3DS2 Authentication Wallet Authorization authenticationType Used Test Card Expected Result
Enabled Disabled non_payment / NPA Frictionless - tranStatus = Y Card stored
Enabled Disabled non_payment / NPA Frictionless - tranStatus = N 3DS2 authentication fails, error message displayed to user
Enabled Disabled non_payment / NPA Challenge - Any 3DS2 authentication fails, error message displayed to user
Enabled Enabled payment / PA Frictionless - tranStatus = Y Card Stored / $1 Authorization & Void
Enabled Enabled payment / PA Frictionless - tranStatus = N 3DS2 authentication fails, error message displayed to user
Enabled Enabled payment / PA Challenge - transStatus = Y Card Stored / $1 Authorization & Void
Enabled Enabled payment / PA Challenge - trnasStatus = N 3DS2 authentication fails, error message displayed to user
Disabled Disabled none 4111111111111111 Card stored
Disabled Disabled none 4012888888881881 Card stored
Disabled Enabled none 4111111111111111 Card Stored / $1 Authorization & Void
Disabled Enabled none 4012888888881881 Authorization Transaction Fails
czettnersandor commented 1 year ago
garthbrantley commented 1 year ago

@czettnersandor Have you accounted for handling the 3DS2 authentication flow through the PaymentFields library, instead of how it is handled now? Can you research that and write up all the places and code that need to change?

garthbrantley commented 11 months ago

Sandor left these comments in slack:

Sandor Czettner I believe the 3DS is coming after the credit card widget, I'm not sure if there's anything to do with it. It's separated from it as far as I know. There needs to be a separate element, then we receive events when the content is shown, but that's it.

Garth Brantley Yes, there is something to do.

Garth Brantley The current 3DS2 implementation needs to be removed and replaced with the PaymentFields library.

Sandor Czettner Only to provide an element?

Sandor Czettner ah yes, to remove the current 3DS implementation

Sandor Czettner The new PaymentFields is handling the 3DS form completely, I only need to add a new div for it.

garthbrantley commented 11 months ago

@eugene-shab See note about using latest verison, 1.0.1 of PaymentFields and how to implement event handler to get card type and is valid or not flags.

eugene-shab commented 11 months ago

@garthbrantley During work on event validation on the new version of payment-fields.1.0.1, an old error was noticed, related to the fact that events (like inputEvent or new validationResultChanged) for Number and CVV inputs are only working for a certain time ~5-7 seconds. After the time has passed, no validation events work.

For example: when a customer changes the credit card number, the entire credit card number from Visa to Master, then no verification takes place. There are no errors in the console either.

eugene-shab commented 11 months ago

@garthbrantley I have pushed updates for validation on wallet page in my account

eugene-shab commented 11 months ago

@garthbrantley I have pushed updates for validation on admin order create page