I’m using a dependency to impliment a payment system in my flutter app using Paystack Payment system. This is the dependency pay_with_paystak
In the dependency it’s expeting me to give a callbackUrl
. What is this callbackUrl and how do I create one for both Android and iOS
?
PayWithPayStack().now(
secretKey:
"sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
customerEmail: "[email protected]",
reference:
DateTime.now().microsecondsSinceEpoch.toString(),
callbackUrl: "setup in your paystack dashboard"//How do I do this?
currency: "GHS",
paymentChannel:["mobile_money", "card"],
amount: "20000",
transactionCompleted: () {
print("Transaction Successful");
},
transactionNotCompleted: () {
print("Transaction Not Successful!");
});
2
Answers
The documentation explains it:
Having said that, their example doesn’t have one so it’s probably optional. I don’t have access to a dashboard to verify this.
Pay_with_paystack uses WebView internally.
So CallbackURL denotes, After the successful transaction where you want to redirect. This helps PayStack to close the session. If you want to have this sort of functionality in Flutter you might have to set up a URL that redirects to your Flutter Screen, which I won’t recommend.
2 Good Ways to Solve this Issue
People are using it day in and day out and it works nicely.
pushAndRemoveUntil
.Thanks