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

iOS

Payment SDK (iOS, Swift)#

 The Payment SDK is a library that simplifies interaction with the Freedom Pay API.
Link to the SDK repository
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
Apple Pay Integration

Installation#

 To integrate SDK into your Xcode project using CocoaPods, add the following to your Podfile
 Then execute the following command in your terminal
$ pod install
 This will install the SDK and set it up for use in your Xcode project.

SDK integration#

Initialization#

Add the PaymentView to your UIViewController#

Pass the instance of paymentView to the SDK#

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


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, 0 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 nil 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)#


Apple Pay Integration#

 First, you need to create a merchant ID and configure the payment processing certificate in the developer console according to the documentation on the official PassKit website. After that, you can proceed with setting up the project and the integration itself

Enable Apple Pay support for your project in Xcode#

In the navigation window of your project, select the project file.
Choose your app in the TARGET menu.
Go to the Signing & Capabilities tab.
In the top menu, click the + button to add Apple Pay library support.
In the added Apple Pay section, click the Update button to synchronize merchant identifiers with the Apple Developer site.
Select the required merchant identifier to work with your app.

Import PassKit into your controller#

Add a check for the Apple Pay status on the device#

Set the list of supported Payment Networks#

Here’s a method that prepares the payment data and displays the Apple Pay controller#

Add a method for initializing and confirming payment using the SDK#

Add an Apple Pay Button to Your Screen#

 Creating the Apple Pay Button:
 Adding the Button to the View:
 Set the position of the button on the screen:
 Add a call to the initApplePay function to prepare the payment and display the Apple Pay window when the button is clicked:
 For proper functionality, make sure that Apple Pay is set up on the device and manage the button's state based on the received status:

Inherit the PKPaymentAuthorizationControllerDelegate delegate#

Implement the delegate methods#


Support#

If you have questions or need help, feel free to reach out! 👋
Email: support@freedompay.kz
Modified at 2025-02-17 19:28:05
Previous
Provider SDK (Android)
Next
Android