Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onCancle callback bug #17

Closed
GideonAgboba opened this issue May 6, 2020 · 2 comments · Fixed by #18
Closed

onCancle callback bug #17

GideonAgboba opened this issue May 6, 2020 · 2 comments · Fixed by #18

Comments

@GideonAgboba
Copy link

GideonAgboba commented May 6, 2020

react-native-paystack-webview does not run onSuccess function after successful transaction...

please observe the code below...
<PaystackWebView
showPayButton={false}
currency="NGN"
channels="card"
paystackKey="pk_test_****************************"
amount={amount}
billingEmail={email}
billingMobile={phone}
billingName={fullname}
ActivityIndicatorColor="green"
onSuccess={(tranRef) => {
// do something...
console.log('transaction ref', tranRef);
}}
onCancel={(res) => {
// show a message (issue here)
}}
autoStart={false}
ref={childRef}
/>
Note: this code inits the popup window...
i don't know what am doing wrong here. But if the payment is successful or not only the onCancel function runs...

WhatsApp Image 2020-05-02 at 2 39 58 AM
WhatsApp Image 2020-05-02 at 2 39 58 AM (1)
WhatsApp Image 2020-05-02 at 2 39 58 AM (2)
WhatsApp Image 2020-05-02 at 2 39 58 AM (3)

@dihweng
Copy link

dihweng commented May 6, 2020

Hello
I'm also experiencing the same issues, when ever i make a request it shows Payment Successful but after that the onCancel is called instead of onSuccess

onCancel={() => {console.log('cancelled')}}

version of react-native-webview: "8.1.2",

@samie820
Copy link
Contributor

samie820 commented May 6, 2020

@dihweng I am not quite sure why that is the case for you, but I submitted a PR that exposes a handleWebViewMessage method, you can use that to see the raw event being sent from the webView. Plus, the main Paystack library that is being used does not expose an onError handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants