Skip to content

A package to simplify work with the WayForPay payment system. Is a wrapper over WayForPay API.

License

Notifications You must be signed in to change notification settings

dmytroporoshyn/flutter_wayforpay_package

Repository files navigation

Flutter Wayforpay Package

Pub Version

A package to simplify work with the WayForPay payment system. Is a wrapper over WayForPay API.

✨ Features

  • Card data entry screen
  • 3D Secure verification
  • Ability to create a custom data entry screen
  • Comments :)

📷 Screenshots

⚙️ Getting Started

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);  
  }  
});

Or

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);  
  }  
});

❓ Usage

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.

Example app

The example directory has a sample application that demonstrates the features of this package.

API reference

Checkout the lovely API documentation generated by pub.

👨‍💻 Creator

Dmytro Poroshyn in Squadra

About

A package to simplify work with the WayForPay payment system. Is a wrapper over WayForPay API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages