Using Lightbox for Payments

Add Stax Lightbox to your website so customers can make online payments without leaving your site.

Stax Lightbox (formerly known as Checkout) lets you customize your checkout flow and use Stax-hosted processing and storage of cardholder data. These features support your Payment Card Industry (PCI) compliance efforts; they do not guarantee compliance. Consult your legal team regarding your specific requirements.

⚠️

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 Stax Lightbox

Use the checkout code from Stax Pay to add Lightbox to your website. The code includes your web payments token, which identifies your business so payments reach the correct account. You need access to Stax Pay and permission to edit your website's HTML.

  1. In Stax Pay, open Apps > Checkout.
  2. Copy the checkout code, including your web payments token.
  3. Paste the code into your website's HTML.
  4. Open the page and select Pay with Stax. Confirm that Lightbox opens without leaving your website.
🚧

Match data-button to the container's id, prefixed with #. For example, the container id="pay_with_stax" requires data-button="#pay_with_stax".

Stax Lightbox Customization

Your business is unique. Lightbox makes it easy to select the best options, whether that means keeping the lightbox short and simple for your customers or including additional fields.

Optional: Configure Lightbox fields

You can add optional fields to customize the Lightbox payment.

Add a payment amount and billing address fields with the HTML below. Replace the illustrative token fact_test_123 with the data-webpaymentstoken value from Stax Pay > Apps > Checkout; the example token cannot process payments. The example also enables a confirmation message after a successful payment.


<!-- Replace the illustrative token below with the value from Stax Pay > Apps > Checkout. -->
<div id="pay_with_stax"></div>
<script
  id="stax_checkout_script"
  src="https://checkout.staxpayments.com/v1/checkout.min.js"
  data-webpaymentstoken="fact_test_123"
  data-button="#pay_with_stax"
  data-amount="100.00"
  data-billingInclude="true"
  data-displayConfirmation="true">
</script>

When you select Pay with Stax, Lightbox should open with a USD 100.00 payment amount and optional billing address fields. After a successful payment, it displays: “Payment Successful Your payment was approved. Please check your email for transaction details.”

If Lightbox does not open, verify that data-button matches the container's id and that you replaced the illustrative token with the value copied from Stax Pay. If the payment is not approved, do not treat it as successful; the confirmation described above applies only to successful payments. If you omit data-amount or set it to 0, the customer must enter the amount.

The following are acceptable parameters that can be added to the online checkout process:

ParameterDescription
data-amountThe amount due is in USD; do not include currency symbols or commas in the amount. If data-amount is omitted or is 0, the customer will be required to manually enter an amount.
data-nameCardholder name that can be prefilled.
data-billingIncludeIf true, users 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.
data-billingRequiredIf true, users will be required to fill in all billing fields. Note that data-billingInclude must be true to display the billing fields.
data-billingAddress1Billing address associated with the card.
data-billingCityThe city associated with the card.
data-billingStateTwo letter abbreviation for the state. Note that the state will be used to determine if surcharging, if applicable, can be applied.
data-billingZipZip code associated with the card.
data-billingEmailPrefilled email address. This is where a payment receipt will be sent.
data-expDateCard expiration date: MM/YY format required.
data-openOnLoadTrue or False. If true, Stax Lightbox will be loaded and displayed as soon as the JavaScript is executed instead of when the button is clicked. Stax recommends using the Pay with Stax button whenever possible.
data-displayConfirmationBoolean value that defaults to false. If set to true, it displays a confirmation modal after a successful transaction. Message displayed in the confirmation model:
Payment Successful Your payment was approved. Please check your email for transaction details.


Did this page help you?