Skip to content

Glomo iOS SDK v1

Official iOS SDK for integrating Glomo payment checkout flows into your native iOS applications. The public contract is deliberately aligned with the Flutter and Android SDKs.

Current version: v1.3.0. Upgrading from v1.2.0 is a tag bump and two optional listener methods - no API changed and no call site needs to move. v1.3.0 adds onCheckoutStageChanged and onCheckoutClosed, both with protocol-extension defaults.

Upgrading from v1.1.0? Also a tag bump. v1.2.0 narrows which pages may report a payment result (Origin Policy), and the surfaces the SDK paints before the page loads now follow whether dark mode is switched on for your account (Dark mode).

Upgrading from v1.0.0? Also a tag bump and one optional parameter. v1.1.0 adds appColorScheme. The public API follows Semantic Versioning from v1.0.0 onward.

Full Changelog is also available.

Prerequisites

Before using this SDK, you need:

  • API credentials (Public Key) from your Glomo dashboard
  • An order ID created via the Glomo API (or a subscription ID for subscription payments)

System Requirements

RequirementVersion
iOS16.0 or later
Swift tools5.9 or later
DistributionSwift Package Manager only

CocoaPods is not supported.

Installation

Add the package in Xcode (File → Add Package Dependencies) using the repository URL, and select the v1.3.0 release tag:

https://github.com/glomopay/glomo-ios-sdk.git

Or declare it in your own Package.swift:

dependencies: [
    .package(url: "https://github.com/glomopay/glomo-ios-sdk.git", from: "1.3.0"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [.product(name: "glomo-ios-sdk", package: "glomo-ios-sdk")]
    ),
]

The package product is named glomo-ios-sdk. The Swift module is GlomoPaySDK:

import GlomoPaySDK

Required Info.plist entries

Bank flows ask the user to upload documents. The checkout uses WebKit's own upload sheet, which presents Camera and Photo Library from your application's process, so your app must declare both usage descriptions or those options will not work:

<key>NSCameraUsageDescription</key>
<string>Camera access is used to capture documents during checkout verification.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library access is used to upload documents during checkout verification.</string>

Use wording that describes your own app. Without these keys, iOS terminates the app when the user picks those options.

Quick Start

import GlomoPaySDK
import UIKit

final class CheckoutCoordinator: GlomoPayListener {

    private var handle: GlomoPayCheckoutHandle?

    func start(from presenter: UIViewController, orderId: String) {
        let config = GlomoPayConfig(
            publicKey: "live_your_public_key",
            orderId: orderId
        )
        handle = GlomoPaySDK.shared.startCheckout(
            from: presenter,
            config: config,
            listener: self
        )
    }

    func onPaymentSuccess(_ payload: GlomoPayPayload) {
        // Verify payload.signature on your server before fulfilling the order
    }

    func onPaymentFailure(_ payload: GlomoPayPayload) {
        // The backend confirmed the payment failed. No signature is carried here
    }

    func onUserJourneyCompleted(_ payload: GlomoPayUserJourneyPayload) {
        // Required. A journey ended without a confirmed payment - today only a
        // submitted bank transfer. No money has moved: reconcile server-side
    }

    func onSdkError(_ errors: [SdkError]) {
        // Validation, device compliance, or an order fault the backend answered
    }

    func onConnectionError(_ error: ConnectionError) {
        // Check error.shouldAutoClose before closing anything yourself
    }

    func onPaymentTerminate(_ source: TerminationSource) {
        // The checkout ended without a payment result
    }
}

Retain the coordinator. See Listener retention - this is the single most common integration mistake on iOS.

Listener retention

The SDK holds your listener weakly. It does not keep your object alive. Retain the listener for at least as long as the checkout runs.

A coordinator or handler that nothing else references is released mid-checkout, and the payment result then cannot be delivered. The SDK records that case in its own diagnostics rather than failing silently, but the result is still gone - there is no callback and no second chance.

