Take Payments

Integrate With Digital Wallets

Take payments with digital wallets like Apple Pay and Google Pay with Square APIs and SDKs.

In-App Payments SDK
Payment Form

Square payment APIs and SDKs support in-person, online, and in-app payments with nonces (encrypted payment tokens) generated from digital wallets like Apple Pay and Google Pay.

Important

Apple Pay is only available for Square accounts based in the United States.

Take in-person payments with digital wallets
Permalink Get a link to this section

Digital wallet support is built into Reader SDK, which supports contactless payments including Apple Pay and Google Pay when paired with tap-enabled Square Readers.

Take online payments with digital wallets
Permalink Get a link to this section

Digital wallets are supported in the Square Payment Form and implemented with a few lines of JavaScript. Instead of collecting credit card information, the Payment Form makes an asynchronous call to the digital wallet and automatically generates a nonce from the response.

Digital wallet support is also built into the Checkout API, which automatically displays digital wallet buttons when the client browser supports them.

Take in-app payments with digital wallets
Permalink Get a link to this section

The In-App Payments SDK for mobile clients supports digital wallet payments by providing methods to create wallet-specific payment authorization requests and callbacks to get authorization results. The authorization flow for all digital wallets is asynchronous and involves multiple actors.

Nonce generation with Google Pay
Permalink Get a link to this section

To handle payments with Google Pay, mobile apps implement the Google digital wallet using the Google Android Wallet library then use the In-App Payments SDK to request a wallet token and convert it to a nonce that Square can use to process payment:

  1. The mobile app gets a Google Pay client instance to check the Google Pay configuration for supported card networks and payment method.

  2. The mobile app enables the Google Pay button if Google Pay is available and ends the process flow otherwise.

  3. The mobile app creates a payment request with Square request parameters, sends it to the digital wallet library, and waits for the results of the Google Pay activity.

  4. The mobile app sends the Google Pay payment token to In-App Payments SDK to exchange the Google Pay token for a valid Square nonce and completes the payment flow normally with the returned nonce.

in-app-payments-google-pay

Nonce generation with Apple Pay
Permalink Get a link to this section

To handle payments with Apple Pay, mobile apps implement the PassKit framework from Apple then use the In-App Payments SDK to authorize payment and generate a nonce that Square can use to process payment:

  1. If Apple Pay is available on the device, the mobile app shows a button that allows the customer to checkout using Apple Pay.

  2. The mobile app creates a PassKit payment request with the payment details and prompts the customer to authorize the payment.

  3. If payment is authorized, the mobile app uses the In-App Payments SDK to create a Square nonce request from the PassKit payment object.

  4. The In-App Payments SDK exchanges the PassKit payment information for a valid Square nonce and completes the payment flow normally with the returned nonce.

in-app-payments-apple-pay