How the Android Payments SDK works
The Zettle Payments SDK lets you take 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.
The integration with the Payments SDK is a self-service-process that you can go through without any dependency, to get quickly up-and-running. On the Developer Portal, you create an account and then create app 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 Payments SDK integration.
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.
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.
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.
- See refunding payments in Manage card payments.
- See refunding payments in Manage PayPal QRC payments.
Retrieving payments
You can retrieve payments using the unique reference ID provided when taking the payment.
- See retrieving payments in Manage card payments.
- See retrieving payments in Manage PayPal QRC payments.
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.
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.