Freedom Pay
  1. Payment SDK
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Payment Cards
      • Overview
      • Dictionaries
      • Bulk issue
      • Issue card
      • Issue plastic card
      • Activate card
      • Block card
      • Unblock card
      • Set PIN
      • Reset PIN counter
      • Close card
      • Update client
      • Card info
      • Balance
      • Secret data
      • Secret data (version 2)
      • Statement
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction request' status
      • Transaction info
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Overview
      • Design
      • iOS SDK
      • Android SDK
      • OAuth2
        • Authorization link
        • Token exchange
        • Token refresh
        • User info
        • Request profile
        • Get profile status
        • Create user
        • Update user
      • OIDC
        • Authorization endpoint
        • Token exchange
        • Userinfo
      • Error codes
      • Examples
        • Keycloak
    • Transfer
      • Overview
      • Get token
      • Refresh token
      • Get agents
      • Fees
      • Create person
      • Create business
      • Create transfer
      • Print application
      • Confirm
      • Search
      • Payout
      • Payout confirm
      • Cancel
      • Get person info
      • Get business info
      • Status
      • Info
    • Device ID
      • Android SDK
      • iOS SDK
  1. Payment SDK

Android

Payment SDK (Android, Kotlin)#

 The Payment SDK is a library that simplifies interaction with the Freedom Pay API. Supports Android 4.4 and above.
Link to the SDK repository
Download the demo APK
Source code for the demo application

Features#

Payment Initialization
Payment Cancellation
Payment Refund
Payment Clearing
Recurring Payments with Saved Cards
Fetching Payment Information/Status
Adding/Removing Cards
Payment with Saved Cards
Direct Debit Payments
Google Pay Integration

Installation#

 Add the Jitpack repositories to your build.gradle at the project level, at the end of the allprojects repositories
 Add to your build.gradle

SDK integration#

Initialization#

Add the PaymentView to your activity#

<money.paybox.payboxsdk.view.PaymentView
   android:id="@+id/paymentView"
   android:layout_width="match_parent"
   android:layout_height="match_parent"/>

Pass the instance of paymentView to the SDK#

To track the progress of loading the payment page, use WebListener#


SDK Configuration#

Test mode#

By default, test mode is enabled

Region selection#

Region.DEFAULT is the default value
 The Region class has the following values:
ParameterValue
DEFAULTKazakhstan and other countries of presence
RURussia
UZUzbekistan
KGKyrgyzstan

Payment System selection#

Payment currency selection#

Auto-clearing activation#

Encoding configuration#

By default, UTF-8

Lifetime of the recurring profile#

By default, 36 months (the parameter is excluded from the list when the value is 0)

Lifetime of the payment page, within which the payment must be completed#

By default, 300 seconds

Enabling recurring payment mode#

By default, it is false

Setup customer's phone#

 The customer's phone number will be displayed on the payment page. If not provided, the user will be prompted to enter it on the payment page.

Setup customer's email#

 The customer's email will be displayed on the payment page. If the email is not provided, the user will be prompted to enter it on the payment page.

Language of the payment page#

To transmit information from the payment gateway#

Display a Frame instead of the payment page#

By default, it is false

Working with the SDK#

Creating a payment#

 After calling it, the payment page will open in the paymentView.

Recurring payment#

Fetching the payment status#

Payment clearing#

 If null is specified instead of the clearing amount, the clearing will be processed for the full payment amount.

Payment cancellation#

Payment refund#

Saving the card#

 After calling it, the page to add a card will open in the paymentView.

Retrieve the list of saved cards#

Removing a saved card#

Creating a payment with a saved card#

The createCardPayment method using cardId is deprecated

Confirming the payment of a created payment#

 After calling it, the payment page for 3DS authentication will open in the paymentView.

Confirming the payment of a created payment with a direct debit (without acceptance)#


Google Pay Integration#

 Guide to Registering in Google Pay Business Console for an Android App

