Integration Guide

Install the SDK, show the Cashier, handle the result, test and go live.

This guide covers the whole integration: installing the SDK and showing the Cashier (§1), the payment methods and flows your customers go through (§2), and testing and going live (§3). For a minimal working example to copy, start with the Quick Start.

1. Accept payments in your iOS app

The Praxis iOS SDK lets you accept deposits and withdrawals in your iOS app with the native Praxis Cashier. This guide takes you from installation to your first payment with the predefined Cashier template.

1.1 How it works

From an implementation perspective, the integration has these parts:

  • Server-side: create a cashier session for the iOS SDK with the Cashier Payment Request and send its token to your app.
  • Client-side: choose the environment and show the Cashier with the token.
  • Client-side: handle the result when the Cashier closes.
  • Webhooks: receive the Payment Notification with the final status of each payment.

The full payment flow, with a diagram, is in the iOS SDK overview.

1.1.1 Implementation overview

  1. Install the SDK
  2. Choose the environment
  3. Create a cashier session
  4. Show the Cashier
  5. Register the return URL
  6. Handle the result
  7. Handle the webhook

1.1.2 Before you begin

Make sure you have:

  • your Praxis merchant credentials (merchant_id, application_key and merchant secret) for the sandbox, from your CSM;
  • the iOS SDK enabled for your sandbox application (ask your CSM);
  • the PCI card form enabled for your sandbox application (ask your CSM);
  • request signing in place on your server (see Authentication);
  • an iOS 18 project built with Xcode 27.2 or later.

1.2 Implement the iOS SDK

1.2.1 Install the SDK

Client-side

The SDK is distributed with Swift Package Manager as one product, PraxisCashier. Your CSM gives you the package URL and the version to use.

Xcode: choose File → Add Package Dependencies…, enter the package URL, set Dependency Rule to Exact Version with the version your CSM gives you, and add the PraxisCashier library to your app target.

Package.swift

dependencies: [
    .package(url: "<package URL from your CSM>", exact: "<version from your CSM>")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            // package: the last part of the package URL, without ".git"
            .product(name: "PraxisCashier", package: "ios-sdk")
        ]
    )
]

Import it where you show the Cashier:

import PraxisCashier

The SDK has no third-party dependencies.

What the package holds

The SDK ships as a compiled binary, not as source code.

  • Package.swift declares PraxisCashier as a binary target. When Xcode resolves the package, it downloads PraxisCashier.xcframework.zip from https://sdk.praxis.tech and checks it against the SHA-256 checksum in Package.swift. If your network or CI limits outbound traffic, allow sdk.praxis.tech and the host of the package URL.
  • The XCFramework holds the SDK for iOS devices (arm64) and the iOS Simulator (arm64, x86_64), its public interface and its documentation comments: Option-click any PraxisCashier symbol for Quick Help.
  • Use Xcode 27.2 or later.
  • The framework holds its privacy manifest (PrivacyInfo.xcprivacy). Xcode adds it to the privacy report of your app archive. Use the report for your App Store privacy details.
  • The package has no source code, so you cannot step into the SDK in the debugger. If your app crashes inside the SDK, send the crash report to your CSM: Praxis keeps the SDK's debug symbols (dSYMs) and symbolicates SDK frames.
  • The package holds LICENSE.

1.2.2 Choose the environment

Client-side

CashierEnvironment selects the Praxis environment the Cashier talks to. The SDK has the service addresses of each environment built in; you do not configure any address, key or secret in the app.

ValueDescription
.sandboxThe Praxis sandbox, for development and testing.
.liveThe Praxis live environment.
#if DEBUG
let cashierEnvironment: CashierEnvironment = .sandbox
#else
let cashierEnvironment: CashierEnvironment = .live
#endif

The examples in this guide pass this cashierEnvironment to the Cashier. Do not name it environment: inside a SwiftUI view, that name refers to the view's environment(_:_:) method.

🚧

Match the environment

Use the environment your server creates sessions in: a session created in the Praxis sandbox works only with .sandbox, a live session only with .live.

1.2.3 Create a cashier session

Server-side

When the customer starts a deposit or withdrawal, your server creates a session with the Cashier Payment Request (POST /cashier/cashier), as for the Hosted Payment Page, with two extra parameters:

