Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Apple Pay JS Into A Website

I'm looking into integrating Apple Pay into a website using the new Apple Pay JS SDK. The documentation is currently pretty minimal, concerning just the API declarations and how to instantiate a new ApplePaySession object.

Is there any example code available yet, or has anyone actually implemented this themselves yet, showing the typical API integration flow for a web application?

The only examples I've been able to find anything for all appear to be for third-party payment providers' own SDK integrations of Apple Pay.

like image 558
Martin Costello Avatar asked Jun 14 '16 17:06

Martin Costello


People also ask

Can Apple Pay be used on a website?

You can pay using Apple Pay in stores, within apps and on the web, and more.

Does Apple Pay have an API?

Overview. Safari supports two APIs for implementing payment requests: Apple Pay JS API, and the W3C Payment Request API. Both APIs present the same Apple Pay payment sheet on Safari, and offer nearly the same user experience.


1 Answers

I've published end-to-end ApplePayJS example code on github here

https://github.com/norfolkmustard/ApplePayJS

It uses PHP for the server-side part, needed for the initial vendor validation to begin the transaction. The rest is in javascript.

ApplePayJS != cash in the bank, just a means of getting a tokenised credit card from a customer. You hand that card number off to a third-party payment processor like stripe.com, braintreepayments.com, authorize.net

Cheers

like image 122
Stu Cartwright Avatar answered Sep 25 '22 22:09

Stu Cartwright