Stax.js Validation
If the validate flag is passed into the tokenize or pay methods, StaxJs will attempt to validate the details with the following rules:
| Variable | Required | Description |
|---|---|---|
| method | Yes | Must be _bank _or card. |
| firstname | Yes* | *Required if customer_id is not passed into details. 50 character max. |
| lastname | Yes* | *Required if customer_id is not passed into details. 50 character max. |
| phone | Yes* | *Required if customer_id is not passed into details. Must be at least 10 characters. |
| No | Must be a valid email. | |
| address_1 | Yes* | *Required if customer_id is not passed into details. 255 character max. |
| address_2 | No | 255 characters max. |
| address_city | Yes* | *Required if customer_id is not passed into details. 55 character max. |
| address_state | Yes* | *Required if customer_id is not passed into details. Max of 2 characters (e.g. FL) |
| card_exp | Yes* | *Required if the method is card. |
| bank_account | Yes* | *Required if the method is bank. |
| bank_routing | Yes* | *Required if the method is bank. |
| bank_type | Yes* | *Required if the method is bank. Must be checking or savings. |
| bank_holder_type | Yes* | :*Required if the method is bank. Must be personal or business. |
| total | No | Must be a number |
| customer_id | No | Must be a string that matches a valid customer_id belonging to your merchant account. If supplied, a new customer will not be created or matched based on values. Instead, the supplied ID will be assigned to this new payment method (and transaction if using .pay()) |
Updated 4 days ago
What’s Next