ParameterDescriptionFormatRequired
channelWhere the session runs. Set ios_sdk. Without it, or with web, the session is a web session and the SDK ends at once with the configuration_error code.StringYes, for the iOS SDK
app_return_urlWhere the customer returns to your app after a provider, APM or 3-D Secure page, for example from a bank app. A custom-scheme link (merchantapp://praxis/return) or an https Universal Link, up to 512 characters.StringYes, with channel: ios_sdk

channel and app_return_url are not signed. The gt-authentication signature stays merchant_id, application_key, timestamp, intent, cid and order_id, so your signing code does not change.

Request

{
  "merchant_id": "Test-Integration-Merchant",
  "application_key": "Sandbox",
  "version": "1.3",
  "timestamp": 1762855200,
  "intent": "payment",
  "currency": "EUR",
  "amount": 1500,
  "cid": "user-1001",
  "order_id": "order-55120",
  "locale": "en-GB",
  "customer_data": { "country": "GB", "first_name": "John", "last_name": "Johnson", "email": "[email protected]" },
  "notification_url": "https://merchant.example/praxis/notify",
  "return_url": "https://merchant.example/return",
  "channel": "ios_sdk",
  "app_return_url": "merchantapp://praxis/return"
}

The response has no redirect_url (an iOS SDK session cannot open in a browser) and returns session.channel = ios_sdk:

Response (abridged)

{
  "status": 0,
  "description": "Ok",
  "session": {
    "auth_token": "8a7sd87a8sd778ac961062c6bedddb8",
    "intent": "payment",
    "session_status": "created",
    "order_id": "order-55120",
    "currency": "EUR",
    "amount": 1500,
    "channel": "ios_sdk"
  },
  "timestamp": 1762855201,
  "version": "1.3"
}

Return only session.auth_token to your app:

Your server → your app

{ "token": "8a7sd87a8sd778ac961062c6bedddb8" }

Intents. payment, authorization and withdrawal are supported, and so are sessions with more than one intent (secondary_intents), which show Deposit and Withdraw tabs. Only regular cashier sessions (session_type missing or cashier) can use the iOS SDK channel; other session types, such as payment_link, are rejected.

Errors. Validation errors come back together: status 400, messages in description, separated by commas.

MessageCause
Incorrect channelchannel is not web or ios_sdk.
The iOS SDK is not available for your applicationThe iOS SDK is not enabled for the application. Contact your CSM.
The iOS SDK needs the PCI card form for your applicationThe application does not use the PCI card form. Contact your CSM.
Incorrect app return urlapp_return_url is missing, or is not a custom-scheme link or an https URL with a host.
The iOS SDK channel is not available for this session typeThe session is not a regular cashier session (session_type missing or cashier), for example a payment_link session.

Session lifetime. A session expires 15 minutes after the Cashier first opens it. Within that time the same token can open the Cashier again, for example after your app restarts. After it, create a new session. Use a new session for each new payment.

🚧

Protect your session endpoint

Authenticate your app user before you create a session, and take cid, amount, currency and intent from your own records, not from the app. Keep your Praxis credentials on the server only.

1.2.4 Show the Cashier

Client-side

Show CashierView with the token. It starts the session when it appears and closes it when it disappears. onResult is called once, on the main actor, when the Cashier closes.

SwiftUI (full screen)

struct DepositButton: View {
    @State private var launch: Launch?
    let cashierEnvironment: CashierEnvironment

    var body: some View {
        Button("Deposit") {
            Task {
                do {
                    launch = Launch(token: try await myServer.createCashierSession())
                } catch {
                    showSessionError(error)   // your server could not create the session
                }
            }
        }
        .fullScreenCover(item: $launch) { launch in
            CashierView(token: launch.token, environment: cashierEnvironment) { result in
                handle(result)
                self.launch = nil
            }
        }
    }
}

struct Launch: Identifiable {
    let id = UUID()
    let token: String
}

SwiftUI (sheet)

Button("Deposit") { showsCashier = true }
    .cashierSheet(isPresented: $showsCashier, token: token, environment: cashierEnvironment) { result in
        handle(result)
    }

UIKit

let cashier = CashierViewController(token: token, environment: cashierEnvironment) { [weak self] result in
    self?.dismiss(animated: true)
    self?.handle(result)
}
present(cashier, animated: true)

.cashierSheet draws its own sheet chrome and turns the binding to false when the customer closes the Cashier from inside. While a payment runs, the Cashier hides its close button and refuses a swipe down.

📘

Stored properties

CashierView is generic over its layout. To keep one in a stored property, write the full type, for example CashierView<Cashier.AmountFirstLayout>.

To change features, the theme or the texts, pass a CashierConfiguration (see Configuration & Customization and Customization).

1.2.5 Register the return URL

Client-side

3-D Secure and provider pages open inside the Cashier, and your app needs no URL-handling code for them. When a provider page hands the customer to a bank app, the app_return_url from step 3 brings the customer back to your app, if your app registers it:

  • Custom scheme (merchantapp://praxis/return): add the scheme under Target → Info → URL Types.
  • Universal Link (https://…): add the Associated Domains capability and host the apple-app-site-association file.

If your app does not register it, the customer switches back by hand. Either way, the Cashier reads the payment status when your app is active again. When iOS opens your app with the app_return_url, your app's URL handler (onOpenURL, application(_:open:options:) or your Universal Link handler) also receives it: ignore that URL rather than treating it as an unknown deep link. How these pages open, end and return is described in §2.2.

1.2.6 Handle the result

Client-side

func handle(_ result: CashierResult) {
    switch result.status {
    case .completed, .authorized: showThankYou()
    case .pending:                showProcessing()
    case .failed:                 showError(message(for: result.errorCode))
    default:                      break   // .canceled, or a status added later
    }
}

The statuses are .completed, .authorized, .pending, .failed and .canceled; result.errorCode says why a payment failed. The SDK returns codes, not text: map each CashierErrorCode to your own message. What each status and code means is in Results & Error Codes.

1.2.7 Handle the webhook

Server-side

Praxis sends the Payment Notification to your notification_url for every status change. Your handler must:

  1. Verify the gt-authentication signature.
  2. Be idempotent: the same notification can arrive more than once.
  3. Update the customer's balance only from the webhook, never from the result in the app.

1.3 Implementation checklist

Before you go live, test your integration in the sandbox with the scenarios and the implementation checklist in §3. When everything works, switch your server to live and your CashierEnvironment to .live, and repeat a payment in live.

2. Payment methods and flows

2.1 Payment methods

The Cashier shows the payment methods configured for your application at Praxis, as the web Cashier does. A method added or changed at Praxis works in the app without an SDK update, as long as its type is supported.

MethodHow it works in the app
New cardSealed card fields inside the SDK. The card is encrypted on the device and sent only to Praxis. 3-D Secure opens inside the Cashier when the issuer asks for it (see §2.2).
Saved cardThe customer picks a saved card and enters the CVV. Saved cards can be removed.
Manual bank wireThe customer picks a bank; the result screen shows the bank details.
Methods with fieldsThe Cashier draws the method's fields from the Praxis configuration, including fields with server-loaded options. Saved accounts can be removed.
Methods with a provider pageThe provider's page opens inside the Cashier. See §2.2.

2.2 3-D Secure and provider pages

Some payments need a page outside the Cashier's own screens:

  • a 3-D Secure challenge from the card issuer, where the customer confirms the card payment;
  • a provider page of the payment service provider or alternative payment method, where the customer logs in, confirms or pays.

Praxis returns the page in the payment answer, and the Cashier opens it on its own. Your app writes no code for it and needs no web view of its own.

2.2.1 How it works

sequenceDiagram
    autonumber
    participant C as Customer
    participant SDK as Cashier (in your app)
    participant PX as Praxis
    participant P as Issuer or provider page
    participant B as Bank app (optional)

    C->>SDK: Pays
    SDK->>PX: Payment
    PX-->>SDK: Answer: open a 3-D Secure or provider page
    SDK->>P: Opens the page full screen inside the Cashier
    opt The page hands over to a bank app
        P->>B: Opens the bank app
        B-->>SDK: The customer returns to your app (app_return_url)
    end
    P-->>SDK: The page goes to the session's app_return_url
    SDK->>PX: Reads the payment status
    SDK-->>C: Result screen
  1. The customer pays. Praxis answers that the payment needs a 3-D Secure or provider page.
  2. The Cashier opens the page full screen, inside the Cashier, and sends the redirection event.
  3. The customer completes the page. Some pages hand the customer to a bank app and back.
  4. When the page finishes, the provider sends it to the session's app_return_url. The Cashier catches this, closes the page and reads the payment status from Praxis.
  5. The Cashier shows the result, and your app gets it in onResult when the Cashier closes.

2.2.2 What the customer sees

The page fills the Cashier, with a close button above it. The Cashier's own close button stays hidden and a swipe down is refused while the payment runs, so the customer leaves the page only through its close button.

2.2.3 How the page ends

What happensWhat the Cashier does
The page goes to the session's app_return_urlStops that navigation (nothing loads or opens), closes the page and reads the payment status.
The customer taps the page's close buttonCloses the page and reads the payment status. The payment is often still pending at this point.
The page hands the customer to a bank appKeeps the page open. When your app is active again, reads the payment status.
The status is not final yetShows the processing screen and keeps reading the status until the session expires, then ends with .pending.

app_return_url matches on the scheme for a custom-scheme link, and on the host and path for an https link.

The result follows the payment status: .completed or .authorized, .failed with an error code, or .pending. A pending payment reaches its final status on your server through the Payment Notification.

🚧

Closing early does not cancel the payment

If the customer closes the page or the Cashier before the provider confirms, the payment may still complete. The result is then .pending. Credit the customer only from the Payment Notification.

2.2.4 Bank apps

A 3-D Secure or provider page may open the customer's bank app, for example to approve the payment in the app. To bring the customer back to your app automatically afterwards, register the session's app_return_url in your app:

  • Custom scheme (merchantapp://praxis/return): add the scheme under Target → Info → URL Types.
  • Universal Link (https://merchant.example/praxis/return): add the Associated Domains capability and host the apple-app-site-association file.

You need no URL-handling code and no LSApplicationQueriesSchemes entries: the Cashier reads the payment status when your app is active again. If your app does not register the app_return_url, the customer switches back to your app by hand, and the Cashier still reads the status. When iOS opens your app with the app_return_url, your app's URL handler (onOpenURL, application(_:open:options:) or your Universal Link handler) also receives it: ignore that URL rather than treating it as an unknown deep link.

If iOS cannot open the app, the page stays as it is.

2.2.5 The page's web view

The page runs in a web view that the SDK owns and controls:

  • No stored data. It keeps no cookies, logins or other website data. The customer may need to sign in to their bank or provider each time.
  • HTTPS only. Pages load only over https; other web addresses are not loaded.
  • New windows. When the page itself opens a new window, for example from a script, it loads in the same view. When the customer taps a link that opens in a new window, the link opens in Safari, or in the app of a Universal Link.
  • Isolated from your app. Your app cannot read or change the page, and the SDK adds no scripts to it.
📘

Test every provider on a real device

Provider pages open only in the Cashier's own web view. Before you go live, complete a payment with every method that opens a provider page, on a real device, including the bank app hand-off.

2.3 Amount, currency and promotions

  • The amount comes from the session (amount in the Cashier Payment Request). A session amount shows as fixed text; set presetAmountEditable: true to let the customer change it. Without a session amount, the field starts with the customer's last deposit, else the quick amount starting amount, else empty, and the customer enters the amount. The customer can change the amount only with .editableAmount on, and within the method limits when .amountLimits is on.
  • With .currencyChange on, the customer can pay in another currency of their profile; the amount is converted.
  • Quick amount buttons show when you set them up in amount.quickAmounts: your own lists per currency, method and transaction type, or buttons built from the customer's last deposit.
  • Promotions show when you set promotions.style: the bonuses that Praxis offers for the session (.bonusList) or a promotion code field (.codeField).
  • Fees come from Praxis; paymentMethods.fees decides whether they show on the method rows. The total to pay always shows.
  • When the merchant requires terms acceptance, the customer must tick the terms box before paying.

See Configuration & Customization §2.2 and §2.3.

2.4 Partial approval

When a payment is partially approved, the Cashier shows the approved part and asks the customer to accept or cancel it, with a countdown, as the web Cashier does. See Transaction Statuses.

2.5 Decline recovery and retry

After a declined payment, when the Praxis answer offers it, the Cashier shows one of two pages in place of the declined result:

  • Retry: pay again with a lower amount, for example after insufficient funds.
  • Recovery: pay the same amount with another payment method.

While one of these pages shows, CashierSnapshot.step is .result. If the customer closes the Cashier on one of these pages, it ends with the declined result. These pages send no result events (transaction, createResultPage, thank_you_page_loaded); the screen that follows them does.

A recovery the customer confirmed lasts only while the Cashier is open. It is not kept when the Cashier is opened again.

2.6 Withdrawals

Create a session with intent: "withdrawal" to open the withdrawal Cashier. The Cashier covers:

  • the balance check: a preset amount must not be above the balance;
  • payout methods and saved payout accounts;
  • the list of pending withdrawals, with cancel.

A session with more than one intent (secondary_intents) shows Deposit and Withdraw tabs. CashierSnapshot.intent follows the tab that shows, and step is .loading while a tab loads.

On a withdrawal, the total line, CashierSnapshot.total and the live amount carry the withdrawal figures: what leaves the balance and what the customer receives.

Two withdrawal error pages end the Cashier with the payment_method_unavailable code: a card withdrawal with no saved card, no new card allowed and no other method, and a method that pays only to an account the customer has none of.

The result says intent = .withdrawal and carries withdrawalStatus. A request Praxis accepted but has not paid out yet ends with .pending and withdrawalStatus .requested. See Results & Error Codes §1.4.

2.7 Authorization

A session with intent: "authorization" authorizes the card without charging it. A card that was authorized and not charged ends with the .authorized status. With amount 0 it is a zero-amount authorization and the amount stays fixed at 0; without an amount it runs like a deposit and the customer enters the amount. Events of an authorization session report the .deposit intent.

3. Testing and going live

3.1 Sandbox

  1. Ask your CSM to enable the iOS SDK for your sandbox application.
  2. Create sessions from your server against the sandbox with channel: "ios_sdk".
  3. Show the Cashier with environment: .sandbox.

Use the test cards and test data in Testing. The payment methods you can test depend on the gateways configured for your sandbox application.

3.2 What to test

ScenarioExpected result
Approved card payment.completed; Payment Notification received
Declined payment.failed with declined, or the retry / recovery page when Praxis offers it
3-D Secure challengeThe page opens inside the Cashier and closes on its own; the Cashier shows the result
Provider page that opens a bank appThe customer returns to your app through app_return_url; the Cashier reads the status
Customer closes a 3-D Secure or provider page before finishingThe page closes and the Cashier reads the status; usually .pending, final status from the Payment Notification
Every method with a provider page, on a real deviceThe provider page loads, completes and returns to the Cashier
Pending payment.pending; final status from the Payment Notification
Partial approvalThe accept / cancel screen
Saved cardCVV entry; removal of a saved card
Withdrawal.pending with withdrawalStatus .requested, or .completed
Customer tries to close the Cashier during processingThe close button is hidden and swipe-down is refused until the result
Cashier still open 15 minutes after it first opened the session.failed with session_expired (or .pending while a payment's result is unknown)
Web session token (channel missing).failed with configuration_error
No network while loadingError screen; after close, .failed with the screen's code (for example network or session_unavailable)
Your own layout or slotsNo layout_incomplete event with every method your account offers

3.3 Implementation checklist

  • The iOS SDK is enabled for your live application.
  • Your server creates sessions with channel: "ios_sdk" and a valid app_return_url, after authenticating the app user.
  • The release build uses environment: .live, and your server creates live sessions.
  • Your app registers app_return_url (URL scheme or Universal Link), tested on a real device with a bank app.
  • The Payment Notification handler verifies signatures, is idempotent, and is the only place balances change.
  • Every CashierErrorCode maps to a message in your app, with a default branch.
  • Every switch over SDK status, closed-by, withdrawal status, step, intent, error code and error category values has a default branch.
  • Your support flow logs orderID, traceID and errorCode.rawValue.

3.4 Limits

Not supported:

  • Switching from the card method to open banking during a card payment.
  • Keeping a decline recovery when the Cashier is opened again.

Good to know:

  • Card brands. A card brand the session does not allow is refused when the card is submitted, and the error shows on the card number. There is no brand check while the customer types.
  • Return from a bank app. If your app does not register app_return_url, the customer switches back by hand.
  • Texts without wording. Some withdrawal, retry and recovery texts have no default wording, and the Cashier shows their text key instead. Test these screens, and set each text that shows as a key with CashierTexts. All keys are listed in API Reference.

3.5 Support

For enablement and troubleshooting, contact your CSM. When you report an issue, include the orderID, transactionID, traceID and errorCode.rawValue of the CashierResult, the iOS version and the sequence of event names you received.

What's next


Did this page help you?