// Wrong: nothing retains the coordinator, so the result is lost
GlomoPaySDK.shared.startCheckout(
    from: self,
    config: config,
    listener: CheckoutCoordinator()
)

// Right: the coordinator is held for the lifetime of the checkout
self.coordinator = CheckoutCoordinator()
self.handle = GlomoPaySDK.shared.startCheckout(
    from: self,
    config: config,
    listener: self.coordinator
)

Callbacks are delivered on the main queue. They must not throw or trap: Swift has no catchable exception mechanism, so a force-unwrap of nil or an out-of-range index inside a callback takes down the host process and the SDK cannot contain it.

Subscriptions Checkout

To process subscription payments, pass a subscriptionId instead of an orderId:

let config = GlomoPayConfig(
    publicKey: "live_your_public_key",
    subscriptionId: "sub_your_subscription_id"
)

When subscriptionId is provided:

  • The subscriptionId must start with sub_
  • Do not pass both orderId and subscriptionId - the SDK will fire onSdkError

Asynchronous Payment Journeys

Not every checkout ends in a payment the backend can confirm. When the user submits bank transfer details, no money has moved yet and there is nothing for your server to verify - no paymentId and no signature.

This ends the checkout through onUserJourneyCompleted with a GlomoPayUserJourneyPayload:

func onUserJourneyCompleted(_ payload: GlomoPayUserJourneyPayload) {
    switch payload.journeyType {
    case .bankTransfer:
        // Mark the order awaiting reconciliation. Do not fulfil it
        break
    }
}

It does not also reach onPaymentSuccess. One journey produces one callback.

onUserJourneyCompleted is required and has no protocol-extension default, unlike onPaymentTerminate. That is deliberate: the order decides server-side whether bank transfers are enabled, so a default body would let an integration compile and silently stop hearing about a journey it was told about before.

Features

  • Standard, LRS, and Subscriptions checkout flows
  • Automatic order type detection from the order API, with explicit failure rather than a guess
  • Native page-sheet presentation over your own view controller
  • WebView-based secure checkout - payment data never passes through merchant code
  • Payment callbacks with signature verification
  • Programmatic close - startCheckout returns a handle that dismisses that session
  • Session isolation - checkout cookies and storage never reach your app's own web views
  • Device security compliance - jailbreak and debugger detection for live keys
  • Self-contained error reporting - no Sentry package enters your dependency graph
  • Overridable strings - every user-facing string can be replaced by your app
  • LRS education carousel above the secure bank flow
  • Dark mode - ask the checkout page for a light or dark scheme, or let it follow your app's own appearance. New in v1.1.0
  • Origin policy - the main checkout web view stays on Glomo origins, and payment and page-lifecycle messages are accepted only from the main frame of a Glomo page. New in v1.2.0
  • Checkout progress events - where the customer reached in an LRS checkout, and why it closed. New in v1.3.0

API Reference

GlomoPaySDK

@MainActor
public func startCheckout(
    from presenter: UIViewController,
    config: GlomoPayConfig,
    orderType: String = "auto",
    listener: GlomoPayListener? = nil,
    animated: Bool = true,
    completion: (() -> Void)? = nil
) -> GlomoPayCheckoutHandle

Called on GlomoPaySDK.shared. Presents the checkout as a page sheet over presenter and returns a handle.

ParameterTypeRequiredDescription
presenterUIViewControllerYesThe view controller the checkout is presented from
configGlomoPayConfigYesCheckout configuration
orderTypeStringNo"auto" (default, recommended), "standard", or "lrs"
listenerGlomoPayListener?NoHeld weakly - see Listener retention
animatedBoolNoWhether the presentation is animated. Default true
completion(() -> Void)?NoCalled once the presentation finishes

GlomoPaySDK.shared.validate(_:) returns [SdkError] for a config without starting a checkout.

GlomoPayCheckoutHandle

@MainActor
public final class GlomoPayCheckoutHandle {
    public func close()
    public func setAppColorScheme(_ scheme: GlomoColorScheme)
}

