dart_payway

Creator: coderz1093

Last updated:

0 purchases

dart_payway Image
dart_payway Images

Languages

Categories

Add to Cart

Description:

dart 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",
));

copied to clipboard
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: '[email protected]',
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);

copied to clipboard
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: '[email protected]',
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);

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.