moyasar_payment
Moyasar के लिए Flutter लाइब्रेरी। Apple Pay, STC Pay और क्रेडिट कार्ड का समर्थन करता है।
Moyasar के लिए Flutter लाइब्रेरी। Apple Pay, STC Pay और क्रेडिट कार्ड का समर्थन करता है।
{"sdk":"flutter"}^0.13.4{"sdk":"flutter"}^1.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This plugin is available on Pub: https://pub.dev/packages/moyasar_payment
Add this to dependencies in your app's pubspec.yaml
moyasar_payment : latest_version
:warning: Make sure that the IOS version is set to 12.2 in your app's ios/PodFile
diff --git a/ios/PodFile b/ios/PodFile
- # platform :ios, '11'
+ platform :ios, '12.2'
Import moyasar_payment.dart
import 'package:moyasar_payment/moyasar_payment.dart';
Import paymodel.dart
import 'package:moyasar_payment/model/paymodel.dart';
Import applepaymodel.dart
import 'package:moyasar_payment/model/source/applepaymodel.dart';
var items = <String,double>{
'Item 1': 20.0,
'Item 2' : 80.0
};
PayModel res = await MoyasarPayment().applePay(
amount: 100.0,
publishableKey: 'publishable_key',
applepayMerchantId: 'applepay_merchant_id',
paymentItems: items,
currencyCode: 'SAR',
countryCode: 'SA',
description: 'description');
if (res.type != null) { // User Cancelled The Payment
print(res.message);
} else {
ApplePayModel applePayModel = ApplePayModel.fromJson(res.source);
}
Import creditcardmodel.dart
import 'package:moyasar_payment/model/source/creditcardmodel.dart';
PayModel res = await MoyasarPayment().creditCard(
description :'description',
amount: 100.0,
publishableKey: 'publishable_key',
cardHolderName: 'cardHolderName',
cardNumber: 'cardNumber',
cvv: 123,
expiryManth: 12,
expiryYear: 2025 or 25,
callbackUrl: 'https://example.com/orders');
CreditcardModel creditcardModel = CreditcardModel.fromJson(res.source);
print(creditcardModel.toJson());
Import stcpaymodel.dart
import 'package:moyasar_payment/model/source/stcpaymodel.dart';
PayModel res = await MoyasarPayment().stcPay(
amount: 100.0,
phoneNumber: 'phoneNumber',
publishableKey: 'publishable_key',
description: 'description');
STCPayModel stcPayModel = STCPayModel.fromJson(res.source);
print(stcPayModel.toJson())
var resdata = await MoyasarPayment().StcPayOtp(
otpValue: 'otp Value',
transactionUrl: 'transaction_url';
If you found this project useful, then please consider giving it a :star: on Github and sharing it with your friends via social media.
The project is open to public contribution. Please feel very free to contribute. Experienced an issue or want to report a bug? Please, report it here. Remember to be as descriptive as possible.