Retain the handle to dismiss that checkout programmatically - for example when the host app signs the user out. The listener then receives onPaymentTerminate(.programmatic) exactly once.

close() called before the checkout has finished presenting is honoured once it appears. Called after the checkout has finished, it does nothing. The handle controls only the session it was returned for.

setAppColorScheme(_:) changes the scheme of a checkout that is already presented, without reloading it. New in v1.1.0 - see Dark mode.

GlomoPayConfig

public struct GlomoPayConfig: Sendable, Equatable {
    public init(
        publicKey: String,
        orderId: String? = nil,
        subscriptionId: String? = nil,
        autoCloseOnConnectionError: Bool = true,
        appColorScheme: GlomoColorScheme = .auto
    )
}
PropertyTypeDefaultDescription
publicKeyString-Your Glomo public key. Must start with live_, test_, or mock_
orderIdString?nilOrder ID (starts with order_). Required unless using subscriptionId
subscriptionIdString?nilSubscription ID (starts with sub_). Mutually exclusive with orderId
autoCloseOnConnectionErrorBooltrueWhether a connectivity failure closes the checkout after reporting it
appColorSchemeGlomoColorScheme.autoThe colour scheme to request from the checkout page. A request, not an instruction - see Dark mode. New in v1.1.0

Exactly one of orderId or subscriptionId must be provided. If both or neither are set, onSdkError fires.

autoCloseOnConnectionError applies only to failures the SDK marks as closing. An advisory render timeout, a cancelled navigation and an unmapped WebKit failure all show the retry surface instead, whatever this is set to.

appColorScheme is defaulted and goes last in the initialiser, so existing GlomoPayConfig call sites compile unchanged.

checkoutId returns the active identifier and isSubscription reports whether a subscription ID was supplied.

GlomoPayListener

public protocol GlomoPayListener: AnyObject {
    func onPaymentSuccess(_ payload: GlomoPayPayload)
    func onPaymentFailure(_ payload: GlomoPayPayload)
    func onSdkError(_ errors: [SdkError])
    func onConnectionError(_ error: ConnectionError)
    func onUserJourneyCompleted(_ payload: GlomoPayUserJourneyPayload)
    func onPaymentTerminate(_ source: TerminationSource)
    func onCheckoutStageChanged(_ event: GlomoCheckoutStageChangedEvent)
    func onCheckoutClosed(_ event: GlomoCheckoutClosedEvent)
}
CallbackRequiredDescription
onPaymentSuccessYesA payment the backend confirms succeeded. Verify signature server-side before fulfilling
onPaymentFailureYesThe backend confirms a payment failed. Carries no signature - a failure payload has never had one
onSdkErrorYesThe SDK or the order could not proceed - validation, forbidden device, or an order fault the backend answered
onConnectionErrorYesNetwork, DNS, SSL, HTTP or WebView failure. Check isRecoverable and shouldAutoClose
onUserJourneyCompletedYesA journey ended the checkout without a confirmed payment - today only .bankTransfer
onPaymentTerminateNoThe checkout ended without a payment result. Has a protocol-extension default
onCheckoutStageChangedNoThe customer reached a new checkout stage, or a new step within one. LRS only. Protocol-extension default. New in v1.3.0
onCheckoutClosedNoThe checkout closed, with the last stage it reached and why. At most once. Protocol-extension default. New in v1.3.0

There is no onEvent. The diagnostic channel it provided was never part of the integration contract; everything with diagnostic value goes to the SDK's own telemetry, which is sanitised and does not depend on your app implementing anything.

GlomoPayPayload

Delivered by onPaymentSuccess and onPaymentFailure.

public struct GlomoPayPayload: Equatable {
    public let orderId: String
    public let paymentId: String?
    public let signature: String?
    public let rawResponse: [String: AnyHashable]?
}

Merchant responsibility: Always verify the signature on your server before fulfilling an order. Check it against each of your active secret keys, and accept it if any one matches. See Checkout overview for verification instructions.

