The Checkout is quite flexible and supports numerous configuration, pre-fill, and pricing options. These can be leveraged by passing a CheckoutOptions object to the Checkout.
To override prices in the checkout you can use the PriceOverrides
property in the CheckoutOptions
class. You’ll need to supply an auth hash, this is a MD5 hash of the new product price concatenated with the ‘Checkout Secret Key’ from your dashboard for that product
// Create new price overrides for your product
PriceOverride priceUSD = new PriceOverride()
{
Price = "7.99",
Currency = "USD",
Authorization = ""
};
PriceOverride priceGBP = new PriceOverride()
{
Price = "6.99",
Currency = "GBP",
Authorization = ""
};
// Create a new CheckoutOptions instance and add your price overrides
CheckoutOptions options = new CheckoutOptions();
options.PriceOverrides.AddPrice(priceUSD);
options.PriceOverrides.AddPrice(priceGBP);
// Pass the CheckoutOptions object when you open the CheckoutWindow
Paddle.Instance.ShowCheckoutWindowForProduct(product, options);
You can also pre-fill certain checkout fields such as the Email and the PostCode by setting their appropriate properties in the CheckoutOptions
object.
// Create a new CheckoutOptions instance and set the properties you want to pre-fill
CheckoutOptions options = new CheckoutOptions();
options.Email = "example@email.com";
options.Country = "us";
options.PostCode = "SE1";
options.Coupon = "My-coupon";
// Pass the CheckoutOptions object when you open the CheckoutWindow
Paddle.Instance.ShowCheckoutWindowForProduct(product, options);
If you need pass additional Custom Checkout parameters you can also use the CheckoutOptions.AddCheckoutParameters()
method.
// Create a new CheckoutOptions instance and add the custom parameters you need
CheckoutOptions options = new CheckoutOptions();
options.AddCheckoutParameters("custom_message", "A short message displayed below the product name on the checkout.");
// Pass the CheckoutOptions object when you open the CheckoutWindow
Paddle.Instance.ShowCheckoutWindowForProduct(product, options);