Stax.js General Information / FAQ

Throttling

Stax.js routes are different. When you call the .pay() or the .tokenize() method, Stax.js hits the Stax API with the defined Webpayments token. This resource is throttled to 10 requests per minute per IP.

Status Column

The .pay() returns an Invoice object with either PAID or ATTEMPTED status, depending on whether the charge was successful. Please learn more about statuses in the Invoice API section.

Automated Receipt

This method will automatically send a receipt to the email provided (which is the customer’s email). This receipt will also show whether the charge was a success or a fail.

Customer Matching

When you use .tokenize() OR .pay() the API will attempt to find matching customer information according to these groups of demographics:

customer_id
email company, address_1, address_city firstname, phone firstname, lastname, address_1, address_zip lastname, phone

A match is found when each field exists is passed and an exact match is found. For example: Bob Smith at 123 North Way 32801 would not match to Bobby Smith at 123 Noth. Way 32801 If a match is found based on the provided demographics, the existing customer will be linked to the new payment method and transaction. Any additional demographics will not be stored.

For example, if a match is found for [email protected] but you also passed data like Address Line 1 and the existing Bob Smith didn’t have an address, then the new address will not be saved.

If the matched customer has an email, that email address will receive the receipt.

To disable matching pass match_customer: false (as boolean false) with the rest of the fields when calling .pay()or.tokenize()`

Using an existing customer_id

You are welcome to create a customer first using POST customer and then use the resulting customer_id in your Stax.js integration.

Both .pay() and .tokenize() accept a customer id. When this value is passed, the customer will not be created, but instead, the existing customer with the specified ID will be used for the new payment method (and invoice, payment if using.pay()_)

This also allows you to implement your own customer matching and then specify the exact ID.

Use a Billing Address

The address fields available in Stax.js are stored on the customer and not sent to the payment gateway. There is no way to add a billing address with Stax.js alone. However, once you have the payment_method_id you can do a PUT payment-method call to add a billing address using your API key.

Billing addresses are sent along with the payment if supplied.