Cookie Consent by Free Privacy Policy Generator Update cookies preferences

Afterpay.js Glossary

Constants

<CONSTANT_NAME>Values
currencyAUD, CAD ,GBP, NZD, USD
localeEN_AU, EN_CA, EN_GB, EN_NZ, EN_US
logoTypeBADGE, LOCKUP
modalLinkStyleCIRCLED_INFO_ICON, LEARN_MORE_TEXT, MORE_INFO_TEXT, CIRCLED_QUESTION_ICON,
NONE
placementTypesPRICE_TABLE
sizeXS, SM, MD, LG
mobileViewLayoutFOUR_BY_ONE, TWO_BY_TWO
theme.badgeBLACK_ON_MINT, BLACK_ON_WHITE, MINT_ON_BLACK, WHITE_ON_BLACK
theme.lockupBLACK, WHITE, MINT
theme.modalWHITE
theme.priceTableBLACK, WHITE

📘

Using Afterpay Constants

Constants are exposed to the window via the Afterpay object Afterpay.<constant_name>.

See some examples below

console.log(Afterpay.locale.EN_US) //  "en_US" 
console.log(Afterpay.theme.lockup) //  "{"BLACK":"black","WHITE":"white","MINT":"mint"}"
console.log(Afterpay.theme.lockup.BLACK) //  "black"

Functions

NameDescription
createPlacementsAdds one or more placements to the page using the targetSelector attribute.
launchModalDynamically open the Clearpay Modal.
NameDescription
readyCustom Window Event dispatched when Afterpay.js is successfully initialized.
modalRenderCompleteCustom Window Event dispatched when the <afterpay-modal> finishes rendering.