Volt's JavaScript library
This is a reference guide to the objects defined in https://js.volt.io/v1
library for Embedded Checkout. Please see our integration guide and details on how to tailor the checkout to your requirements.
The Volt object
The Volt object is the entry point to use Volt client-side JavaScript library.
Parameters
Name | Type / Description |
---|---|
mode required |
string"sandbox" | "production" |
const volt = new window.Volt({ "production" }); // Setting Volt to production mode
Payment Container object
Payment Container is required to create a Volt payment. The Container object groups and manages a group of elements.
Parameters
Name | Type / Description |
---|---|
payment required |
PaymentResponse Full response from payment creation endpoint |
language |
string two-letter language code |
country |
string two-letter country code |
theme |
object all parameters are optional |
Methods
setLanguage(languageCode: string) void |
This method can be used to update the language after drop-in initialisation |
setCountry(countryCode: string) void |
This method can be used to update the country after drop-in initialisation |
createPayment(paymentComponentOptions: object) void |
This method creates the payment component object.
|
createQR(qrOptions: object) void |
This method creates the QR code object.
|
createTerms() void |
Events
languageChange |
Triggered when Drop-in language gets changed
|
countryChange |
Triggered when Drop-in country gets changed
|
error |
Triggered when any error occurs
|
completed |
Triggered when the payment is completed (AU only) event: {} |
failed |
Triggered when the payment is failed (AU only) event: {} |
For Australian-specific integrations, additional events completed
and failed
are emitted. These events come with an empty payload and can be utilized like other supported events.
Payment Component
The Payment Component is an iFrame-based component, displaying:
- The UI that allows users to select a bank and provide additional bank details
- Including an “Express payment” toggle which allows a faster checkout experience for returning users by remembering their payment data
- Pay button (optional)
- Terms statement (optional)
Parameters
autoHeight |
boolean default: true |
displayPayButton |
boolean default: true |
displayQRCode |
boolean default: true |
Methods
mount(el) void |
Mount the component in your DOM tree at the given location. Note that “p” elements are not accepted – the suggested target element is a DIV with an id.
Arguments:
Example: paymentComponent.mount(“#volt-payment-component”); |
Events
change |
Triggered when the user’s input is changed; complete flag indicates the user data completeness. It should be used to control the external pay button state:
|
ready |
Triggered when the Component is fully rendered and can accept user-input
|
redirect |
Triggered when the user is redirected (bank redirection), the drop-in will handle the redirection
|
heightChange |
Triggered when the content of an iFrame changes size
|
- On this page
- The Volt object
- Payment Container object
- Payment Component