We provide you with different JavaScript configurations depending on the payment type and transaction type. The value for the mode parameter depends on whether you want to take a payment, save payment details, or update saved payment details:Important: You can add only one set of Hosted Fields to a webpage.
payment
- You want to run a sale or to run a sale and tokenize the payment details within the same transaction.tokenization
- You want to save the customer's payment details to run a sale later, or you want to update payment details that the customer previously saved.<div class="card-container payroc-form"><label for="card-holder-name">Cardholder Name</label><div class="card-holder-name"></div><div class="card-holder-name-error error-message"></div><label for="card-number">Card Number</label><div class="card-number"></div><div class="card-number-error error-message"></div><div class="cols-2"><div class="col"><label for="card-expiry">Expires (MM/YY)</label><div class="card-expiry"></div><div class="card-expiry-error error-message"></div></div><div class="cvv-wrapper"><div class="col"><label for="card-cvv">CVV</label><div class="card-cvv"></div><div class="card-cvv-error error-message"></div></div></div></div><div class="card-submit submit-button"></div></div>
cardForm.on("submissionSuccess", ({ token, expiresAt }) => {});
Field | Description |
---|---|
token | Single-use token that represents the customer's payment details. |
expiresAt | Expiry date and time of the single-use token. |
{"token": "c96cb928e39c34bd05022cd821d2cbba2349f047ce0cef4f77cd2b5762be7608fb7c23e673bf014d58c64672928eb8256e38aa26911a22853143d22dd48ac9aa","expiresAt": "2024-05-18T23:17:34.844Z"}
cardForm.on("error", ({ type, field, message }) => {});