sumup
SumUp SDK का उपयोग करने के लिए Flutter वрапर। इस प्लगइन के साथ, आपकी ऐप आसानी से SumUp टर्मिनल से कनेक्ट कर सकती है, लॉगिन कर सकती है और Android और iOS पर कार्ड भुगतान स्वीकार कर सकती है।
SumUp SDK का उपयोग करने के लिए एक Flutter वрапर। इस प्लगइन के साथ, आपकी ऐप को Android और iOS पर SumUp टर्मिनल से आसानी से कनेक्ट करने, लॉगिन करने और कार्ड भुगतान स्वीकार करने में सक्षम होगी।
{"sdk":"flutter"}{"sdk":"flutter"}यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
pub package likes popularity pub points
A Flutter plugin for the SumUp SDK. Supports card reader and Tap-to-Pay payments on Android and iOS.
Support this project by purchasing SumUp terminals through our affiliate links for your country:
Version 0.15.0 adopts the native SDK 7.x toolchains.
android/gradle.properties, set:android.builtInKotlin=false
android.newDsl=false
Declare org.jetbrains.kotlin.android version 2.4.0 with apply false in
android/settings.gradle:plugins {
id "org.jetbrains.kotlin.android" version "2.4.0" apply false
}
Then apply it in android/app/build.gradle:plugins {
id "org.jetbrains.kotlin.android"
}
Flutter 3.44 reports this legacy-KGP path as temporary; keep the two compatibility flags until
Flutter can use the vendor-required Kotlin version through AGP's built-in Kotlin integration.Android rollback warning: after an app has initialized SumUp Android SDK 7.1.0, downgrading that installation to a version backed by an older native SDK is not supported. Validate the migration with a sandbox merchant and use a staged rollout.
iOS rollback warning: before downgrading from SumUp iOS SDK 7.1.2, upload all pending Offline Payments. If a downgrade is unavoidable, upload them first, delete the app, and then install the version backed by the older SDK.
Add sumup to your pubspec.yaml:
dependencies:
sumup:
Import sumup:
import 'package:sumup/sumup.dart';
// 1. Initialise the SDK with your Affiliate Key
await Sumup.init(affiliateKey);
// 2. Log in — either interactively or with an OAuth token
await Sumup.login();
// or
await Sumup.loginWithToken(token);
// 3. (Optional) Ask the user to pick / configure a card reader
await Sumup.openSettings();
// 4. Optionally warm up the reader before checkout
await Sumup.prepareForCheckout();
// 5. Run a checkout
var payment = SumupPayment(
title: 'Coffee',
total: 3.50,
currency: 'EUR',
foreignTransactionId: '', // leave empty to auto-generate a unique ID
saleItemsCount: 1,
skipSuccessScreen: false,
tip: 0.0,
);
var checkout = await Sumup.checkout(SumupPaymentRequest(payment));
// checkout.success — bool
// checkout.transactionCode — String
// checkout.amount — double (not available on Android Tap-to-Pay)
// checkout.currency — String (not available on Android Tap-to-Pay)
// checkout.products — List<SumupProduct>; iOS and Android card reader only
// checkout.merchantCode — String; Android Tap-to-Pay only
// checkout.cardScheme — String; Android Tap-to-Pay only
// checkout.errors — String; non-null when success is false
Sumup.init(affiliateKey);
Sumup.login();
Sumup.loginWithToken(token);
Sumup.isLoggedIn;
Sumup.merchant;
Sumup.openSettings();
Sumup.prepareForCheckout();
Sumup.isTipOnCardReaderAvailable;
Sumup.isCardTypeRequired; // iOS only
Sumup.isCheckoutInProgress; // iOS only
// Card reader checkout
Sumup.checkout(SumupPaymentRequest(payment));
// Tap-to-Pay checkout
Sumup.checkout(SumupPaymentRequest(payment, paymentMethod: PaymentMethod.tapToPay));
Sumup.checkTapToPayAvailability(); // → TapToPayAvailabilityResult
Sumup.presentTapToPayActivation(); // iOS only; no-op on Android
Sumup.logout();
Accept contactless payments directly on compatible smartphones, without any additional hardware.
Requirements:
com.apple.developer.proximity-reader.payment.acceptance added to your project (requires approval from Apple)Setup:
Sumup.login() or Sumup.loginWithToken().Sumup.checkTapToPayAvailability(). If isActivated is false, call Sumup.presentTapToPayActivation() to run the one-time activation flow.PaymentMethod.tapToPay in your request:var request = SumupPaymentRequest(payment, paymentMethod: PaymentMethod.tapToPay);
var checkout = await Sumup.checkout(request);
Tap-to-Pay is opt-in (since 0.14.2). The TTP SDK (
com.sumup.tap-to-pay:utopia-sdk) lives in a private SumUp Maven repository. By default the plugin builds without it — no credentials, no private-repo access, no401. The card-reader (merchant-sdk) checkout path works fully in this mode. You only need the steps below if you actually want Tap-to-Pay. (If you previously hitCould not resolve com.sumup.tap-to-pay:utopia-sdk … 401 Unauthorized, upgrade to 0.14.2+ and simply don't set the property.)
Requirements:
minSdk to 30 when enabling Tap-to-Pay.android {
compileOptions {
coreLibraryDesugaringEnabled true
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
integration@sumup.com), then add them to your
user-level ~/.gradle/gradle.properties (or pass them via -P / environment). Do not commit the
credentials to the app repository. The plugin reads both credentials and automatically wires
the private Maven repo and compiles the
utopia-sdk dependency — you do not add it to your own build.gradle.SUMUP_TTP_MAVEN_USERNAME=...
SUMUP_TTP_MAVEN_PASSWORD=...
For environment-only configuration, use the names above or Gradle's standard
ORG_GRADLE_PROJECT_SUMUP_TTP_MAVEN_USERNAME and
ORG_GRADLE_PROJECT_SUMUP_TTP_MAVEN_PASSWORD variables.Usage:
Sumup.loginWithToken(accessToken) — token login is required for the TTP SDK to authenticate in the background.PaymentMethod.tapToPay in your request:var request = SumupPaymentRequest(payment, paymentMethod: PaymentMethod.tapToPay);
var checkout = await Sumup.checkout(request);
Note: The Android TTP SDK does not return
amountorcurrencyin the transaction result. If you need them, query the SumUp Transactions API usingcheckout.transactionCodeorcheckout.foreignTransactionId.