Accept payments
A unified quickstart for accepting card-reader payments with the iOS or Android Terminal SDK.
This guide shows the core card-reader payment flow for both mobile SDKs.
For platform-specific setup details, permissions, and advanced options, use the full documentation:
- iOS Terminal SDK
- Android Reader SDK
- Android Tap-to-Pay SDK (phone-based contactless payments without a separate reader)
Prerequisites
Section titled “Prerequisites”- A SumUp merchant account (or test account).
- An Affiliate Key linked to your app.
- A compatible card reader paired with the merchant account.
Basic Payment Flow
Section titled “Basic Payment Flow”- Initialize the SDK with your Affiliate Key.
- Log the merchant in.
- Optionally prepare the reader connection before checkout.
- Create a checkout request and start payment.
- Handle the result in your app.
1. Initialize the SDK
Section titled “1. Initialize the SDK”import SumUpSDK
@mainclass AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { SumUpSDK.setup(withAPIKey: "sup_afk_abcqwerty") return true }}public class SampleApplication extends Application { @Override public void onCreate() { super.onCreate(); SumUpState.init(this); }}2. Authenticate
Section titled “2. Authenticate”SumUpSDK.presentLogin(from: self, animated: true) { success, error in if let error { print("Login error: \(error)") return }
if success { print("Merchant logged in") }}SumUpLogin login = SumUpLogin.builder("sup_afk_abcqwerty").build();SumUpAPI.openLoginActivity(this, login, 1);3. Prepare for Checkout (Optional)
Section titled “3. Prepare for Checkout (Optional)”Use this when the merchant is about to charge, so the SDK can wake/reconnect the reader early.
SumUpSDK.prepareForCheckout()SumUpAPI.prepareForCheckout();4. Start a Payment
Section titled “4. Start a Payment”guard let merchantCurrencyCode = SumUpSDK.currentMerchant?.currencyCode else { return}
let request = CheckoutRequest( total: NSDecimalNumber(string: "12.34"), title: "Coffee", currencyCode: merchantCurrencyCode)request.foreignTransactionID = UUID().uuidString
SumUpSDK.checkout(with: request, from: self) { result, error in if let error { print("Checkout error: \(error)") return }
if let result { print("Result: \(result.success), transactionCode: \(result.transactionCode ?? "-")") }}SumUpPayment payment = SumUpPayment.builder() .total(new BigDecimal("12.34")) .currency(SumUpPayment.Currency.EUR) .title("Coffee") .foreignTransactionId(UUID.randomUUID().toString()) .build();
SumUpAPI.checkout(this, payment, 2);5. Handle the Checkout Result
Section titled “5. Handle the Checkout Result”// Handled in the completion block of SumUpSDK.checkout(...)// Use result.success, result.transactionCode, and error for your UI/state updates.@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 2 && data != null) { int code = data.getExtras().getInt(SumUpAPI.Response.RESULT_CODE); String message = data.getExtras().getString(SumUpAPI.Response.MESSAGE); String txCode = data.getExtras().getString(SumUpAPI.Response.TX_CODE); // Update your UI/state here. }}