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 iOS 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,
        merchantName: "Merchant Name", //Optional: Defaults to "Geidea"
        merchantCapabilities: [.capability3DS], //Optional: Defaults to [.capability3DS]
        supportedNetworks: [.visa, .masterCard] //Optional: Defaults to [.visa, .masterCard, .amex]
    ),
    language: .en,
    region: .egy,
    theme: SDKTheme(
        style: .light,
        primaryColor: "#E52D2A",
        secondaryColor: "#FCEEEE"
    )
)

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

ParameterTypeRequired/OptionalDescription
AmountNumberRequiredTotal payment amount
CurrencyStringRequiredCurrency code (e.g., "EGP")
SignatureStringOptionalSecurity signature (generated with
generateSignature public function in SDK)
timeStampStringOptionalTimestamp in format "YYYY-MM-DD HH:MM:SS"
appearanceObjectOptionalDisplay settings for the payment form
appearance.showAddressBooleanOptionalWhether to show the address field
appearance.showEmailBooleanOptionalWhether to show the email field
orderObjectOptionalOrder details
order.orderItemsArrayOptionalList of items in order
order.orderItems[ ].countNumberRequiredQuantity of the item
order.orderItems[ ].nameStringRequiredName of the item
order.orderItems[].priceNumberRequiredPrice of the item
order.orderItems[].iconStringOptionalIcon URL for the item
order.summaryObjectOptionalOrder summary totals
order.summary.subTotalNumberRequiredSubtotal amount (excluding any taxes)
order.summary.shippingNumberOptionalShipping cost
order.summary.vatNumberOptionalVAT/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",
)
GDPaymentSDKConfiguration(
    sessionId: sessionId,
    applePayConfig: ApplePayConfigurations(
        merchantId: applePayMerchantId,
        merchantName: "Merchant Name",
        supportedNetworks: [.visa, .masterCard, .mada]
    ),
    language: .en,
    region: .egy,
    theme: theme
)

API Reference

GDPaymentSDKConfiguration

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

SDKTheme

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

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

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?
}


Did this page help you?