Aceite pagamentos no seu aplicativo Flutter com facilidade usando o Moyasar. Com este SDK, você pode aceitar pagamentos rapidamente e com segurança por meio do Apple Pay, Samsung Pay, STC Pay e Cartão de Crédito (com etapa gerenciada de 3DS).
Orientação gerada a partir de informações públicas. Apenas para referência.
Moyasar é um pacote Flutter/Dart que permite a integração de pagamentos sem problemas e seguros em aplicativos móveis. Ele suporta múltiplos métodos de pagamento, incluindo Apple Pay, Samsung Pay, STC Pay e cartões de crédito com autenticação 3DS embutida. Projetado para desenvolvedores que usam Flutter, simplifica o processo de aceitar pagamentos nas plataformas Android e iOS. O SDK garante conformidade com padrões de segurança e oferece uma experiência de checkout fluida para os usuários.
Casos de uso
Compras no aplicativo
Aplicativos de comércio eletrônico
Serviços de assinatura
Pagamentos de serviços digitais
Integrações de carteira móvel
Principais recursos
Suporte para Apple Pay e Samsung Pay
Integração do STC Pay
Pagamentos com cartão de crédito com 3DS
Compatibilidade multiplataforma (Android e iOS)
Processamento de pagamento seguro
Indicado para
Desenvolvedores Flutter construindo aplicativos de comércio eletrônico
Empresas direcionadas para mercados do Oriente Médio
Aplicativos que exigem suporte a múltiplos métodos de pagamento
Desenvolvedores procurando integração rápida de pagamento
Considerações
Requer conta válida do Moyasar e chaves da API
Limitado a métodos de pagamento suportados
Dependente da estabilidade da gateway de pagamento externa
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
Moyasar Flutter SDK
Accept payments in your Flutter app through Apple Pay, Samsung Pay, STC Pay, and Credit Card — with the 3DS step handled for you.
Method
Platforms
Widget
Credit Card (with managed 3DS)
iOS, Android
CreditCard
Apple Pay
iOS
ApplePay
Samsung Pay
Android (Samsung devices)
SamsungPay
STC Pay
iOS, Android
STCPay
Every widget hides itself when its method isn't available on the device, so you can drop them all into one screen without platform checks.
Install
flutter pub add moyasar
Requires Flutter >=1.17.0, Dart >=2.18.2 <4.0.0, and iOS 12.0+.
You'll need a Moyasar account — get your API keys.
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.