A package to simplify work with the WayForPay payment system. Is a wrapper over WayForPay API.
- Card data entry screen
- 3D Secure verification
- Ability to create a custom data entry screen
- Comments :)
Create WayForPay
object
WayForPay wayForPay = WayForPay();
Set your merchantAccount
and merchantSecretKey
wayForPay.merchantAccount = "test_merch_n1";
wayForPay.merchantSecretKey = "flk3409refn54t54t*FNJRET";
Set your products list
wayForPay.productCount = [1];
wayForPay.productName = ["Test product"];
wayForPay.productPrice = [0.1];
Open card enter screen and be ready to get payment status. Check if wayForPayResponse
is not null
wayForPay
.openCardEnterScreen(context,
orderDate: DateTime.now(),
merchantTransactionSecureType: MerchantTransactionSecureType.AUTO,
orderReference: "testReference",
amount: 0.1)
.then((value) {
if (value != null) {
print("transactionStatus: " +
value.transactionStatus +
", reasonCode: " +
value.reasonCode.toString() +
", reason: " +
value.reason);
}
});
Create card user data model
CardModel cardModel = CardModel(
card: "0000000000000000",
cardCvv: "111",
cardHolder: "Ivanov Ivan",
expMonth: "01",
expYear: "2030");
And start payment manually
wayForPay
.makePayment(context,
cardModel: cardModel,
amount: 0.1,
merchantTransactionSecureType: MerchantTransactionSecureType.AUTO,
orderReference: "testReference",
orderDate: DateTime.now())
.then((value) {
if (value != null) {
print("reasonCode: " +
value.reasonCode.toString() +
", reason: " +
value.reason);
}
});
Before going on to copy-paste the code snippets in this section, double-check you have configured your application correctly.
If you encounter any issues please refer to the API docs and the sample code in the example
directory before opening a request on Github.
The example
directory has a sample application that demonstrates the features of this package.
Checkout the lovely API documentation generated by pub.