Closed ShridharCodewave closed 5 years ago
hello. are you using babel? if you're not, you can try and rewrite the call to requestOneTimePayment as follows
requestOneTimePayment(
clientToken,
{
amount: '500', // required
// any PayPal supported currency (see here: https://developer.paypal.com/docs/integration/direct/rest/currency-codes/#paypal-account-payments)
currency: 'INR',
// any PayPal supported locale (see here: https://braintree.github.io/braintree_ios/Classes/BTPayPalRequest.html#/c:objc(cs)BTPayPalRequest(py)localeCode)
localeCode: 'zh_XC',
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',
}
).then(function(response) {
console.log('received', response);
}).catch(function(error) {Alert.alert(error)})
regardless though, braintree\lib\braintree\transaction.js
is not a file part of this library so I think you must have included some other library that's causing the error.
Yes I agree the transaction.js file is inside the braintree package which is required to generate the client token to initiate the payment.
I'll close this issue as I don't think it's related to the library code.
I followed the documentation and Iam trying to set a new payment but getting the above error and my code is as below
and the buttonPress() function is called on press of a button.
The error is located in braintree\lib\braintree\transaction.js