Moyasar는 모바일 애플리케이션에서 원활하고 안전한 결제 통합을 가능하게 하는 Flutter/Dart 패키지입니다. Apple Pay, Samsung Pay, STC Pay 및 내장된 3DS 인증 기능을 갖춘 신용카드를 포함한 다양한 결제 수단을 지원합니다. Flutter를 사용하는 개발자를 위해 설계되어 Android와 iOS 플랫폼에서 결제 수락 과정을 간소화합니다. SDK는 보안 표준 준수를 보장하며 사용자에게 매끄러운 체크아웃 경험을 제공합니다.
사용 사례
앱 내 구매
전자상거래 앱
구독 서비스
디지털 서비스 결제
모바일 지갑 통합
주요 기능
Apple Pay 및 Samsung Pay 지원
STC Pay 통합
3DS가 있는 신용카드 결제
크로스 플랫폼 호환성 (Android 및 iOS)
안전한 결제 처리
적합한 대상
전자상거래 앱을 구축하는 플러터 개발자
중동 시장을 겨냥한 기업
다중 결제 방법 지원이 필요한 앱
빠른 결제 통합을 원하는 개발자
고려 사항
유효한 Moyasar 계정과 API 키가 필요합니다
지원되는 결제 수단에 제한됨
외부 결제 게이트웨이의 안정성에 따라 달라짐
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.