Inttegro SDK for iOS
Add Inttegro checkout to a SwiftUI or UIKit app with a native iOS payment sheet. The iOS SDK owns the customer-facing payment flow; your backend continues to own credentials and every decision about the order.
The public Swift package is available now. The current preview supports mobile money checkout; card payments and Apple Pay are not available. CocoaPods distribution is not published yet.
Requirements
- iOS 16 or later
- SwiftUI or UIKit
- A backend endpoint that creates and finalizes an Inttegro order
In Xcode, choose File → Add Package Dependencies and enter:
https://github.com/inttegro/inttegro-sdk-ios.git
The Swift Package Index lists Inttegro for discovery and compatibility results. Xcode installs the package from its versioned Git repository.
Select version 0.4.1 or later. The package exposes two products with separate
responsibilities:
Inttegrocontains the native Checkout client, SwiftUI and UIKit payment sheet, result models, and telemetry.InttegroBridgecontains the Objective-C-compatible coordinator used by the official React Native and Flutter packages.
Native Swift applications should add only the Inttegro product to their
application target and import it where they present Checkout:
import Inttegro
Present the payment sheet
Give the SDK only the finalized Order ID returned by your backend. In SwiftUI, attach the payment sheet to the view that starts checkout:
let configuration = try PaymentSheetConfiguration(
orderID: orderID,
returnURL: URL(string: "merchant-app://inttegro-return"),
features: .init(
showLineItems: true,
showInvoiceDownload: true,
showReceiptDownload: true,
allowPaymentMethodChange: false
)
)
checkoutView.inttegroPaymentSheet(
isPresented: $isPaymentSheetPresented,
configuration: configuration,
eventHandler: handleCheckoutEvent,
onCompletion: handlePaymentResult
)
UIKit applications can create PaymentSheet with the same configuration and
call present(from:completion:). Both entry points retrieve the checkout,
present available payment methods, handle confirmation or provider
authorization, and return a completed, canceled, or failed result.
For a Buy link, construct the same sheet with its public Purchase Intent instead:
let configuration = try PaymentSheetConfiguration(
purchaseIntentID: buyLink.purchaseIntentID,
returnURL: URL(string: "merchant-app://inttegro-return")
)
The sheet gathers the Buy-link choices and payment details without creating an Order. When the payer presses Pay, Inttegro creates the finalized Order and starts the payment attempt together. Customer-selected pricing uses the authoritative currency, range, and suggestions returned by Checkout.
Observe the payment lifecycle
The optional eventHandler receives the same ordered lifecycle as the web and
other mobile SDKs: presented, ready, change, orderPrepared,
paymentAttemptStarted, paymentActionRequired, paymentProcessing,
paymentAttemptFailed, completed, canceled, and failed.
Every CheckoutEvent includes type, occurredAt, flowID, and sequence.
Events about a payment attempt carry the full client-safe order rather than a
separate payment ID. paymentAttemptFailed is recoverable; leave the sheet in
control so the payer can retry. The completion callback receives the exact
terminal completed, canceled, or failed event:
func handlePaymentResult(_ result: PaymentSheetResult) {
switch result {
case let .completed(event):
showPaymentComplete(orderID: event.order!.id)
case .canceled:
restoreCheckoutControls()
case let .failed(event):
showPaymentUnavailable(event.failure!.message)
}
}
Use lifecycle events for immediate interface state and privacy-safe telemetry. Before fulfillment, retrieve the Order from your backend or process its webhook.
React Native and Flutter use these same native payment sheets instead of reimplementing checkout. The Android robot is reproduced from work created and shared by Google and used according to the Creative Commons 3.0 Attribution License.
Optional feature states
Configure optional presentation through
PaymentSheetConfiguration.Features.
These values control only what the native sheet shows. They cannot change the
Order, its shipping address, its amount, or the customer that owns an attached
payment method. Start with the defaults, then expose only the context or
follow-up actions that help the payer complete this checkout.
| Property | Default | What changes |
|---|---|---|
allowPaymentMethodChange | true | Set to false to keep an attached method selected and remove the replacement action. If the Order has no attached method, the payer can still enter one. |
showInvoiceDownload | false | Offers the invoice after a successful payment when Checkout returns a secure invoice URL. |
showLineItems | false | Offers a collapsed Order summary when Checkout returns line items. Opening it moves the sheet to its large detent before revealing the items. |
showReceiptDownload | false | Offers the receipt after a successful payment when Checkout returns a secure receipt URL. |
The opening capture combines showLineItems: true with
allowPaymentMethodChange: false. The attached method and pay action remain in
view while the Order summary stays out of the way until the payer opens it. The
completion capture enables both download properties. After payment succeeds,
the sheet returns to its compact detent and shows only the document actions for
URLs Checkout actually supplied; the Done button remains immediately available.
showLineItems with a fixed methodallowPaymentMethodChange is false, so the attached account stays visible without a replacement action. The summary expands the sheet only when the payer opens it.showInvoiceDownload + showReceiptDownloadAfter a successful payment, available Checkout URLs become secure download actions while the success sheet returns to its compact height.React Native and Flutter use these same native payment sheets instead of reimplementing checkout. The Android robot is reproduced from work created and shared by Google and used according to the Creative Commons 3.0 Attribution License.
A completed result is useful for immediate app feedback. Your backend must still read the order's current state or process its webhook before releasing goods or services.