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

CkoPhoneNumber coding key query #47

Closed
adamwaite opened this issue Mar 23, 2021 · 5 comments
Closed

CkoPhoneNumber coding key query #47

adamwaite opened this issue Mar 23, 2021 · 5 comments

Comments

@adamwaite
Copy link

Hi.

Just wanted to query something I've noticed in the API contracts for registering a card in the payment flows (POST https://api.checkout.com/tokens).

The CkoAddress type (and other associated types, like CkoCardTokenRequest) is encoded using snake case keys (https://github.com/checkout/frames-ios/blob/master/Source/CkoAddress.swift), as can be seen in the Encodable implementation. addressLine1 becomes address_line1 for example.

However CkoPhoneNumber is not encoded with any custom CodingKeys (https://github.com/checkout/frames-ios/blob/master/Source/CkoPhoneNumber.swift) and will therefore take the standard swift case convention e.g. countryCode remains as countryCode.

Is this a known quirk on the API? Or maybe a bug in this SDK?

@deepesh-vasthimal-cko
Copy link
Contributor

deepesh-vasthimal-cko commented Mar 23, 2021

@adamwaite Thanks for notifying this. We are aware of this now and we will plan to make a fix in the SDK with our next release.

@deepesh-vasthimal-cko
Copy link
Contributor

@adamwaite , This is now fixed as part of our latest release 3.4.0. Please feel free to re-open this if you have any further questions.

@adamwaite
Copy link
Author

adamwaite commented Apr 1, 2021

Hey CkoAddress still implements CodingKeys, is that an edge case?

https://github.com/checkout/frames-ios/blob/develop/Source/Core/CkoAddress.swift

@adamwaite
Copy link
Author

Also CkoCardTokenRequest

@daven-gomes-cko
Copy link
Contributor

Hey @adamwaite, the update was a quick fix that just addressed the Codable objects that were causing errors. We'll work on improving the whole decoding/encoding logic for a future update. 🙂

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

No branches or pull requests

3 participants