dart_payway 1.0.8+2 copy "dart_payway: ^1.0.8+2" to clipboard
dart_payway: ^1.0.8+2 copied to clipboard

Allow you to integrate your app in dart language with ABA PayWay

Payway in Dart

PaywayTransactionService is required #

var service = PaywayTransactionService(
          merchant: PaywayMerchant(
        merchantID: env['ABA_PAYWAY_MERCHANT_ID'] ?? '',
        merchantApiName: env['ABA_PAYWAY_MERCHANT_NAME'] ?? '',
        merchantApiKey: env['ABA_PAYWAY_API_KEY'] ?? '',
        baseApiUrl: env['ABA_PAYWAY_API_URL'] ?? '',
        refererDomain: "http://mylekha.app",
      ));

Create Transaction Example #

  /// create transaction
  final tranID = service.uniqueTranID();

  var _transaction = PaywayCreateTransaction(
      amount: 6.00,
      items: [
        PaywayTransactionItem(name: "ទំនិញ 1", price: 1, quantity: 1),
        PaywayTransactionItem(name: "ទំនិញ 2", price: 2, quantity: 1),
        PaywayTransactionItem(name: "ទំនិញ 3", price: 3, quantity: 1),
      ],
      reqTime: service.uniqueReqTime(),
      tranId: tranID,
      email: 'support@mylekha.app',
      firstname: 'Miss',
      lastname: 'My Lekha',
      phone: '010464144',
      option: PaywayPaymentOption.abapay_deeplink,
      shipping: 0.0,
      returnUrl: "https://mylekha.app");

  var createResponse =
      await service.createTransaction(transaction: _transaction);

  print(_transaction.amount);
  print(createResponse.status);

Generate checkout uri for backend #

      final tranID = service.uniqueTranID();

      var _transaction = PaywayCreateTransaction(
          amount: 6.00,
          items: [
            PaywayTransactionItem(name: "ទំនិញ 1", price: 1, quantity: 1),
            PaywayTransactionItem(name: "ទំនិញ 2", price: 2, quantity: 1),
            PaywayTransactionItem(name: "ទំនិញ 3", price: 3, quantity: 1),
          ],
          reqTime: service.uniqueReqTime(),
          tranId: tranID,
          email: 'support@mylekha.app',
          firstname: 'Miss',
          lastname: 'My Lekha',
          phone: '010464144',
          option: PaywayPaymentOption.abapay_deeplink,
          shipping: 0.0,
          returnUrl: "https://mylekha.app");
      var webURI = await service.generateTransactionCheckoutURI(
          transaction: _transaction);

1
likes
120
pub points
52%
popularity

Publisher

verified publishermylekha.app

Allow you to integrate your app in dart language with ABA PayWay

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

crypto, dio, intl, logger

More

Packages that depend on dart_payway