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
- Add the SDK (XCFrameworks).
- Call
SwirepayCore.shared.initialize(...)with your API key, environment, and account Gid. - Pick a payment flow — Checkout is the easiest multi-method option.
- 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.
| Product | When you need it |
|---|---|
SwirepayCore | Always |
SwirepayCard | Card payments |
SwirepayBank | Bank / ACH + Plaid LinkKit |
SwirepayApplePay | Apple Pay (native + web) |
SwirepayGooglePay | Google Pay (hosted web) |
SwirepayCheckout | Unified 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
}
| Setting | Notes |
|---|---|
environment | .sandbox → staging; .production → api.swirepay.com |
accountGid | Used for Plaid link tokens and checkout session |
destinationAccountKey | Optional — 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
| Module | Purpose |
|---|---|
SwirepayCore | Config, networking, checkout session |
SwirepayCard | Card payment helpers |
SwirepayBank | Plaid Link + ACH checkout |
SwirepayApplePay | Native + web Apple Pay |
SwirepayGooglePay | Google Pay credentials + web wallet |
SwirepayCheckout | Unified payment sheet |
API hosts
| Environment | Host |
|---|---|
.sandbox | https://staging-backend.swirepay.com |
.production | https://api.swirepay.com |