Does Spreedly support Apple Pay on the Web?
This question has been raised a few times as our Apple Pay guide primarily focuses on mobile applications.
Implementing Apple Pay on the Web is completely independent of using Spreedly iFrame. Spreedly iFrame does not interact with Apple Pay on the Web nor does it need to. Apple returns the payment data to you in an encrypted form, you pass the encrypted data to Spreedly.
Certificates
Two certificates are required to use Apple Pay on the web.
- Payment Processing Certificate This certificate is used to securely transfer payment data. Apple use the payment processing certificate’s public key to encrypt the payment data. Spreedly uses private key to decrypt the data when processing payments. The same certificate can be used for both Apple Pay and Apple Pay on the Web. Implementing Apple Pay for use with Spreedly requires Spreedly hold the private key. Docs to create a Payment Processing Certificate can be found here: Create an Apple Pay certificate
- The Merchant Identity Certificate This certificate is generated by Apple. The certificate is placed on your servers and used to authenticate your merchant sessions. Step by step instructions to generate the Merchant Identity Certificate can be found in Apple’s full documentation
Using Apple Pay JS on your web page
Using Apple Pay on the Web requires you to start an ApplePaySession and make the necessary calls to generate a token. API reference for Apple Pay JS
When the proper steps have been executed to generate a payment, the callback onpaymentauthorized will be called with an event. The event contains a payment attribute which contains a PaymentToken. The payment token contains a paymentData field. The paymentData field is used to create a payment method with Spreedly.
Return the Apple Pay token to your server
Once Apple returns the Apple Pay token, return the Apple Pay token to your server.
Create an Apple Pay Payment Method
Pass Apple Pay token into a purchase
You can also pass the Apple Pay token directly in for a purchase
Please sign in to leave a comment.
Comments
0 comments