Please provide reference
Opened this issue · 0 comments
ndenisj commented
I keep getting 'please provide reference' when trying to test bank payment
void _processPayment() {
try {
PaystackPayManager(context: context)
// Don't store your secret key on users device.
// Make sure this is retrive from your server at run time
// ..setSecretKey("")
..setSecretKey("sk_test_435a0cd0d7fbc14531713064c764ed2e644d3efe")
//accepts widget
..setCompanyAssetImage(Image(
image: AssetImage("assets/images/logo.png"),
))
..setAmount(1000 * 100)
// ..setReference("your-unique-transaction-reference")
..setReference(DateTime.now().millisecondsSinceEpoch.toString())
..setCurrency("NGN")
..setEmail("bakoambrose@gmail.com")
..setFirstName("Ambrose")
..setLastName("Bako")
..setMetadata(
{
"custom_fields": [
{
"value": "snapTask",
"display_name": "Payment to",
"variable_name": "payment_to"
}
]
},
)
..onSuccesful(_onPaymentSuccessful)
..onPending(_onPaymentPending)
..onFailed(_onPaymentFailed)
..onCancel(_onPaymentCancelled)
..initialize();
} catch (error) {
print("Payment Error ==> $error");
}
}