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

Can't find variable: authorizationCode after payment is successed #8

Open
haolun1996 opened this issue Dec 28, 2018 · 1 comment
Open

Comments

@haolun1996
Copy link

the problem is like this, after my payment was successed then it prompt Can't find variable: authorizationCode in my console log and my app get forced to stop and closed. Any solution to solve this?
my successNotify method is same as in readme.md file

"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4",
"ipay88-sdk": "^1.0.2"

@haolun1996
Copy link
Author

haolun1996 commented Dec 31, 2018

I found out that 3 method onSuccess, onCanceled and onFailed called twice,so it will cause the data received twice,but the first received data got the authorizationCode but undefind on the second received.
Can it be change the componentWillMount to the componentDidMount, so that the DeviceEventEmitter will not added twice and received twice of the data.
FYI:If you ever need to render your app on the server (SSR/isomorphic/other buzzwords), componentWillMount will actually be called twice – once on the server, and again on the client – which is probably not what you want. Putting the data loading code in componentDidMount will ensure that data has been rendered once..(https://daveceddia.com/where-fetch-data-componentwillmount-vs-componentdidmount/)

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

No branches or pull requests

1 participant