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

fetchPaymentMethodNonces in BTAPIClient return wrong nonce types #1099

Closed
haojin2020 opened this issue Sep 14, 2023 · 4 comments · Fixed by #1100
Closed

fetchPaymentMethodNonces in BTAPIClient return wrong nonce types #1099

haojin2020 opened this issue Sep 14, 2023 · 4 comments · Fixed by #1100

Comments

@haojin2020
Copy link

haojin2020 commented Sep 14, 2023

Braintree SDK Version

6.6.0

Environment

Sandbox

Xcode Version

Xcode 14.3.1

OS Version & Device

iOS 16.4

Integration type

CocoaPods

Development Processor

Intel

Describe the bug

The fetchPaymentMethodNonces method in BTAPIClient always returns the nonce in the "Unknown" type.

Root cause: After the SDK migrated to Swift. The jsonParsingBlocks in BTPaymentMethodNonceParser is not get registered with different types.

To reproduce

  1. Call fetchPaymentMethodNonces in BTAPIClient when there are saved nonce.
  2. Debug the nonce values. (Check the screenshot)

Expected behavior

  1. The SDK should behave as the Objective-C version
  2. The nonce type should be the correct type.

Screenshots

CleanShot 2023-09-14 at 09 07 13@2x

@haojin2020
Copy link
Author

haojin2020 commented Sep 14, 2023

In the Objective-C version of the SDK, the parsing blocks are registered in +load, as you can see in the below image. But I don't see this registered anywhere in the Swift version.

CleanShot 2023-09-14 at 09 10 12@2x

@jaxdesmarais
Copy link
Contributor

Hello @haojin2020 -

Thanks so much for reporting this issue! I was able to reproduce the behavior you are seeing and this is certainly a bug introduced in v6. I've opened PR #1100 to resolve this issue on our side. Please feel free to pull down that branch to ensure things are working as expected now on your side.

@jaxdesmarais
Copy link
Contributor

🤔 we may actually have to get creative with our solution since the load method does not exist in Swift. Right now some of the types work as expected but for example the credit card types aren't passed through as expected. We will dig into this a bit more and come up with a solution that can work in the same way it did in Obj-C. Thanks again for bringing this to our attention.

@jaxdesmarais
Copy link
Contributor

Hey @haojin2020 -

The fix for this has been released in version 6.7.0.

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

Successfully merging a pull request may close this issue.

2 participants