Lightbox
Add a hosted payment form to your website so customers can pay without leaving your site.
Lightbox provides a pre-built, customizable checkout form. You embed a short HTML snippet to display it on your website.
Digital Wallets and Surcharging are Not Supported.Lightbox is a quick integration tool that is prebuilt. Lightbox does not support digital wallets, Apple Pay or Google pay, and does not support the use of Surcharging.
If you are interesting in Digital Wallets or Surcharging, see DIgital Wallets or Surcharging.
Implementing Lightbox
Use the code snippet from Stax Checkout to add the payment form with your web payments token already included.
- Log into Stax Pay and open Apps > Stax Checkout.
- Launch the app and copy your unique HTML code snippet. Use the
data-webpaymentstokenvalue from this snippet rather than a sample token. - Embed the complete snippet on your website. Keep the generated settings for your initial setup; add optional fields only after you verify that the form opens.
- Open your website and click Pay with Stax. You should see the Lightbox payment form without leaving your site.
If you change the pay_now div's id, update data-button to match it, with a leading #. For example, id="pay_now" requires data-button="#pay_now". These are HTML identifiers, not Dashboard UI labels. If the form does not open, check that these values match and that you copied the complete snippet from Stax Pay > Apps > Stax Checkout.
Optional: Customize the Payment Form
Add fields such as Transaction Amount and Billing Address to collect additional payment details. Keep the default Pay with Stax button flow unless you need to open the form automatically.
You can add optional fields to customize the Checkout payment form.
| Parameter | Description | Type |
|---|---|---|
| data-amount | The amount due in USD; do not include currency symbols or commas. If data-amount is omitted or is 0, the customer will be required to manually enter an amount. | ? |
| data-name | Cardholder name that can be prefilled. | String |
| data-billingInclude | If true, the user will be requested but not required to enter their address, city, state, and zip code. If false or omitted, the billing fields will not be displayed. | Boolean |
| data-billingRequired | If true, the user must fill in all billing fields. Note that data-billingInclude must be true to display the billing fields. | Boolean |
| data-billingAddress1 | Billing address associated with the card. | String |
| data-billingCity | The city associated with the card. | String |
| data-billingState | 2-letter abbreviation for the state. Note that the state will be used to determine if surcharging, if applicable, can be applied. | Enum |
| data-billingZip | Zip code associated with the card. | String |
| data-billingEmail | Prefilled email address. This is where a payment receipt will be sent. | String |
| data-expDate | Card expiration date: MM/YY format required. | integer |
| data-openOnLoad | If true, Lightbox opens as soon as the JavaScript runs instead of waiting for the customer to click the button. Stax recommends using the Pay with Stax button whenever possible. | Boolean |
| data-displayConfirmation | Defaults to false. If true, it displays a confirmation modal after a successful transaction. The message displayed in the confirmation model is Payment Successful. Your payment was approved. Please check your email for transaction details. | Boolean |
Updated 4 days ago
