updatePrice
updatePrice(price)
updatePrice(price)Updates the payment amount without re-rendering the button.
Syntax
button.updatePrice(price)Parameters
Parameter
Type
Required
Description
price
number
Yes
New payment amount in USD
Returns
Type:
voidDescription: No return value
Important Notes
Only updates the internal price value
Does NOT automatically update button text
You must manually update
button.button.textContentif you want to show the new priceNext checkout will use the updated price
Usage
Basic Price Update:
const button = new ButtonDynamicPrice({
price: 50.00,
apiKey: "your_api_key",
title: "Buy Now - $50.00"
});
// Update price
button.updatePrice(75.00);
button.button.textContent = "Buy Now - $75.00";Quantity Selector Example:
Dynamic Pricing Example:
Subscription Plan Selector:
Last updated
Was this helpful?