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:

VariableRequiredDescription
methodYesMust be _bank _or card.
firstnameYes**Required if customer_id is not passed into details. 50 character max.
lastnameYes**Required if customer_id is not passed into details. 50 character max.
phoneYes**Required if customer_id is not passed into details. Must be at least 10 characters.
emailNoMust be a valid email.
address_1Yes**Required if customer_id is not passed into details. 255 character max.
address_2No255 characters max.
address_cityYes**Required if customer_id is not passed into details. 55 character max.
address_stateYes**Required if customer_id is not passed into details. Max of 2 characters (e.g. FL)
card_expYes**Required if the method is card.
bank_accountYes**Required if the method is bank.
bank_routingYes**Required if the method is bank.
bank_typeYes**Required if the method is bank. Must be checking or savings.
bank_holder_typeYes*:*Required if the method is bank. Must be personal or business.
totalNoMust be a number
customer_idNoMust 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())


What’s Next