Expected intent=tokenize to be passed to SDK, but got intent=capture
See original GitHub issueGeneral information
- SDK version: 3.69.0
- Environment: Sandbox
- Browser and OS: Google Chrome | 86.0.4240.198 (Official Build) (x86_64) on MacOS 11.0.1
Issue description
We are trying to move to the latest braintree-web SDK and we encounter some questions regarding error messages with Paypal Checkout. We are using a billing agreement (with saving payment method to Braintree user) and with the received token we authorize payment on the server-side.
This is our old code for braintree-web@2.32.1
braintree.setup(braintreeClient, 'custom', {
paypal: {
singleUse: false,
currency: 'USD',
locale: 'en_us',
enableShippingAddress: true,
headless: true
},
dataCollector: {
kount: { environment },
paypal: true
},
onPaymentMethodReceived: (paymentMethod) => {
this.payWithNewPayPal(paymentMethod);
},
onReady: (payPalIntegration) => {
setPayPalIntegration(payPalIntegration);
}
});
New code with latest braintree-web version typed in React
const [isPaypalLoaded, setIsPaypalLoaded] = useState(false);
useEffect(() => {
if (clientInstance !== null) {
PaypalCheckout.create({
client: clientInstance
})
.then((paypalCheckoutInstance) => {
paypalCheckoutInstance.loadPayPalSDK({
vault: true
})
.then(() => {
window.PayPalButton = window.paypal.Buttons.driver('react', {
React,
ReactDOM
});
setIsPaypalLoaded(true);
});
});
}, [clientInstance]);
if (!isPaypalLoaded) {
return null;
}
const { PayPalButton } = window;
return (
<PayPalButton
style={PAYPAL_BUTTON_STYLE}
fundingSource={window.paypal.FUNDING.PAYPAL}
createBillingAgreement={() => (
paypalCheckoutInstance.createPayment({
flow: 'vault',
intent: 'authorize',
enableShippingAddress: true,
currency: 'USD'
})
)}
onApprove={(data) => (
paypalCheckoutInstance.tokenizePayment(data)
.then((payload) => {
onTokenize(payload);
})
)}
onCancel={handleCancel}
onError={handleError}
onInit={handleInit}
/>
);
And with that code I was getting warning for wrong SDK intent setting I tried to find any documentation on intent=tokenize, and to google that, but nothing. Can someone help with this error? Thanks, and sorry for the long post.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Errors: Use intent=capture to use client-side capture [Paypal ...
I am using the PayPal javascript SDK to create a Paypal subscription button for my web page, the problem resides when testing the...
Read more >How can I solve "Error: (Integration issue) "Expected intent ...
AUTH: The payment is first authorized; capture can occur immediately or separately, at a later time. This error happens because PayPal is set...
Read more >PayPalCheckout - Documentation - Braintree Open Source
If sale is used, it will be converted to capture for the PayPal SDK. If the vault: true param is used, tokenize will...
Read more >Expected intent=subscription to be passed to SDK
Hi,. I am using setup instructions from this link here: here. It pretty much works except I am getting following warning in chrome:....
Read more >JavaScript SDK script configuration - PayPal Developer
You can configure and customize your integration by passing query ... intent, capture , authorize , subscription , tokenize, capture ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the info. Just so you know, we don’t maintain those type definitions. The next major version of the Braintree web SDK will be written in Typescript, which will (eventually) make using those type definitions unnecessary.
No ETA at the moment, though we are actively working on it.