not open card enter detail page
Opened this issue · 0 comments
Error is not showing and also not showing the page where we can enter the card details.
void setPaystack(BuildContext context, String result) {
var email = PreferenceUtils.getString(AppConstant.useremail);
var name = PreferenceUtils.getString(AppConstant.username);
try {
PaystackPayManager(context: context)
..setSecretKey(paystackSecretKey)
//accepts widget
..setReference("1")
..setCompanyAssetImage(Image(
image: AssetImage('images/app_icon.png'),
))
//the amount is in kobo,peswas or cents
..setAmount(
(totalprice * 100).toInt(),
)
..setCurrency("NGN")
..setEmail(email)
..setFirstName(name)
..setLastName("")
..setMetadata(
{
"custom_fields": [
{
"value": "Area Skin",
"display_name": "Payment to",
"variable_name": "payment_to"
}
]
},
)
..onSuccesful(_onPaymentSuccessful)
..onPending(_onPaymentPending)
..onFailed(_onPaymentFailed)
..onCancel(_onPaymentCancelled)
..initialize();
} catch (e) {
print("Catch : $e");
}
}
void _onPaymentSuccessful(Transaction transaction) {
print("Transaction was successful");
print("Transaction Message ===> ${transaction.message}");
print("Transaction Refrence ===> ${transaction.refrenceNumber}");
}
void _onPaymentPending(Transaction transaction) {
print("Transaction is pendinng");
print("Transaction Refrence ===> ${transaction.refrenceNumber}");
}
void _onPaymentFailed(Transaction transaction) {
print("Transaction failed");
print("Transaction Message ===> ${transaction.message}");
}
void _onPaymentCancelled(Transaction transaction) {
print("Transaction was cancelled");
}