iOS SDK

Overview

The Native Payment SDK enables seamless integration of secure and customizable payment flows within mobile applications. It supports card payments, Apple Pay, and 3D Secure verification, offering flexibility in UI design, language support, and presentation style. Designed for both development (sandbox) and production environments, this SDK is optimized for modern UX with support for light/dark modes and RTL languages.

Key Feature

Dynamic Payment Methods

Flexible UI & Presentation Options

Native 3D Secure Authentication

Fast Card Scanning

Security & Compliance

Optimized Performance

Multi-language & Localization Support

Smart Error Handling


How it works

Mobile SDK Workflow


Getting Started

This guide will walk you through the integration process for the Geidea Android SDK

  1. Set up and initialize the Geidea iOS SDK in your application.
  2. The SDK will display available payment methods and gather customer payment information.
  3. The SDK will process and transmit the payment request to Geidea's payment gateway.
  4. Receive the payment processing response through the iOS SDK plugin.
  5. Display the transaction outcome to your customer within your iOS application.

Prerequisites

xCode VersioniOS VersionSwift Version
13 and above15 and above6.1 and above

Integration Guide

Installation

Initialization

  1. Step 1: Create a Payment Session (Server-Side)

    You can check the whole API reference from here.

    Before launching the SDK, you need to create a payment session by calling the Geidea API.

❗️

In order to create session you’ll need to generate a signature as demonstrated below

Create Signature

  1. Concatenate the string of MerchantPublicKey, OrderAmount, OrderCurrency, MerchantReferenceId, timeStamp.
  2. Amount must be formatted with 2 decimals.
  3. Hash (SHA-256) the above concatenated string by MerchantAPIPassword.
  4. Convert Hashed Value to Base64Str
  5. API Endpoint
POST https://api.merchant.geidea.net/payment-intent/api/v2/direct/session
https://api.ksamerchant.geidea.net/payment-intent/api/v2/direct/session
https://api.geidea.ae/payment-intent/api/v2/direct/session
  1. Step 1: import GDPaymentSDK
import GeideaPaymentSDK

  1. Step 2: SDK Configuration (Client-Side)
let configuration = GDPaymentSDKConfiguration(
                sessionId: sessionId,
                applePayConfig: ApplePayConfigurations(merchantId: applePayMerchantId),
                language: .en,
				region: .egy, 
                theme: SDKTheme(
                    style: .present(),
                    primaryColor: "#E52D2A",
                    secondaryColor: "#FCEEEE",
                    merchantLogo: UIImage(resource: .icon)
                )
            )

Create a Payment Session (Server-Side)

❗️

Before launching the SDK, you need to create a payment session by calling the Geidea API.

Include the following header with your request

Authorization: Basic <BASE64_ENCODED_CREDENTIALS>

Where <BASE64_ENCODED_CREDENTIALS> is your merchant key and password encoded in base64 format:

base64encode("MERCHANT_KEY:MERCHANT_PASSWORD")

Request Body

{
    "amount": 8.0,
    "appearance": {
        "showAddress": true,
        "showEmail": true
    },
    "currency": "EGP",
    "order": {
        "orderItems": [
            {
                "count": 1,
                "icon": "",
                "name": "test",
                "price": 2.0
            }
        ],
    "summary": {
            "shipping": 2.0,
            "subTotal": 5.0,
            "vat": 1.0
        }
    },
    "signature": "J5sBLvid9k9NZ+94NG5jkdEVySxe73ZpLK1ujYD7Zy8\u003d",
    "timeStamp": "2025-09-29 11:32:50"
}

Payment Session Response

{
	"session": {
		"id": "b90e8b08-178e-4a8e-0b6c-08dde9fbe245",
	    // ...
	},
	"responseMessage": "Success",
	"detailedResponseMessage": "The operation was successful",
    // ...
}
🚧

We will use this session ID to initiate the payment SDK on the client-side.

Payment Parameters Reference

Parameter

Type

Required/Optional

Description

Amount

Number

Required

Total payment amount

Currency

String

Required

Currency code (e.g., "EGP")

Signature

String

Optional

Security signature (generated with generateSignature public function in SDK)

timeStamp

String

Optional

Timestamp in format "YYYY-MM-DD HH:MM:SS"

appearance

Object

Optional

Display settings for the payment form

appearance.showAddress

Boolean

Optional

Whether to show the address field

appearance.showEmail

Boolean

Optional

Whether to show the email field

order

Object

Optional

Order details

order.orderItems

Array

Optional

List of items in order

order.orderItems[ ].count

Number

Required

Quantity of the item

order.orderItems[ ].name

String

Required

Name of the item

order.orderItems[].price

Number

Required

Price of the item

order.orderItems[].icon

String

Optional

Icon URL for the item

order.summary

Object

Optional

Order summary totals

order.summary.subTotal

Number

Required

Subtotal amount (excluding any taxes)

order.summary.shipping

Number

Optional

Shipping cost

order.summary.vat

Number

Optional

VAT/tax amount


Presentation Styles

The SDK offers multiple presentation options to match your app’s UX requirements:

  1. Full Screen Present

Best for: Dedicated payment flow with maximum screen real estate

  1. Bottom Sheet Modal

Best for: Quick checkout without leaving the current screen

Theme Customization

Customize the SDK appearance to match your brand:

let theme = SDKTheme(
	style: .light,
	primaryColor: "#FF4D00",
	secondaryColor: "#F5F5F6",
	merchantLogo: UIImage(
	resource: UIImage(resource: .icon)
)
GDPaymentSDKConfiguration(
	sessionId: sessionId,
	applePayConfig: ApplePayConfigurations(merchantId: applePayMerchantId),
	language: .en,
	environmentType: .sandbox,
	region: .egy,
	theme: theme
))

Payment Testing

Use a Sandbox environment in the SDK configuration to test the different payment scenarios using the test cards here


API Reference

GDPaymentSDKConfiguration

let theme = SDKTheme(
	style: .light,
	primaryColor: "#FF4D00",
	secondaryColor: "#F5F5F6",
	merchantLogo: UIImage(
	resource: UIImage(resource: .icon)
)

SDKTheme

public struct SDKTheme {
      let style: ThemeStyle
      let primaryColor: String
      let secondaryColor: String
      let arFontType: FontType
      let enFontType: FontType
      let merchantLogo: UIImage

      public init(
        style: ThemeStyle = .light,
        primaryColor: String = "#0036FF",
        secondaryColor: String = "#F5F5F6",
        merchantLogo: UIImage,
    ) {
        self.style = style
        self.primaryColor = primaryColor
        self.secondaryColor = secondaryColor
        self.arFontType = .Almarai
        self.enFontType =  .Montserrat
        self.merchantLogo = merchantLogo
    }
}

GDPaymentResult

public struct GDPaymentResult {
    public var orderId: String
    public var agreementId: String?
    public var tokenId: String?
    public var paymentMethod: PayPaymentMethod?
}

public struct PayPaymentMethod {
    public struct ExpiryDate {
        public var month: Int
        public var year: Int
    }
    
    public var brand: String?
    public var type: String?
    public var cardholderName: String?
    public var maskedCardNumber: String?
    public var expiryDate: ExpiryDate?
}	

GDPaymentError

public struct GDSDKError {
    public var code: String
    public var message: String
    public var details: String?
}