render
render()
render()Renders the payment button and returns the DOM element.
Syntax
button.render()Returns
Type:
HTMLButtonElementDescription: The button DOM element ready to be inserted into the page
Usage
Plain JavaScript:
const button = new ButtonDynamicPrice({
price: 49.99,
apiKey: "your_api_key"
});
// Get the button element
const buttonElement = button.render();
// Append to page
document.getElementById('payment-container').appendChild(buttonElement);React:
Last updated
Was this helpful?