Skip to content

task: use supported schemes for Apple Pay#22

Merged
luca-gr4vy merged 2 commits intomainfrom
task/TA-10631-use-supported-schemes-apple-pay
Mar 26, 2025
Merged

task: use supported schemes for Apple Pay#22
luca-gr4vy merged 2 commits intomainfrom
task/TA-10631-use-supported-schemes-apple-pay

Conversation

@luca-gr4vy
Copy link
Copy Markdown
Contributor

@luca-gr4vy luca-gr4vy commented Mar 26, 2025

Description: Makes the SDK use the value of supported_schemes from core-api instead of allowing all the networks for Apple Pay (hardcoded that way atm).

Ticket: https://gr4vy.atlassian.net/browse/TA-10631

Fixes support issue: https://gr4vy.atlassian.net/browse/TA-10618

Open sheet with no supported cards

ScreenRecording_03-26-2025.13-22-40_1.MP4

Open sheet with one supported Visa card

ScreenRecording_03-26-2025.13-25-53_1.MP4

Comment on lines +180 to +194
let networksMap: [String: PKPaymentNetwork] = [
"amex": .amex,
"cartesbancaires": .cartesBancaires,
"discover": .discover,
"eftpos": .eftpos,
"electron": .electron,
"elo": .elo,
"interac": .interac,
"jcb": .JCB,
"mada": .mada,
"maestro": .maestro,
"mastercard": .masterCard,
"privatelabel": .privateLabel,
"visa": .visa,
"vpay": .vPay
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a map so it's easier to reference and update networks

"vpay": .vPay
]

guard deviceSupportsApplePay(paymentNetworks: paymentNetworks) else {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guard completely prevented the payment sheet to open. Since in this case it checked for supported networks, we're ok to let it open and display the Apple UI error instead for unsupported networks instead.

Copy link
Copy Markdown
Member

@gryevns gryevns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@luca-gr4vy luca-gr4vy merged commit df62515 into main Mar 26, 2025
1 check passed
JohnnyDevi pushed a commit to JohnnyDevi/gr4vy-ios that referenced this pull request Apr 3, 2025
* commit 'df62515018bf0bb23883e9edb572d836c8118155':
  task: use supported schemes for Apple Pay (gr4vy#22)
  chore(country-items): Update cart item model to include seller country [TA-10180] (gr4vy#21)
  bump version (gr4vy#19)
  chore: add the preselect store option to readme (gr4vy#18)
  bump version (gr4vy#17)
  refactor: add preferAuthorize intent to the README (gr4vy#16)
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 this pull request may close these issues.

2 participants