braintree-web-drop-in
braintree-web-drop-in copied to clipboard
Initial configuration fails with [data-braintree-id="paypal-button"] does not exist
General information
- SDK/Library version: 1.27.0
- Environment: Sandbox
- Browser and OS: Chrome 89.0.4389.72
Issue description
Steps to reproduce
npm i braintree-web-drop-in
npm i @types/braintree-web-drop-in -D
import { create } from 'braintree-web-drop-in';
const container = document.body.querySelector('#dropin-container') as HTMLElement;
const button = document.body.querySelector('#paypal-button') as HTMLElement;
async function main() {
const dropin = await create({
authorization: 'my-authorization-from-backend-goes-here',
container,
paypal: {
flow: 'vault',
},
});
button.addEventListener('click', () => {
/* dropin.requestPaymentMethod(); */
});
}
main();
<div id="dropin-container"></div>
<button id="paypal-button">Purchase</button>
<script type="text/javascript" src="./main.ts"></script>
I am having the following error
Error: Document is ready and element #braintree--dropin__f17298d9-3646-4ede-8a49-c911e83ee72e [data-braintree-id="paypal-button"] does not exist
Do you have a staging site we can inspect?
Just pinging again about getting a staging site.
closing for inactivity. If you continue to encounter errors, please contact Support