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

Web View is not open when call "requestOneTimePayment" #91

Open
AdnanLatif opened this issue Apr 26, 2021 · 3 comments
Open

Web View is not open when call "requestOneTimePayment" #91

AdnanLatif opened this issue Apr 26, 2021 · 3 comments

Comments

@AdnanLatif
Copy link

Hi,

I am facing a strange issue. In standalone test app Web View is automatically opened even without importing. But in my current app it falls into function but in function it's do nothing.

const paypal = async () => {
console.log('here in paypal function------------------------');
// For one time payments
const {
nonce,
payerId,
email,
firstName,
lastName,
phone,
} = await requestOneTimePayment(
'eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZbkpoYVc1MGNtVmxaMkYwWlhkaGVTNWpiMjBpZlEuZXlKbGVIQWlPakUyTVRrMU5EVTRPREVzSW1wMGFTSTZJbU0wWkRFNFltTXdMVEZpTlRJdE5HWTVOaTFpT0dOaUxUZ3pPV00xWXpKak5UazVPU0lzSW5OMVlpSTZJbkE0ZDJkM2JuSjNlbmN5WkhseWNEZ2lMQ0pwYzNNaU9pSm9kSFJ3Y3pvdkwyRndhUzV6WVc1a1ltOTRMbUp5WVdsdWRISmxaV2RoZEdWM1lYa3VZMjl0SWl3aWJXVnlZMmhoYm5RaU9uc2ljSFZpYkdsalgybGtJam9pY0RoM1ozZHVjbmQ2ZHpKa2VYSndPQ0lzSW5abGNtbG1lVjlqWVhKa1gySjVYMlJsWm1GMWJIUWlPbVpoYkhObGZTd2ljbWxuYUhSeklqcGJJbTFoYm1GblpWOTJZWFZzZENKZExDSnp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Hl0aWNzLXNhbmQuc2FuZGJveC5icmFpbnRyZWUtYXBpLmNvbS9wOHdnd25yd3p3MmR5cnA4In0sInBheXBhbEVuYWJsZWQiOnRydWUsInBheXBhbCI6eyJiaWxsaW5nQWdyZWVtZW50c0VuYWJsZWQiOnRydWUsImVudmlyb25tZW50Tm9OZXR3b3JrIjp0cnVlLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYWxsb3dIdHRwIjp0cnVlLCJkaXNwbGF5TmFtZSI6ImVuaWdtYXRpeCIsImNsaWVudElkIjpudWxsLCJwcml2YWN5VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3BwIiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS90b3MiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJicmFpbnRyZWVDbGllbnRJZCI6Im1hc3RlcmNsaWVudDMiLCJtZXJjaGFudEFjY291bnRJZCI6ImVuaWdtYXRpeCIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9fQ==',
{
amount: '5', // required
// any PayPal supported currency (see here: https://developer.paypal.com/docs/integration/direct/rest/currency-codes/#paypal-account-payments)
currency: 'USD',
// any PayPal supported locale (see here: https://braintree.github.io/braintree_ios/Classes/BTPayPalRequest.html#/c:objc(cs)BTPayPalRequest(py)localeCode)
localeCode: 'en_US',
shippingAddressRequired: false,
userAction: 'commit', // display 'Pay Now' on the PayPal review page
// one of 'authorize', 'sale', 'order'. defaults to 'authorize'. see details here: https://developer.paypal.com/docs/api/payments/v1/#payment-create-request-body
intent: 'authorize',
},
).catch(error => console.log(error));
console.log('nonce:----', nonce);
console.log('payerID:-----', payerId);
};

@nzankich
Copy link
Contributor

@AdnanLatif sorry for the slow reply. A few things here

  1. your token looks incorrect. I have some instructions in the readme how to find this token
  2. Not sure which key you have here but it looks private. I would edit the issue here not to expose it
  3. do you get any errors back in the catch?
  4. it would also be a good idea to check out the example app and see if that works for you

@nzankich
Copy link
Contributor

my token only has one = at the end btw

@AdnanLatif
Copy link
Author

@AdnanLatif sorry for the slow reply. A few things here

  1. your token looks incorrect. I have some instructions in the readme how to find this token
  2. Not sure which key you have here but it looks private. I would edit the issue here not to expose it
  3. do you get any errors back in the catch?
  4. it would also be a good idea to check out the example app and see if that works for you

I got this token from braintree and nothing in catch block. It will work fine in standalone app but integrate with existing app it do nothing.

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

2 participants