Skip to main content

Swirepay iOS Payment SDK — Setup & Installation

Modular Swift SDK for iOS 15+ — Card, Bank (ACH + Plaid), Apple Pay (native PassKit + hosted web), Google Pay (hosted web on iOS), and a unified Checkout sheet.


Quick start checklist​

  1. Add the SDK (XCFrameworks).
  2. Call SwirepayCore.shared.initialize(...) with your API key, environment, and account Gid.
  3. Pick a payment flow — Checkout is the easiest multi-method option.
  4. On success, read SwirepayPaymentCompletionResponse — do not expose raw payment-session JSON to end users.

Installation​

XCFrameworks​

Drag required .xcframework files into your app target and set each to Embed & Sign.

ProductWhen you need it
SwirepayCoreAlways
SwirepayCardCard payments
SwirepayBankBank / ACH + Plaid LinkKit
SwirepayApplePayApple Pay (native + web)
SwirepayGooglePayGoogle Pay (hosted web)
SwirepayCheckoutUnified checkout sheet

Initialize the SDK​

Call once before any payment (app launch or checkout screen).

import SwirepayCore

SwirepayCore.shared.initialize(
config: SwirepayConfig(
apiKey: "sk_…",
environment: .sandbox,
accountGid: "account-…"
),
currency: .usd
) { success in
guard success else { return }
// SDK ready
}
SettingNotes
environment.sandbox → staging; .production → api.swirepay.com
accountGidUsed for Plaid link tokens and checkout session
destinationAccountKeyOptional — sent as x-destination-account

Handle payment responses​

SwirepayPaymentCompletionResponse (preferred)​

let completion = result.paymentCompletionResponse
if completion.success {
let psGid = completion.paymentSessionGid
let json = completion.prettyJSONString
}

Errors​

Encrypted methods throw on failure. Checkout sheet returns Result<SwirepayPaymentCompletionResponse, Error>.


Products reference​

ModulePurpose
SwirepayCoreConfig, networking, checkout session
SwirepayCardCard payment helpers
SwirepayBankPlaid Link + ACH checkout
SwirepayApplePayNative + web Apple Pay
SwirepayGooglePayGoogle Pay credentials + web wallet
SwirepayCheckoutUnified payment sheet

API hosts​

EnvironmentHost
.sandboxhttps://staging-backend.swirepay.com
.productionhttps://api.swirepay.com