square / in-app-payments-flutter-plugin

Flutter Plugin for Square In-App Payments SDK
https://developer.squareup.com/docs
Apache License 2.0
340 stars 121 forks source link

onBuyerVerificationSuccess executed instead of onCardNonceRequestSuccess #182

Closed hazzo closed 1 year ago

hazzo commented 2 years ago

Describe your question

Hi, thanks for the flutter plugin for using your native In App Payments native SDK.

I'm encountering an odd behaviour that I really don't know if is right or not. I'll enumearte the steps because it's easier to explain:

1 - Execute startCardEntryFlow 2 - Enter sandbox card 4111 1111 1111 1111 3 - Finish entering card and capturing nonce in onCardNonceRequestSuccess. Use nonce in API Explorer to create payment 4 - Use payment source id to execute startBuyerVerificationFlow 5 - Verification process complete and received verification token on onBuyerVerificationSuccess. 6 - Complete payment in API explorer with verification token.

7 - Start process again, execute startCardEntryFlow 8 - Enter sandbox card 4111 1111 1111 1111 or other card as 5105 1051 0510 5100 9 - Hera comes the odd part. Once the entry card is finished instead of executing onCardNonceRequestSuccess the callback executed is onBuyerVerificationSuccess with a verify token again.

How is that possible? I watched the swift code and it's done on purpose but I don't understand why.

Thanks again!

hazzo commented 2 years ago

Okey I think I was getting something wrong. The paymentSourceId in the verification flow is not a payment id if not:

paymentSourceId | string | This ID can be the nonce returned by CardEntryFlow or a card-on-file card ID for the buyer's payment card stored with Square.

Right?