How the Android payment SDK works

The Zettle payment SDK lets you accept in-store payments and issue refunds from any iOS/Android app. The Zettle SDK is embedded in the Zettle app (Zettle POS and payment SDK). The SDK is designed for easy implementation and usage, to provide the best possible everyday payment experiences for merchants.

An overview showing the relationship between the client device, the payment SDKs, and available payment-related services.

Integration scenarios

The integration with the payment SDK is a self-service-process that you can go through without any dependency, to get quickly up-and-running. You create an account in the Developer Portal, register your app, and receive the necessary credentials. When done, you receive a demo account that can be used to test the SDK before going live. See Get started.

Typical integration scenarios:

  • You have a service that runs a POS system, and you want to integrate Zettle as a payment provider.
  • You have an e-commerce solution and want to integrate this with Zettle to support both online and in-person sales.

The following describes some concepts to understand to get the most out of your Zettle payment SDK integration.

Important concepts

Authentication

You can authenticate with the SDK in the following ways:

  • Authentication fully managed by the SDK. In this case the SDK provides an authentication user interface, and handles the authentication process entirely.

  • Authentication through a pre-authorised refresh token. This token is retrieved using the PKCE method, which lets the SDK refresh the token without the need of a client secret.

See Initialisation.

User

When integrating with the SDK, you can listen for user data. Doing this, you can receive user and organisation IDs, as well as currency, country, and time zone for an authenticated user.

Payments

A key payment concept in the current SDK is that you need to provide a unique ID (named reference). When integrating, this is your only way of retrieving the payment again within the SDK, for example to refund or retrieve a payment. Ensure that you provide the logic to create and store these IDs in your integration.

Refunding payments

Given that you have a reference ID, you can refund payments fully or partially. Here the SDK has a built-in safety procedure to ensure an authorised person is doing the refund. The procedure includes verification of your password with Zettle through a provided user interface.

Currently there is no way to bypass this user interface, even if you handle this integration yourself, and provide the refresh token at log in.

Retrieving payments

You can retrieve payments using the unique reference ID provided when taking the payment.

Pairing card readers

You can trigger the settings screen for card readers. This contains the user interface for managing readers (find, pair and forget).

See card reader settings in Manage card payments.

Activation

To be able to use QRC in the SDK it has to be activated. When the feature has been activated, a unique QR code is generated for each transaction. You can directly trigger the user interface for activation.

See QRC activation in Manage PayPal QRC payments.