Closed kelvinyashim closed 2 months ago
After paying I doubt if there is a loading modal from the example but if you can provide more details (sample code, screenshots) bout this issue, it'll be helpful.
Hi yes theirs no modal. That was a error on my part However once the modal shows up on my debug console it says did not find Frame lockedcanvas
On Monday, August 19, 2024, Bin Emmanuel @.***> wrote:
After paying I doubt if there is a loading modal from the example but if you can provide more details (sample code, screenshots) bout this issue, it'll be helpful.
— Reply to this email directly, view it on GitHub https://github.com/binemmanuel/flutter_paystack_max/issues/6#issuecomment-2296535149, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4M7FNENWSVQAGE7OQDUIULZSHUWFAVCNFSM6AAAAABMVHWGJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWGUZTKMJUHE . You are receiving this because you authored the thread.Message ID: @.***>
Also when i cancel payment it still pays And how do i handle that this is what i have so far
if (response.status) { await firestore.createOrder(order); cartProvider.clearCart(); ScaffoldMessenger.of(context).showSnackBar(const SnackBar( backgroundColor: Colors.green, content: Text('Payment successful!'), )); } else { ScaffoldMessenger.of(context).showSnackBar(SnackBar( backgroundColor: Colors.red, content: Text('Payment failed: ${response.message}'), )); }
If you log/print the response you'll see that it returns
{
"status": true,
"message": "Verification successful",
"data": {
"id": 4100527671,
"domain": "test",
"status": "abandoned",
"reference": "ps_1724349127944175"
}
}
or
{
"status": true,
"message": "Verification successful",
"data": {
"id": 4100526349,
"domain": "test",
"status": "success",
"reference": "ps_1724349091658435"
}
}
The point is that Paystack always returns true for response.status
and you should keep an eye on response.data.status
instead. So, if you update to check for the status like below then you'll be good.
if (response.data.status == PaystackTransactionStatus.success) {
// Payment was successful
}
PaystackTransactionStatus is an enum that has the following values
thank you
After paying the modal then waits to show that another modal is loading then it shows connection timed out