Collect payment method information
Before you can use payment.js to create a payment method, you must collect the purchaser's payment method details through a form or page in your checkout user interface. The required information varies by payment method type. Currently, only credit cards are supported. You must collect the information listed in the following tables and map the information to the indicated fields, which you will use during payment method creation.
AppDirect does not perform field validation on the collected information (phone numbers, credit card numbers, and so on); you must incorporate such validation into your front end.
All of the fields in the following tables are required.
Required fields for credit cards
Credit card information
Field | Description | Example |
---|---|---|
cardHolderName | First and last name | John Doe |
number | Card number | 4111-1111-1111-1111 |
securityCode | Three to four-digit card security code | 321 |
expirationMonth | Card expiration month (number) | 6 |
expirationYear | Card expiration year (number) | 2025 |
Billing address information
Field | Description | Example |
---|---|---|
city | City or town | Boston |
country | Country code in ISO-3166 format | US |
state | State, province, or region | MA |
street1 | First line of a street address | 123 Main Street |
zip | ZIP or postal code | 02125 |
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!