Skip to main content

Configuration Options

Checkout

HTML AttributeJS PropTypeRequiredDefaultDescription
assetassetstringyesn/aReference code for asset for the sale's amount
reference-idreferenceIdstringyesn/aExternal code created by merchant to reference the payment
contract-idcontractIdstringyesn/aletpay's contract_id to be used in this sale
amountamountnumberyesn/aTotal amount of the payment. Value must have a maximum of two decimal places and must not be less than BRL 0.75
payment-countrypaymentCountrystringyesBRCountry code in ISO 3166-2 for the payment
payment-currencypaymentCurrencystringyesBRLCurrency code in ISO-4217 for the payment

Payment

HTML AttributeJS PropTypeRequiredDefaultDescription
methodmethodstringyesn/aPayment Method. Valid options: CREDITCARD, DEBITCARD, PIX, BOLETO, PICPAY, OXXO, TIENDAS_Y_FARMACIAS, SPEI, PAYCASH, BANK_TRANSFER, PAGO_EFECTIVO, DEUNA, NEQUI, MACH.
card-installmentscardInstallmentsnumberno1Number of installments. Used if method is CREDITCARD.
soft-descriptorsoftDescriptorstringnon/aSoft descriptor to use at card transaction.
process-paymentprocessPaymentbooleannofalseAutomatically process the payment (CREDITCARD, DEBITCARD only).
delay-capturedelayCapturebooleannofalsePre-authorizes the payment for later capture (CREDITCARD, PICPAY only).
save-cardsaveCardbooleannotrueTokenizes card for future uses. Works only if processPayment = true, otherwise saveCard will always be true.
pix-directpixDirectbooleannofalsetrue will show the QR code for PIX payment without collecting payer data. Merchants can still send data to be linked to the transaction.
expiration-dateexpirationDateYYYY-MM-DDnofalseExpiration date for the payment created by this checkout session. If not provided, the system will assume 2 days from the current date. Supported formats: YYYY-MM-DD, YYYY-MM-DDTHH:mm:ss, YYYY-MM-DDTHH:mm:ss-03:00. If the time is not specified, the system will default to 23:59:59. The timezone will be UTC unless explicitly included in the string. The minimum allowed is 1 minute and the maximum is 10 days from the current date.
boleto-line1boletoLine1stringnon/aFirst instruction line for cashier and customer.
boleto-line2boletoLine2stringnon/aSecond instruction line for cashier and customer.
boleto-line3boletoLine3stringnon/aThird instruction line for cashier and customer.
notification-urlnotificationUrlstringnon/aWebhook URL for status updates on transactions associated with this. checkout session
support-textsupportTextstringnon/aFooter text in customer email for support contact (e.g., "Questions? Email [email protected]").
success-urlsuccessUrlstringnon/aThe URL where the customer is redirected after the payment has been successfully completed.
declined-urldeclinedUrlstringnon/aThe URL where the customer is redirected if the payment is declined by the payment processor.
error-urlerrorUrlstringnon/aThe URL where the customer is redirected when an unexpected error occurs during payment processing.
lightbox-use-3dslightboxUse3dsbooleannofalseEnables 3DS authentication if true.
lightbox-use-external-3dslightboxUseExternal3dsbooleannofalseEnables 3DS authentication with an external MPI if true.

Customer Details

HTML AttributeJS PropTypeRequiredDefaultDescription
address-additionaladdressAdditionalstringnon/aAdditional information for this address (e.g. department).
address-cityaddressCitystringnon/aBilling address city.
address-countryaddressCountrystringnon/aCountry code as ISO 3166-1 alpha-2 code.
address-localityaddressLocalitystringnon/aBilling address locality (e.g. neighborhood).
address-mainaddressMainstringnon/aMain information of the address (e.g. street or avenue).
address-numberaddressNumbernumbernon/aNumber for this address.
address-stateaddressStatestringnon/aBilling address state code.
address-zip-codeaddressZipCodestringnon/aBilling address zip code.
person-birthpersonBirthYYYY-MM-DDnon/aDate of birth.
person-emailpersonEmailstringnon/aPerson's email provided to the merchant.
person-first-namepersonFirstNamestringnon/aFirst name of this person. Min 3 characters for OXXO, SPEI, and TIENDAS_Y_FARMACIAS methods.
person-phonepersonPhonestringnon/aBilling address telephone.
person-phone-areapersonPhoneAreanumber (max 2 digits)non/aNumber of phone area code.
person-phone-countrypersonPhoneCountrynumber (max 2 digits)non/aNumber of country phone code.
person-surnamepersonSurnamestringnon/aSurname of this person.
person-tax-idpersonTaxIdstringnon/aUnique identifier for this person in country tax system (e.g. in Brazil: CPF).
disable-dobdisableDobbooleannotrueHides the date of birth.
lock-emaillockEmailbooleannofalsePrevents editing the person's email.

