popekabu / pay_with_paystack

MIT License
9 stars 21 forks source link

"Cancel Payment" Button Not Working #5

Closed Machele-codez closed 1 year ago

Machele-codez commented 1 year ago

When I tap on the cancel payment button on the Paystack View, it doesn't close it.

https://user-images.githubusercontent.com/57562100/203517703-642acfa7-27c5-4ec7-b2f5-1215e673aa3c.mp4

popekabu commented 1 year ago

Use the close button at the app bar instead. I will work an implementation for that in future releases.

On Wed, Nov 23, 2022 at 9:57 AM Machele Alhassan @.***> wrote:

When I tap on the cancel payment button on the Paystack View, it doesn't close it.

https://user-images.githubusercontent.com/57562100/203517703-642acfa7-27c5-4ec7-b2f5-1215e673aa3c.mp4

— Reply to this email directly, view it on GitHub https://github.com/popekabu/pay_with_paystack/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMACNMU4SJKLB3W647VDSTWJXTCJANCNFSM6AAAAAASIYQUEU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Machele-codez commented 1 year ago

Use the close button at the app bar instead. I will work an implementation for that in future releases. On Wed, Nov 23, 2022 at 9:57 AM Machele Alhassan @.> wrote: When I tap on the cancel payment button on the Paystack View, it doesn't close it. https://user-images.githubusercontent.com/57562100/203517703-642acfa7-27c5-4ec7-b2f5-1215e673aa3c.mp4 — Reply to this email directly, view it on GitHub <#5>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMACNMU4SJKLB3W647VDSTWJXTCJANCNFSM6AAAAAASIYQUEU . You are receiving this because you are subscribed to this thread.Message ID: @.>

Alright, I found out that it doesn't work due to lack of WebView support for Javascript's onClose event. Find out more on StackOverflow

pat64j commented 6 months ago

There is a work around for this issue. Users of the plugin can pass "cancel_action" field in the metadata object which takes any random url. if cancel_action field is provided in the metadata, you can listen in to the "onNavigationRequest" property of flutter webviews "NavigationDelegate". If the url matches what was provided in "cancel_action", trigger Cancel callback method.

This is possible because that "Cancel Payment" button redirects to the cancel_action url if available.

I'm on a tight schedule currently. I may send a PR when I get the chance.

Reference: https://paystack.com/docs/payments/metadata/#cancel-action

Kind Regards, Patrick.

popekabu commented 6 months ago

I have done that my code. Kindly have a look. Also looking forward to your PR. Thanks & Regards

On Fri, 8 Mar 2024 at 12:43 PM, Patrick Adonteng @.***> wrote:

There is a work around for this issue. Users of the plugin can pass "cancel_action" field in the metadata object which takes any random url. if cancel_action field is provided in the metadata, you can listen in to the "onNavigationRequest" property of flutter webviews " NavigationDelegate". If the url matches what was provided in "cancel_action", trigger Cancel callback method.

This is possible because that "Cancel Payment" button redirects to the cancel_action url if available.

I'm on a tight schedule currently. I may send a PR when I get the chance.

Reference: https://paystack.com/docs/payments/metadata/#cancel-action http://url

Kind Regards, Patrick.

— Reply to this email directly, view it on GitHub https://github.com/popekabu/pay_with_paystack/issues/5#issuecomment-1985628742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMACNMPOOJYO6GYLBRMMUDYXGW7JAVCNFSM6AAAAAASIYQUEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVGYZDQNZUGI . You are receiving this because you modified the open/close state.Message ID: @.***>