Do not expect a signature on onPaymentFailure. That field exists so a host can verify a success. The page's response travels verbatim in rawResponse.

GlomoPayUserJourneyPayload

Delivered by onUserJourneyCompleted.

public struct GlomoPayUserJourneyPayload: Sendable, Equatable {
    public let journeyType: GlomoPayUserJourneyType
    public let orderId: String
    public let senderAccountNumber: String?
    public let transactionReference: String?
    public let status: String?
    public let rawResponse: [String: AnyHashable]?
}

public enum GlomoPayUserJourneyType: String, Sendable, CaseIterable {
    case bankTransfer
}

Deliberately not a GlomoPayPayload: paymentId and signature are the fields a host verifies a payment with, and neither exists for a journey. Reconcile it server-side against the order and never fulfil from it.

Journey fields are read in both camelCase and snake_case. A payload with no orderId is rejected rather than delivered.

The enum carries one member. Pay via Bank is not supported on the iOS SDK, so there is no journey member for it and the checkout page raises no event behind it - see Pay via Bank for that method's current availability.

SdkError

public enum SdkErrorType: String, Sendable {
    case validationError
    case deviceForbidden
    case networkError
    case unknown
}

public struct SdkError: Error, Sendable, Equatable {
    public let type: SdkErrorType
    public let message: String
    public let field: String?
}
TypeWhen
validationErrorInvalid public key, order ID, or subscription ID format. field indicates which failed
deviceForbiddenJailbreak or debugger detected on a device using a live_ key
networkErrorThe order could not be loaded before opening checkout
unknownUnexpected error

An order fault the backend actually answered - a non-2xx status, or a response that cannot be parsed - is reported here. A timeout or transport failure reports through onConnectionError instead.

ConnectionError

public enum ConnectionErrorType: String, Sendable {
    case noInternet
    case dnsFailure
    case timeout
    case sslError
    case httpClientError
    case httpServerError
    case webResourceError
    case unknown
}

public struct ConnectionError: Error, Sendable, Equatable {
    public let type: ConnectionErrorType
    public let message: String
    public let statusCode: Int?
    public let failedURL: URL?
    public let errorCode: Int?
    public let shouldAutoClose: Bool
    public var isRecoverable: Bool { get }
}
TypeRecoverableDescription
noInternetYesDevice is offline
dnsFailureNoDNS resolution failed
timeoutYesRequest timed out
sslErrorNoSSL/TLS handshake failed
httpClientErrorNoHTTP 4xx response
httpServerErrorYesHTTP 5xx response
webResourceErrorNoWebView resource loading failed
unknownNoUnexpected error

shouldAutoClose is decided from the mapped error type, not from the sign of errorCode. A cancelled navigation is not reported at all: WebKit delivers those routinely for superseded loads and client-side redirects, and treating one as a connection failure ended live checkouts for a non-event.

TerminationSource

public enum TerminationSource: String, Sendable {
    case userDismiss
    case programmatic
    case connectionError
}
SourceWhen
userDismissThe user closed the checkout from the navigation bar, or swiped the sheet down
programmaticThe host called GlomoPayCheckoutHandle.close()
connectionErrorA connection error ended the checkout

There is no backButton case. iOS has no native back control on the checkout; the navigation bar's Close button and interactive sheet dismissal both report userDismiss.

Slow checkout warning

If the checkout page has not become interactive 15 seconds after presentation, the SDK reports onConnectionError with ConnectionErrorType.timeout and shouldAutoClose set to false, and shows a retry surface.

This is advisory, not an ending: the page may be seconds away and the session stays alive. If your onConnectionError dismisses the checkout for every error it receives, check shouldAutoClose first.

Document Uploads

Bank flows that ask for documents open WebKit's own upload sheet, which offers Camera, Photo Library and Files on every supported iOS version. The SDK deliberately does not substitute its own document picker - doing so removed capture options the platform provides for free, on KYC fields where photographing a document is the common case.

