Last updated
These docs are intended for a developer audience.Dismiss

Set up Google Pay™

This topic describes how to use FramePay to tokenize payments made using Google Pay™.

1. Obtain IDs and a publishable API key

When you first log in to Rebilly, you create an organization as part of the setup process. A default website is created when a new organization is created. For more information, see Organizations and websites.

  1. Log in or sign up to Rebilly.

  2. Obtain your organization ID and website ID
    1. In the left navigation bar, press Settings .
    2. In the Management section, press My organization & websites.
    3. In the Organization details section, note the ID value.
    4. In the Website section, note the ID value.
  3. Obtain your publishable API key
    1. In the left navigation bar, press Automations .
    2. In the Development section, press API keys.
    3. Optionally, if you have not created a publishable key:
      1. In top right of the screen, press Create API key.
      2. In the API key type section, select Publishable.
      3. Optionally, in the Organizations dropdown, select the organizations that can use the API key.
      4. Optionally, in the Allowed IPs field, enter the IP addresses that are permitted to use the API key.
      5. Press Save API key.
      6. Go to the API keys page.
    4. Select a publishable key and copy the Key value.
  4. Obtain your secret API key
    1. In the left navigation bar, press Automations .
    2. In the Development section, press API keys.
    3. Optionally, if you have not created a secret key:
      1. In top right of the screen, press Create API key.
      2. In the API key type section, select Secret.
      3. Optionally, in the Organizations dropdown, select the organizations that can use the API key.
      4. Optionally, in the Allowed IPs field, enter the IP addresses that are permitted to use the API key.
      5. Press Save API key.
      6. Go to the API keys page.
    4. Select a secret key and copy the Key value.

2. Set up Google Pay™

This step describes how to use FramePay to tokenize payments made using Google Pay™.

1

Initial set up

Set up the library and provide the HTML.

Include the FramePay stylesheet

This adds default styles to FramePay elements on the page.

HTML

Include the FramePay script

This exposes FramePay in the global JS scope as Framepay.

HTML

Include the HTML mounting points

You must specify an empty HTML element where FramePay renders the Google Pay™ button.

Edit your checkout form to add new HTML element with a unique ID.

HTML
2

Configure FramePay

This step describes the basic set up for mounting.

Initialize

Initialize FramePay with a configuration object.

For more information, see FramePay configuration reference.

JavaScript

Rebilly data

Provide your publishable API key, organization ID, and website ID to connect with the Rebilly API.

JavaScript

Transaction data

Provide the transaction data. Google Pay™ requires amount, currency, and label.

JavaScript

(Optional) Customize Google Pay™

Optionally, to control the look and feel of the Google Pay™ button and enable shipping address.

JavaScript
3

Get the payment token

Mount FramePay onto your page and listen for a payment token.

Mount the Google Pay™ button

After initialization, mount the Google Pay™ button in the container element. - Framepay.on('ready', ...) - Framepay.googlePay.mount(...)

JavaScript

Listen for the generated payment token

When a customer completes the Google Pay™ flow, Rebilly creates a payment token.

To retrieve it, listen for the token-ready event.

For more information, see Framepay.on('token-ready', ...).

JavaScript

Basic set up complete

To learn more about Google Pay™ and FramePay, see: Configuration reference.

Copy to clipboard
  • HTML
  • JavaScript
1<!doctype HTML>
2<HTML>
3 <head>
4 <link href="https://framepay.rebilly.com/framepay.css" rel="stylesheet">
5 <script src="https://framepay.rebilly.com/framepay.js"></script>
6 </head>
7 <body>
8 <form>
9 <div id="google-pay-mount"></div>
10 </form>
11 </body>
12</HTML>

Interactive example

This is an interactive example of a basic checkout form which uses FramePay to tokenize payments that are made using Google Pay™.

It showcases all possible Google Pay™ button styles.