pass_mtx 0.0.27 pass_mtx: ^0.0.27 copied to clipboard
Pass Micro Transaction Module - Register your bank cards to PASS application and make your transaction the most convenient and fastest way. PASS.MN
Pass Micro Transaction #
Platform Support #
Android | iOS |
---|---|
✔️ | ✔️ |
🔨 Installation #
dependencies:
pass_mtx: ^0.0.27
⚙ Import #
import 'package:pass_mtx/pass_mtx.dart';
🕹️ Usage/Example #
Initialization & Check connection #
Development purpose you can use init
function for select environment of PASS
Purchase or other methods. When development done, change it to initProd
.
import 'package:pass_mtx/pass_mtx.dart';
// Initialize For Staging ENV using AppID ClientID, PrivateKey, PublicKey,
init(String appId, String clientId, String privatePem, String publicPem);
// Initialize For Production ENV using AppID ClientID, PrivateKey, PublicKey,
initProd(String appId, String clientId, String privatePem, String publicPem);
// Get Pass API Status
getPassPing();
// Get Pass Version Info
getPassVersion();
// Initialization example using 'kReleaseMode'
if (kReleaseMode) {
passInitResult = await _passMtxPlugin.initProd(
appId, clientId, privatePem, publicPem) ??
'Unknown platform version';
} else {
passInitResult =
await _passMtxPlugin.init(appId, clientId, privatePem, publicPem) ??
'Unknown platform version';
}
Card Methods #
Included methods of Card registration and Get card lists you added in PASS
wallet or delete it.
// Get card token by UserID
getCard(String userId);
// Saving user card info
saveCard(String userId, String szPan, String cvv, String expDate, String cardHolderName);
// Verify Card
verifyCard(String userId, String verificationMethod, String verificationValue)
// Delete User card
deleteCard(String userId, String cardRef);
// Set Default card
setDefaultCard(String userId, String cardRef);
Purchase #
Direct Purchase #
Pass MTX included micro transaction method makePassPurchase
. paymentAmount
field need to multiple by 100 for original amount. If user enters 1000 in controller, multiply it 1000 * 100 than send it through paymentAmount
field. HEY PASS ME...
// Make Pass Purchase
makePassPurchase( String userId, String orderId, String paymentToken, String expDate, String paymentAmount, String dbRefNo, String description)
// Make Purchase Example
TextEditingController amountController = TextEditingController(); // when 1000 in controller text
String amount = amountController.text;
String realAmount = (int.parse(amount) * 100).toString();
try {
passPurchaseResult = await _passMtxPlugin.makePassPurchase(
"1", // userId
"pass_inapp_txn_1", // orderId
tokenController.text, // paymentToken
"2509", // expDate
realAmount, // paymentAmount
"DTB${DateTime.now().toIso8601String()}", // dbRefNo
"pass txn test", // description
) ??
'Make Purchase Failed';
} on PlatformException {
passPurchaseResult = 'Failed to get platform version.';
}
Customer Presented Mode Purchase #
// Inquiry the presented qr scanned by scanner and get process of payment
orderEnquery(String userId, String orderId)
// Optional: When amount above under CVM limit
orderConfirm(
String userId,
String orderId,
String confirmMethod,
String confirmResult,
String payToken,
String expDate)
// Cancel order by user
orderCancel(String userId, String orderId)
📃 License #
/*
#################################################################################
# #
# COPYRIGHT (C) DATABANK LLC since 2017 #
# #
# ALL RIGHTS RESERVED BY DATABANK LLC. THIS PROGRAM MUST BE #
# USED SOLELY FOR THE PURPOSES OF DATABANK LLC AND ITS USERS. #
# NO PART OF THIS PROGRAM MAY BE MODIFIED IN SOURCE OR BINARY FORM BY OTHERS #
# WITHOUT THE PRIOR WRITTEN PERMISSION OF DATABANK LLC. #
# #
# USE OF COPYRIGHT NOTICE DOES NOT EVIDENCE PUBLICATION OF THE PROGRAM. #
# #
#################################################################################
*/