Because WebKit presents Camera and Photo Library from your application's process, your app must declare NSCameraUsageDescription and NSPhotoLibraryUsageDescription. See Required Info.plist entries.

The SDK does not downscale captured images. Typical iPhone captures stay under the bank's upload limit.

Dark mode

New in v1.1.0. GlomoPayConfig.appColorScheme tells the Glomo checkout page which scheme to present. It defaults to .auto.

public enum GlomoColorScheme: Sendable {
    case auto
    case light
    case dark
}
let config = GlomoPayConfig(
    publicKey: "test_public_key",
    orderId: "order_example",
    appColorScheme: .auto // .auto | .light | .dark
)

It requests a scheme, it does not force one. The page decides, against your merchant dashboard settings. Setting .dark does not guarantee a dark checkout, and dark mode is enabled per account - until it is enabled for yours, checkout stays light whatever you pass. See Dark mode across the SDKs for what that gating means.

What .auto resolves to here. The checkout's own trait collection, so an app that sets overrideUserInterfaceStyle gets what it set rather than what the device is on. What the automatic value derives from is a per-platform decision and differs across the Glomo SDKs; only .light and .dark mean the same thing everywhere - see the cross-SDK table.

Changing it mid-checkout is supported, through the handle:

let handle = GlomoPaySDK.shared.startCheckout(from: self, config: config, listener: self)
// later, without dismissing and re-presenting
handle.setAppColorScheme(.dark)

The page is told through the bridge rather than by reloading it, so a payment in flight survives the change. Do not dismiss and re-present the checkout to change the scheme. A host appearance change reaches an open checkout on its own while the scheme is .auto; nothing is needed from the host for that.

What the SDK paints follows your account setting, as of v1.2.0. appColorScheme is what the page is told, and that is unchanged - it still reaches the page in full and the page still decides. What the SDK itself draws before the page's first paint - the loading screen, the checkout web view and the LRS education carousel - now follows both the scheme you asked for and the dark_mode_enabled flag on your account, which arrives with the order. Three consequences, all of them the intended end state:

  • Dark mode off for your account. Everything the SDK paints is light, whatever you pass and whatever the device is on. Before v1.2.0 a host on .dark, or on .auto with a dark device, showed a dark screen in front of a checkout that then rendered light.
  • Dark mode on for your account. The loading screen is light until the order loads and then dark, where it used to be dark from the first frame. The gap is one order request, and it closes before the page paints.
  • Checkouts that never load an order stay light throughout - one opened with an explicit orderType of "standard" or "lrs", and any subscription checkout. Those paths do not fetch the order, so the account setting is not available to them.

Only a downgrade undoes any of this; the account setting cannot roll it back. The dark loading screen also uses the checkout page's own background colour rather than black, so there is no seam at the edges while the page settles.

WKWebView has no algorithmic darkening to switch off, so there is no iOS counterpart to the Android setting. The iOS-specific concern is the opposite one: WKWebView reports prefers-color-scheme from its trait collection, which inherits the host app. The checkout and carousel web views therefore have their overrideUserInterfaceStyle pinned to the scheme the checkout resolved, so a page told dark cannot still match prefers-color-scheme: light in its own CSS and render half of each.

Checkout progress events

New in v1.3.0. Two optional listener methods report how far a customer got through an LRS checkout and why the checkout closed. They are the native equivalent of the checkout.stage_changed and checkout.closed events on the web - see Checkout events for the contract they relay: every stage, step, close reason and field, and what each one means.

They are enabled per merchant and off by default. Until they are switched on for your business, the checkout behaves exactly as it does today and neither method fires. Talk to your Glomo contact to turn them on; the same switch adds progress to the payment webhook, so you do not need to ask twice.

Both have default implementations in a protocol extension, so an existing GlomoPayListener compiles and behaves unchanged.

extension CheckoutHandler: GlomoPayListener {
    // ... the required methods

    func onCheckoutStageChanged(_ event: GlomoCheckoutStageChangedEvent) {
        analytics.track("checkout_stage", [
            "orderId": event.resource.id,
            "journeyId": event.journeyId,
            "stage": event.stage,
            "step": event.step ?? "",
            "provider": event.provider ?? "",
        ])
    }

