Apple Pay on Web-Integration with Rails-Part 1

Apple Pay

Apple Pay is a simple and secure way to make purchases in stores, in apps and also on the Web. Users can now make payments at all of the above with just a touch on their iPhones.

Apple Pay Demo

In this series of blogs, we will guide you to integrate Apple Pay in your web application and start accepting payments through it.

This series consists of following blog posts:

  1. Register Merchant ID, domain, and generate certificates
  2. Create merchant session, show payment modal and authorize payment
  3. Decrypt Apple Pay JSON response

Lets get started with the first one.

Read more


Apple Pay on Web-Integration with Rails-Part 2

Apple Pay

We are working step-by-step to integrate payments in our web application through Apple Pay. This is the second post of the series of blog posts. The series consists of below posts:

  1. Register Merchant ID, domain, and generate certificates
  2. Create merchant session, show payment modal and authorize payment
  3. Decrypt Apple Pay JSON response

So far, we have registered our Merchant ID and domain on Apple Developer Console. We have also generated the certificates needed for generating a merchant session and for processing payments.

Here, we will use those certificates to generate the merchant session, show the payment modal to the customers, and handle various scenarios of authorising payments by the customers.

Read more


Apple Pay on Web-Integration with Rails-Part 3

Apple Pay Logo

This is the third and last post in this series of blog posts where we have been improving our application to support payments via Apple Pay. All the posts of this series are as follows:

  1. Register Merchant ID, domain, and generate certificates
  2. Create merchant session, show payment modal and authorize payment
  3. Decrypt Apple Pay JSON response

In previous posts, we generated various certificates for Apple Pay and added some code to make the Apple Pay button visible to the users. We were also able to get the success response (JSON) from Apple on successful authorisation of payment by the user.

The JSON response returned by Apple contains the token in encrypted form. Some of the payment gateways accept the encrypted data for creating charges (as they handle decryption on their end) while others need the JSON to be decrypted on your end before passing it to their API. So, based on what payment gateway you are going to use, you can read/skip this post.

The data can be decrypted using the certificates we generated in first post of this series. Lets see how we can do that.

Read more