Akzeptieren Sie Zahlungen in Ihrer Flutter-App einfach mit Moyasar. Mit diesem SDK können Sie schnell und sicher Zahlungen über Apple Pay, Samsung Pay, STC Pay und Kreditkarte (mit verwalteter 3DS-Schritt) akzeptieren.
Aus öffentlichen Paketdaten erstellte Orientierung.
Moyasar ist ein Flutter/Dart-Paket, das eine nahtlose und sichere Zahlungsintegration in mobilen Anwendungen ermöglicht. Es unterstützt mehrere Zahlungsmethoden, darunter Apple Pay, Samsung Pay, STC Pay und Kreditkarten mit integrierter 3DS-Authentifizierung. Für Entwickler, die Flutter verwenden, wurde es entwickelt, um den Zahlungseingang auf Android- und iOS-Plattformen zu vereinfachen. Das SDK gewährleistet die Einhaltung von Sicherheitsstandards und bietet Nutzern eine reibungslose Kasse-Erfahrung.
Samsung Android devices only. Add the spay_sdk_api_level meta-data to your AndroidManifest.xml — see the integration guide. The SDK bundles Samsung's official Flutter plugin, so no app-level override is needed.
The widget hides itself when Samsung Pay isn't ready. To check explicitly in a custom flow:
final eligible = awaitSamsungPayEligibility.isEligible(paymentConfig);
final result = awaitSamsungPayEligibility.check(paymentConfig); // with diagnosticsdebugPrint('${result.reason}'); // ready, notAndroid, notReady, sdkError, timeout...
Credit Card & STC Pay
Both render a full form and accept an optional locale. Localization.ar() also switches the layout to RTL; individual strings can be overridden through its named parameters.
Override the API host, e.g. https://apimig.moyasar.com.
applyCoupon
bool?
null
Set false to skip coupon application.
ApplePayConfig
Field
Type
Default
Description
merchantId
String
required
Must match Xcode and your dashboard.
label
String
required
Store name in the payment sheet.
manual
bool
required
Authorize now, capture later.
saveCard
bool
required
Tokenize for later charges.
merchantCapabilities
List<String>
["3DS", "debit", "credit"]
Must include "3DS".
supportedCountries
List<String>
["SA"]
Widening this raises fraud risk.
SamsungPayConfig
Field
Type
Default
Description
serviceId
String
required
From the Samsung merchant dashboard.
merchantName
String
required
Shown in the payment sheet.
orderNumber
String?
auto-generated
[A-Za-z0-9-], max 36 chars. Returned as samsungpay_order_id in the response metadata.
manual
bool
false
Authorize now, capture later.
CreditCardConfig
saveCard (bool, required) — tokenize after a successful payment.
manual (bool, required) — authorize now, capture later.
PaymentSplit
Divide a payment among recipients, in compliance with SAMA and ZATCA. Aggregation clients only — splits on other payments are ignored. The splits must total the payment amount.
With a custom Credit Card UI, 3DS is your responsibility: when status is initiated, open (result.source as CardPaymentResponseSource).transactionUrl in a web view and watch for the redirect to PaymentConfig.callbackUrl.
STC Pay takes two steps — start the payment, then verify the OTP:
final result = awaitMoyasar.pay(
apiKey: paymentConfig.publishableApiKey,
paymentRequest: PaymentRequest(paymentConfig, StcRequestSource(mobile: '0512345678')),
);
final transactionUrl = (result.source asStcResponseSource).transactionUrl!;
final verified = awaitMoyasar.verifyOTP(
transactionURL: transactionUrl,
otpRequest: OtpRequestSource(otpValue: '1234'),
);
Testing
Credit Card — test cards work against the sandbox.
Apple Pay — use a real device; the simulator can't complete an authorization. Test amounts.
Samsung Pay — requires a Samsung device. The example app uses flavors: flutter run --flavor default_ (Apple Pay) or --flavor spay (Samsung Pay). See example/CONFIGURATION_GUIDE.md.
Deprecations
STCPaymentComponent is deprecated and will be removed in the next major version — it's a drop-in rename to STCPay.