    func onCheckoutClosed(_ event: GlomoCheckoutClosedEvent) {
        guard event.reason != GlomoCheckoutCloseReasons.completed else { return }
        analytics.track("checkout_abandoned", [
            "lastStage": event.lastStage ?? "",
            "reason": event.reason,
        ])
    }
}

Both event types are Sendable, and callbacks arrive on the main queue like every other listener method.

GlomoCheckoutStageChangedEvent

Fires each time the customer reaches a new stage, or a new step within one. Stages arrive in order and each stage and step pair fires at most once per checkout, so appending them builds a drop-off funnel without deduplication.

PropertyTypeDescription
versionIntPayload version. 1 today - see Versioning
resourceGlomoCheckoutResourceWhat the checkout was opened for. type is order on LRS, id is the order ID
journeyIdStringIdentifies one checkout open. Every event from the same open carries the same value
atStringISO 8601 UTC timestamp from the customer's device clock
flowStringWhat the checkout is for. payment today
stageStringThe stage reached - see Payment stages
methodString?The payment method. Known: lrs
paymentIdString?The payment attempt. Present from the attempt_created stage onward
stepString?The screen within the stage - see Steps
providerString?The bank the customer chose. Present from method_selected onward
journeyTypeString?redirect or native. Present from method_selected onward
errorCodeString?Only on stage failed, and not always present there
segmentGlomoCheckoutSegment?Reserved. Not sent today
rawPayload[String: AnyHashable]?The payload as received, including fields added after this SDK version was built

GlomoCheckoutClosedEvent

Delivered at most once per checkout. No progress events follow it - no stage changes, and no second close.

PropertyTypeDescription
versionIntPayload version
resourceGlomoCheckoutResourceAs on GlomoCheckoutStageChangedEvent
journeyIdStringSame value as the stage changes from this checkout open
atStringISO 8601 UTC timestamp
flowStringAs on GlomoCheckoutStageChangedEvent
reasonStringWhy it ended - see Close reasons
methodString?As on GlomoCheckoutStageChangedEvent
paymentIdString?Present when a payment attempt was created before the checkout closed
lastStageString?The last stage the page reported. nil only on a close the page itself sent before any stage
lastStepString?The step reported with lastStage, where there was one
rawPayload[String: AnyHashable]?The payload as received

Known values

GlomoCheckoutStages and GlomoCheckoutCloseReasons name the values known at the time this SDK version was built:

GlomoCheckoutStages.opened              // "opened"
GlomoCheckoutStages.methodSelected      // "method_selected"
GlomoCheckoutStages.detailsSubmitted
GlomoCheckoutStages.attemptCreated
GlomoCheckoutStages.customerAuth
GlomoCheckoutStages.providerHandoff
GlomoCheckoutStages.awaitingConfirmation
GlomoCheckoutStages.confirmed
GlomoCheckoutStages.failed

GlomoCheckoutCloseReasons.userDismissed        // "user_dismissed"
GlomoCheckoutCloseReasons.userCancelled
GlomoCheckoutCloseReasons.completed
GlomoCheckoutCloseReasons.error
GlomoCheckoutCloseReasons.confirmationTimeout

They are string constants, not enums, and stage, step, provider, method and reason are open strings. New values can appear within version 1, and the SDK forwards them rather than filtering them out. Compare against the constants where you recognise a value; never fail on one you do not.

Which closes the SDK reports itself

Several ways out of a checkout never reach the page, so the SDK writes the close event for them: the customer swiping the sheet away, tapping Close in the navigation bar, and leaving the SDK's own connection-error screen. The reason it writes is completed after a successful payment or a submitted bank transfer, error after a failed payment or from the error screen, and user_dismissed otherwise.

A close is not guaranteed. A checkout closed with GlomoPayCheckoutHandle.close() before it reached a payment result reports none. Close it after a payment result and the close is still delivered, with lastStage set to the last stage the page reported before you closed.

