# Virtual Store's Payment Page
The merchant's payment page must contain the Carat Portal's script. Below are the URL's for download:
**URL for Production environment:**
https://
https://
& `esitef-cardexpiryyear` | Card expiry month and year, in `MM` and `YY` format, respectively. These fields can be sent instead of `esitef-cardexpirydate`. If all these fields are sent at the same time, the split date (`esitef-cardexpirymonth` and `esitef-cardexpiryyear`) will have priority. | = 2 N | YES |
| `esitef-cardsecuritycode` | Card security code. | < 5 N | YES |
| `esitef-cardholder` | Card holder name.
`pt` - Portuguese
`en` - English
`es` - Spanish
If the locale is not sent, `pt` will be used. | = 2 A | NO |
| `isCardSecurityCode`
`Optional` | Defines if the card security code will be validated as a mandatory or optional field. Send `true` if it's an optional field. If this field is not sent, the value `false` will be used (mandatory security code). | < 5 T/F | NO |
| `onSuccess` | Callback function the will be called after a successful payment on Carat Portal. This function receives as argument the payment response described in [Success and failure callbacks response.](#success-and-failure-callbacks-response) | F | YES |
| `onFailure` | Callback function the will be called after an unsuccessful payment on Carat Portal. This function receives as argument the payment response described in [Success and failure callbacks response.](#success-and-failure-callbacks-response) | F | YES |
| `onInvalid` | Callback function that will be called after a JavaScript validation error. This function receives as argument the error list described in [Validation error callback response](#validation-error-callback-response) | F | YES |
## Success and failure callbacks response
The `onSuccess` and `onFailure` callback functions receive as argument an object containing information related to the payment. Below are the descriptions of these fields:
| Parameter | Description | Format |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------: |
| `code` | Carat Portal response code. Any code different from `0` (zero) means failure. For further information, refer to the [Response codes.](codigos-da-api#response-codes) | < 4 N |
| `message` | Carat Portal response message. | < 500 AN |
| **payment** |
| `authorizer_code` | Authorizer response code. | < 10 AN |
| `authorizer_message` | Authorizer response message. | < 500 AN |
| `status` | Status of the payment transaction on Carat Portal. | = 3 AN |
| `nit` | Identifier of the payment transaction on Carat Portal. | = 64 AN |
| `order_id` | Order code sent by the merchant on the creation of the transaction. | < 40 AN |
| `customer_receipt` | Customer's receipt. | < 4000 AN |
| `authorizer_id` | Code of the authorizer used on the transaction. | < 4 N |
## Validation error callback response
The `onInvalid` callback function receives as argument a list of error objects, containing the fields below:
| Parameter | Description | Format |
| --------- | --------------------------- | :-------------: |
| `field` | Name of the field in error. | < 30 AN |
| `cause` | Error message. | < 100 AN |
## Example
Below is an example of a page integrated with Carat Portal's JavaScript payment:
To use this example, don't forget to define the variable `{{url}}` to the value
**