Sign Up for Google Pay Business Console#

Visit: Google Pay Business Console
Sign in with a Google account (or create one).
Click "Get Started".

Create a Project & Set Up Android Integration#

Create a new project or select an existing one.
Go to Google Pay API in the left menu.
Click "Create new integration" (or "Add Integration" if available).
Enter your app details:
App name
Platform: Android
Package name (App bundle ID)
SHA-1 certificate fingerprint (for app verification)
Click "Save" or "Continue"

Configure Android Integration#

Navigate to Google Pay API → Android Integration
Verify:
Correct package name
Valid SHA-1 fingerprint
Ensure the project is properly linked to your app

Submit App Screenshots for Approval#

Google requires payment flow screenshots for review.
Go to "Integrate with your Android app".
Select Integration type: Gateway.
Upload screenshots of:
Item selection (product/service screen)
Pre-purchase (order confirmation)
Payment method selection (Google Pay option)
Google Pay checkout screen
Post-purchase confirmation (receipt/success message)
Click "Save", then "Submit for approval"
Wait for Google’s review (may take a few days)

Go Live with Google Pay#

Once approved, switch from test to production mode.
Test real transactions to ensure smooth payments.

Important Notes#

This guide covers Google Pay Business Console setup only.
After registration, integrate Google Pay SDK into your app (follow official docs).
For PayBox Kotlin SDK integration, refer to: PayBox SDK Documentation

Add the dependency to your build.gradle#

Next, update the AndroidManifest#

<application>
   ...
   <!-- Enables the Google Pay API -->
   <meta-data android:name="com.google.android.gms.wallet.api.enabled"
       android:value="true" />
</application>  	

Add the PayButton to your XML#

<com.google.android.gms.wallet.button.PayButton
   android:id="@+id/buttonPaymentByGoogle"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   />

Initializing the payment button for Google Pay PayButton#

Initializing the PaymentsClient#

 Wallet.getPaymentsClient is the method to get an instance of PaymentsClient.
 Method Parameters:
ParameterValue
ENVIRONMENT_PRODUCTIONproduction environment
ENVIRONMENT_TESTtest environment
THEME_LIGHTlight theme

Creating a payment using Google Pay#

sdk.createGooglePayment— Creating a payment using Google Pay.
createPaymentDataRequest() — A method that returns a PaymentDataRequest object. This object defines the parameters and requirements for the payment data request, such as payment methods, shipping address, and more (the code is provided below).
loadPaymentData() — Initiates an asynchronous task to load payment data using the provided request.
AutoResolveHelper.resolveTask<PaymentData>()— A method used to handle the payment data loading task.
REQUEST_CODE— A request code used to identify the result of the task in the onActivityResult method.

The createPaymentDataRequest() method creates and returns a PaymentDataRequest object for use with the Google Pay API#

PaymentDataRequest.newBuilder() - Creates a new builder for the payment data request.
setTransactionInfo() - Sets transaction information, such as the total payment amount and currency code.
PaymentMethodTokenizationParameters.newBuilder() - Creates a builder for the payment method tokenization parameters.
setPaymentMethodTokenizationType() - Sets the tokenization type (in this case, a payment gateway).
addParameter() - Adds parameters for the payment gateway, such as gateway and gatewayMerchantId.
setPaymentMethodTokenizationParameters() - Sets the tokenization parameters in the payment data request.

Get the result in onActivityResult()#

onActivityResult - Used to handle the results returned by the Google Pay integration activity.
data - The object containing the data returned by the activity.
Activity.RESULT_OK - This constant indicates the successful completion of the operation.
AutoResolveHelper.RESULT_ERROR - This constant is used to indicate that an error occurred while resolving the request.

Payment confirmation#


Support#

If you have questions or need help, feel free to reach out! 👋
Email: support@freedompay.kz
Previous
iOS
Next
Overview