A checkout left before the SDK saw a stage it recognises reports no close at all. A customer who backs out on the loading screen, or before the first stage arrives, produces neither a stage change nor a close. onCheckoutClosed is therefore not an end-of-checkout hook: use onPaymentTerminate for that, and treat a close as "the customer got at least this far".

On a declined payment, lastStage is the stage before failed: the page reports the failure ahead of that stage, and the checkout closes on the failure.

What it is not

onCheckoutClosed is not a payment outcome. After a dismissal the payment can still complete on the server, so read the result from the payment status API or your webhook, never from reason. completed means the customer finished what the checkout asked of them, not that the payment settled.

It does not replace onPaymentTerminate, which is unchanged. On the close path onPaymentTerminate comes first, though a late one can still land while the sheet dismisses.

Only v1 payloads

The SDK delivers version 1 payloads only. An empty or differently versioned payload reports nothing, which is also what you see while the events are switched off for your account.

Checkout Behavior

  • The checkout is presented as a page sheet over the view controller you pass in
  • Order type detection: the flow is resolved from a successful order fetch, or the checkout does not open. A timeout or transport failure reports through onConnectionError, a non-2xx status or an unparseable response through onSdkError, and the session ends. No order type is guessed - guessing would route LRS traffic to the wrong checkout host
  • Bank flow overlay: Back always closes the overlay and returns the user to the checkout, rather than walking the bank page's own history, which redirect chains make unexitable. Edge-swipe history gestures are disabled on both web views
  • The bank overlay allows http, https, about, blob and data navigations and blocks everything else, so an unknown scheme cannot fail silently and strand the user on a page that appears to have done nothing
  • LRS education carousel: for LRS orders an education strip is shown above the bank page when the checkout page reports content for it, and collapses to a fixed back bar when there is nothing to show

Origin Policy

New in v1.2.0. The SDK now decides for itself which pages belong to Glomo, and refuses privileged bridge messages and off-origin navigation from everything else. There is nothing to integrate - no callback, no configuration and no new dependency - and the callbacks your app receives from a normal payment are unchanged.

Payment and page-lifecycle messages are accepted only from Glomo checkout pages

A payment.* event or a report that the page's own dependencies failed to load is honoured only when it comes from the main frame of a Glomo page. A bank or 3-D Secure page in the redirect overlay can no longer report a payment result or put a live checkout on the error screen, and neither can a third-party frame embedded in a Glomo page - WebKit's own frame attribution is what the SDK checks, not the web view's URL.

Bank-driven navigation is unaffected. A bank page calling window.close() to dismiss the overlay after a challenge works exactly as before; gating that would strand the user on a finished page.

The main checkout web view is restricted to Glomo origins

It only ever loaded Glomo pages; that is now enforced rather than assumed. A top-level navigation anywhere else is cancelled before it loads. Subframe loads are untouched - card entry, 3-D Secure and server-to-server frames are not on Glomo hosts and must keep loading - and the bank redirect overlay is deliberately not restricted by host, since the bank decides where it goes next.

What a refused message or navigation does

Nothing reaches your app. Both are recorded in the SDK's own diagnostics, by origin rather than by URL, and the checkout carries on. onSdkError is deliberately not used for either: before the page's first event, raising there is the terminal error screen, which would hand any bank page a way to end a checkout it can no longer speak for.

Which origins are trusted

  • https on glomopay.com or glomo.one, including subdomains, on the default port. A suffix rule rather than a fixed host list, so a shipped SDK keeps working if a checkout host moves or redirects between the two.
  • The base URLs this SDK navigates to, from its own resolved configuration. That is what covers the LRS education carousel and a self-hosted checkout, with no extra setup.

Nothing about signature verification changes. Confirm every payment on your server as before - the origin check narrows what can reach your callbacks, it does not replace verification.

Session Isolation

