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

isPlatformPaySupported for Apple Pay that doesn't consider supported card networks #1618

Open
acatalina opened this issue Mar 2, 2024 · 0 comments

Comments

@acatalina
Copy link

Is your feature request related to a problem? Please describe.
Hi, we've been having problems with the apple appstore review process because sometimes the Apple Pay button doesn't show on their end.

Looking at the behaviour of isPlatformPaySupported, I noticed that it uses deviceSupportsApplePay from the stripe ios library. This method checks if apple pay is available on the device and if the user has supported cards available.

Describe the solution you'd like
From apple's perspective, there are two checks. One to check that the device can support apple pay and the other that apple pay has available cards.

There are two paths for solutions:

  1. Split the two checks so our app can make its own decisions when showing the apple pay button. Also, this means that we could show a "Set up Apple Pay" button to trigger openPlatformPaySetup if Apple Pay is available but no cards are hold by the customer. At the moment, I don't see how we can make a decision to trigger openPlatformPaySetup.

  2. From iOS 15+, the Apple Pay flow allows customers to add cards directly. So in theory we could skip checking if cards are available for iOS15+ and directly trigger the apple pay flow. Behaviour that you can see in use in the stripe-ios library https://github.com/stripe/stripe-ios/blob/d3362b0cd52f0892f4f1fe1e9b0bce5172a82de6/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift

  let canMakePayments: Bool = {
            if #available(iOS 15.0, *) {
                // On iOS 15+, Apple Pay can be displayed even though there are no cards because Apple added the ability for customers to add cards in the payment sheet (see WWDC '21 "What's new in Wallet and Apple Pay")
                return PKPaymentAuthorizationController.canMakePayments()
            } else {
                return PKPaymentAuthorizationController.canMakePayments(usingNetworks: StripeAPI.supportedPKPaymentNetworks())
            }
        }() 

Additional context
This other issue #1273 could be related to this?

I've commented this problem as well in the stripe ios issues here stripe/stripe-ios#3350

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

No branches or pull requests

1 participant