Closed raphaeldivine3028 closed 10 months ago
Thanks for the appreciation and also for pointing these out, I will work on them.
Package now responses to SafeArea widget. I'm still working on the cancel button for mobile (it works well for web).
Thank you so much. I'm looking forward to the cancel button fix
On Mon, Jul 17, 2023, 2:09 PM Princewil @.***> wrote:
Package now responses to SafeArea widget. I'm still working on the cancel button for mobile (it works well for web).
— Reply to this email directly, view it on GitHub https://github.com/Princewil/flutter_paystack_plus/issues/3#issuecomment-1638111034, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQKHCUL3ZZPBNJB5W5BC4YDXQU2SJANCNFSM6AAAAAAZK4ANKE . You are receiving this because you authored the thread.Message ID: @.***>
Nicely done. I will also be on the lookout for the update concerning the onClosed and onSuccess functions. 👍
For anyone still having issues with the onClosed
and the onSuccess
functionality, there are few things you'd need to do to make it work.
FlutterPaystackPlus.openPaystackPopup()
, include the below in your metadata
...
metadata: {
"cancel_action": "cancelurl.com",
},
NB: Under the hood, the package uses a Webview
; hence, the NavigationDelegate
will be listening for the URL you passed as the value of the cancel_action
you had entered above, to run the function @Princewil had created, check below:
NB: You must use the exact cancelurl.com
, as @Princewil , from his code, is using it in his package...
...
NavigationDelegate(
onNavigationRequest: (request) async {
if (request.url.contains('cancelurl.com')) { // here is the cancel_action value being used...
await _checkTransactionStatus(snapshot.data!.reference)
.then((value) {
Navigator.of(context).pop();
});
}
if (request.url.contains('paystack.co/close')) {
await _checkTransactionStatus(snapshot.data!.reference)
.then((value) {
Navigator.of(context).pop();
});
}
if (request.url.contains(widget.callbackUrl)) { // Your callback url here
await _checkTransactionStatus(snapshot.data!.reference)
.then((value) {
Navigator.of(context).pop();
});
}
return NavigationDecision.navigate;
},
),
)
NB: You don't need to worry yourself about the above function.
callBackUrl
, found in your Paystack Dashboard.NB: At the time of dropping this comment (which I'll update once @Princewil merges my PR), the callBackUrl
is not hitting the paystack initialize
endpoint, hence the onSuccess()
won't be called. But once the merge is done, hopefully, it should get the onSuccess()
function working again.
NB: To the best of my knowledge about paystack
, the value you provide for the callBackUrl
, overrides the value in your paystack dashboard
.
E.g., if you have george_is_happy.com
in your paystack dashboard and you pass george_is_sad.com
, the latter (sad) will override the former (happy).
Thanks. 🙏 , and thanks, @Princewill for this wonderful package.
Thank you so much for your comment @gikwegbu and for solutions you gave🫡
I will merge PR once I test it.
All good now!
I've updated the package so that you no longer need to manually add "cancel_action": "cancelurl.com"
to the metadata. The package now adds this information automatically, which helps prevent spelling errors that could occur when adding it manually.
I guess this reply is late. However I update the package on pub.
On Fri, 29 Dec 2023 at 18:22, George Ikwegbu Chinedu < @.***> wrote:
Thanks chief.
Quick question: Will you be updating the package on PubDev? The changes I've made are in my cache, and once my teammates pull from my branch, they won't have those changes in theirs.
Once again, Thanks for your help.
On Fri, Dec 29, 2023 at 5:06 PM Dr. Princewill @.***> wrote:
All good now!
— Reply to this email directly, view it on GitHub < https://github.com/Princewil/flutter_paystack_plus/issues/3#issuecomment-1872192042>,
or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJOQDEARWH7KM4RGBKXZXA3YL3TBRAVCNFSM6AAAAAAZK4ANKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGE4TEMBUGI>
. You are receiving this because you were mentioned.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/Princewil/flutter_paystack_plus/issues/3#issuecomment-1872231546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJWWTE67C5NYXXCPFXFJO6LYL335ZAVCNFSM6AAAAAAZK4ANKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGIZTCNJUGY . You are receiving this because you modified the open/close state.Message ID: @.***>
Good one chief
Firstly, thank you so much for the effort put into this app. I sincerely appreciate it.
While most things work as expected, there are a few issues:
Safe Area: The payment screen is not respecting the safe area of my Android app, which includes the notification bar. See attached image.
The "Cancel Payment" payment is not responding. When clicked, nothing happens.
The Onsuccess/Onclosed isn't responding too. When a transaction isn't successful, the app is supposed to show a Not Successful Dialog, but this doesn't happen. That's similar to when a transaction is successful.
This is part of the code relevant to my app.