updatePrice

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: void

  • Description: No return value

Important Notes

  • Only updates the internal price value

  • Does NOT automatically update button text

  • You must manually update button.button.textContent if you want to show the new price

  • Next 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?