The checkout's web views share one non-persistent website data store. Checkout cookies, local storage and cache never reach your application's own WKWebView instances, and a second checkout never starts against what the first one left behind.

The SDK never clears app-wide website data - doing so would destroy a 3DS session mid-redirect.

Device Security Compliance

ScenarioBehavior
live_ key + jailbroken/debugged deviceonSdkError with deviceForbidden. Checkout does not open
live_ key + clean deviceCheckout proceeds normally
test_ or mock_ keyCompliance checks skipped entirely

Mock Mode

Key prefixModeDescription
live_ProductionReal payments. Device compliance enforced
test_TestMock checkout. No real transactions. Compliance skipped
mock_MockSame as test_

Input Validation

FieldRule
publicKeyLength > 5. Must start with live_, test_, or mock_
orderIdLength > 6. Must start with order_
subscriptionIdLength > 4. Must start with sub_
  • Exactly one of orderId or subscriptionId must be provided
  • Validation errors fire onSdkError with validationError and the field that failed
  • GlomoPaySDK.shared.validate(_:) runs the same checks without starting a checkout

Localization

Every user-facing string the SDK draws is looked up from a GlomoPayLocalizable table. Your app can override any key by declaring it in its own GlomoPayLocalizable.strings, because the main bundle is searched before the SDK's.

Dependency Notes

The SDK has no third-party package dependencies. v1.0.0 removed the sentry-cocoa dependency: Swift Package Manager resolves one version of a package for the whole app, so a merchant already on a different Sentry version could not install the SDK at all. The SDK's own error reporting now runs over URLSession. You can use any Sentry version alongside it, or none.

No dSYM upload is required for the SDK. Its error reports carry no stack trace, and Glomo never receives your dSYMs.

Troubleshooting

No callbacks arrive at all

The listener was released. The SDK holds it weakly - see Listener retention. Retain the coordinator or handler for at least as long as the checkout.

The app crashes when the user taps Camera or Photo Library

NSCameraUsageDescription or NSPhotoLibraryUsageDescription is missing from your app's Info.plist. See Required Info.plist entries.

Package resolution fails on Sentry, or on a version conflict

v1.0.0 has no third-party dependencies. If resolution still fails, you are on an older build - move to v1.0.0.

onSdkError fires immediately

Check that publicKey format is valid and that exactly one of orderId / subscriptionId is provided. GlomoPaySDK.shared.validate(_:) reports the same errors without opening a checkout.

deviceForbidden in development

Use a test_ or mock_ key prefix during development.

onConnectionError with timeout but the checkout is still open

This is the 15-second slow checkout warning, reported with shouldAutoClose false. The session is still alive.

Bank transfers do not reach onPaymentSuccess

Expected. They arrive at onUserJourneyCompleted, because they carry no paymentId and no signature for your backend to verify. See Asynchronous Payment Journeys.

The build fails on a missing onUserJourneyCompleted

It is required and has no default implementation. If you do not take bank transfers, an empty body is a complete integration - it simply never fires.

Security

  • Payment data is handled within a secure, isolated WebView - it never passes through your application code
  • The JavaScript bridge is limited to payment lifecycle events; no PAN, CVV, or sensitive payment data crosses it
  • Jailbreak and debugger detection blocks checkout on compromised devices (live keys only)
  • Every URL the page asks to open is validated before it can become a navigation. A parse is not a check, so javascript:, data: and file: URLs are rejected rather than followed
  • As of v1.2.0 the main checkout web view stays on Glomo origins, and payment and page-lifecycle messages are accepted only from the main frame of a Glomo page - see Origin Policy
  • The bank flow overlay allows only http, https, about, blob and data navigations
  • Checkout web views use a non-persistent data store isolated from your app's own web views
  • The SDK installs no crash or exception handlers, swizzles nothing, and never touches a Sentry client your app owns
  • The bundled privacy manifest declares the SDK's data use; tracking is disabled and no App Tracking Transparency prompt is required

To report a security vulnerability, email security@glomopay.com. Do not open a public GitHub issue for security reports.