I am setting up Apple Pay on the web with Stripe and want to use the Sanbox Tester account we setup in iTunes Connect to test on both iOS and macOS in Safari.
On the test device (2017 iPad) I have logged in to iCloud with the Sandbox Tester account and added a test card into Wallet in the settings app. On my development website the Apple Pay button is showing up and interactions work fine.
I created a new account on my MacBook Pro (Retina, Mid 2015) and again logged in to iCloud with the same Sandbox Tester account. When I view my development website on here, however, the checkAvailability
function always returns false:
Stripe.applePay.checkAvailability(function(available) {
alert(available);
...
}
Presumably this is because I need further setup for Apple Pay to work. But for the life of me I can't get macOS cooperate. After reading some documentation here are some points that I think are relevant:
Is it possible for me to enable test payments with my sandbox user on macOS using handoff, and if so what steps am I missing?
window.ApplePaySession.canMakePayments()
in the console returns false
The steps outlined here are all in place on both devices. When I open Safari on the MacBook and navigate to a page, the handoff icon shows on the multi-tasking screen and vice-vera, when I open a tab in iOS Safari, the handoff icon shows to the left of the dock. It appears handoff is working as expected.
Also, Universal Clipboard is working in both directions.
Note: On a different (non-sandbox) iCloud account on this same MacBook, which is using handoff with a different iPad, the payment options show up in Safari as expected.
Adding a Test Card Number To get started, add a test card to Wallet: Make sure to sign out of iCloud and sign into your test device with your sandbox tester account. Go to Wallet and tap Add Credit or Debit Card. Using your test credential, follow the steps to add a new card using manual entry.
In the Safari app on your Mac, at checkout, click Apple Pay. You can change the credit card, shipping address, or contact information before completing your purchase. Complete the purchase. Mac or Apple keyboard with Touch ID: Place your finger on Touch ID to complete the purchase.
When you visit a website that uses Apple Pay, the website can check if you have Apple Pay enabled on that device. If you're using a Mac to which a card cannot be added, the website can check if you have Apple Pay set up on an iPhone or Apple Watch. Apple websites and apps can also check to see if you have Apple Card.
Go to your Safari menu bar, click Safari > Preferences then select the Privacy tab. Then make sure: Allow websites to check if Apple Pay is set up is selected. I confirm that the option is checked, both on my Mac and on my iPhone.
Apparently, Apple Pay on the Web using handoff is not possible with iPads. The only compatible devices are:
A Mac model introduced in 2012 or later with an Apple Pay-enabled iPhone or Apple Watch
This comes directly from Apple. Pretty explicit details can be found on this page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With