Widget options

HTML AttributeJS PropTypeRequiredDefaultDescription
button-labelbuttonLabelstringnoPay nowString that defines the widget button text.
button-colorbuttonColorvalid CSS colorno#3375C9Valid CSS color for the button.
button-text-colorbuttonTextColorvalid CSS colorno#FFFFFFValid CSS color for the button text.
HTML AttributeJS PropTypeRequiredDefaultDescription
lightbox-logo-urllightboxLogoUrlstringnoePag logoThe URL of your logo (180 x 30 pixels) beginning with https.
lightbox-primary-colorlightboxPrimaryColorvalid CSS colorno#303740Color applied to header.
lightbox-secondary-colorlightboxSecondaryColorvalid CSS colorno#314259Color applied to action buttons.
lightbox-accent-colorlightboxAccentColorvalid CSS colorno#027BE3Color applied to input focus and active stepper.
lightbox-positive-colorlightboxPositiveColorvalid CSS colorno#A5DC86Color applied to success icon and success messages.
lightbox-negative-colorlightboxNegativeColorvalid CSS colorno#F27474Color applied to error icon and error messages.
lightbox-info-colorlightboxInfoColorvalid CSS colorno#F8BB86Color applied to loader icon and info messages.
lightbox-warning-colorlightboxWarningColorvalid CSS colorno#F2C037Color applied to warning icon and warning messages.
lightbox-address-bar-colorlightboxAddressBarColorvalid CSS colorno#292F36Color applied to address bar when in mobile.
lightbox-disable-addresslightboxDisableAddressbooleannofalseIf true, disables the user's address collection step.
lightbox-partial-addresslightboxPartialAddressbooleannofalseIf true, requires only the user's zip code and number.

Events

Event NameWhen
checkout-successEvent emitted when successfully processed the payment.
checkout-readyEvent emitted when checkout modal is ready.
checkout-dismissedEvent emitted when checkout modal is closed.
checkout-errorEvent emitted when an error occurs with the payment.
boleto-copyEvent emitted when payment with boleto mode is successful and user has copied the barcode.
pix-copyEvent emitted when payment with pix mode is successful and user has copied the pix code.
oxxo-copyEvent emitted when payment with oxxo mode is successful and user has copied the oxxo barcode.
spei-copyEvent emitted when payment with spei mode is successful and user has copied the spei clabe.
tiendas-y-farmacias-copyEvent emitted when payment with tiendas y farmacias mode is successful and user has copied the tiendas y farmacias barcode.
paycash-copyEvent emitted when payment with paycash mode is successful and user has copied the paycash barcode.
3ds-successEvent emitted when successfully processed the 3DS payment.
3ds-unenrolledEvent emitted when card does not allow 3DS authentication.
3ds-failureEvent emitted when an error occurs with the 3DS payment.
3ds-errorEvent emitted when an error occurs during 3DS authentication process.

Instance Methods

MethodParameterReturnDescription
mountInHTMLElement / CSS selectorvoidMount the checkout in the DOM and display the pay button.
startnovoidMount the checkout in the DOM and launch the lightbox. With this method, the pay button will not get visible.
closeLightboxnovoidUsed for programmatically closing the lightbox.
onevent, functionvoidAdd an event handler. Acts the same way as .addEventListener from HTML.
offevent, functionvoidRemove an event handler. Acts the same way as .removeEventListener from HTML.

Element Methods

MethodParameterReturnDescription
closeLightboxnovoidUsed for programmatically closing the lightbox.

Handing Events

Using on(event, function) / off(event, function) methods

javascript
   const ePagCheckout = new EPagCheckout({...});
function handler(event) {
console.log(event.detail[0])
};
// to add a listener
ePagCheckout.on('checkout-success', handler);
// to remove a listener
ePagCheckout.off('checkout-success', handler);

Using addEventListener(type, listener) / removeEventListener(type, listener) methods

javascript
  const ePagCheckout = document.querySelector('letpay-checkout');
function handler(event) {
console.log(event.detail[0])
};
// to add a listener
ePagCheckout.addEventListener('checkout-success', handler);
// to remove a listener
ePagCheckout.removeEventListener('checkout-success', handler);

Closing the lightbox

javascript
  ePagCheckout.closeLightbox()