Skip to main content

Integrate Mobile SDK

This guide walks you through implementing Mobile SDK integration with Amazon Payment Services across different mobile platforms.

Prerequisites​

Before starting your integration, ensure you have:

  1. Test Account Access
    Contact merchantsupport-ps@amazon.com to obtain access to our test environment for testing and development.

  2. Security Credentials
    Retrieve your integration credentials from the merchant dashboard:

    1. Log into your Amazon Payment Services test account
    2. Navigate to Merchant Management → Security Settings
    3. Save the following values:
    • Access Code - Authentication token for API requests
    • Merchant Identifier - Your unique merchant ID
    • SHA Request/Response - Keys for signature calculation
  3. Platform-Specific Setup
    Ensure your development environment is configured for your target platform(s).

Integration Steps​

1

Platform Specific Installation

Platform Specific Installation​

Installation​

Add the Amazon Payment Services SDK to your iOS project:

pod 'PayFortSDK'

Implementation​

import PayFortSDK

class PaymentViewController: UIViewController {

func processPayment() {
// Initialize PayFort SDK
let payFort = PayFortController.init()

// Prepare payment request
var request: NSMutableDictionary = NSMutableDictionary()
request["command"] = "PURCHASE"
request["access_code"] = "zx0IPmPy5jp1vAz8Kpg7"
request["merchant_identifier"] = "CycHZxVj"
request["merchant_reference"] = "XYZ9239-yu898"
request["amount"] = "10000"
request["currency"] = "AED"
request["language"] = "en"
request["customer_email"] = "customer@example.com"
2

Generate SDK Token

Generate SDK Token​

Before processing any mobile payment, you must generate an SDK token on your server. This token authenticates mobile SDK requests and has a lifetime of one hour.

API Endpoint​

https://sbpaymentservices.payfort.com/FortAPI/paymentApi

Request Sample​


{
"command": "SDK_TOKEN",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"language": "en",
"device_id": "ffffffff-a9fa-0b44-7b27-29e70033c587",
"signature": "7cad05f0212ed933c9a5d5dffa31661acf2c827a"
}

Response Sample​

{
"command": "SDK_TOKEN",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"language": "en",
"response_message": "Success",
"response_code": "20000",
"status": "20",
"sdk_token": "Dwp78q3",
"signature": "c63c2d931e0c2fd7f8c2c5f5b5c5e5f5d5c5e5f5"
}
3

Handle Payment Response

Handle Payment Response​

After payment processing, the SDK returns the transaction results to your application.

Sample Response​

{
"command": "PURCHASE",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"merchant_reference": "XYZ9239-yu898",
"amount": "10000",
"currency": "AED",
"language": "en",
"customer_email": "customer@example.com",
"response_message": "Success",
"response_code": "14000",
"status": "14",
"fort_id": "149295435400084008",
"payment_option": "VISA",
"authorization_code": "123456",
"card_number": "400555******0001",
"expiry_date": "2105",
"signature": "response_signature"

Check transaction status​

To check the transaction status, check the Check a Transaction Status section.

Handling the response​

If you have a webhook, check the webhook section to understand how we send transaction responses to your system.

For detailed parameter specifications, refer to our Mobile Integration API Reference.

Go-live​

Test your integration using one of our testing cards.
Make sure to visit our go-live checklist to go live with your integration.

Support​

Need help with your integration? Contact our technical support team at merchantsupport-ps@amazon.com.

Was this page helpful?

Thanks for your feedback!