Card binding SDK
This SDK collects users' card information. The boundCardToken parameter can be obtained through OpenAPI. Check it out.
Merchant website access example
- production
- sandbox
<script src="https://ramp.multiexc.com/js/frames.min.js"></script>
<script>
// nitialization
MultiexcFrames.init({
boundCardToken: "******",
});
// Calling card binding
MultiexcFrames.dispatch("submitCard");
</script>
<div id="multiexcFrame"></div>
<script src="https://ramptest.multiexc.com/js/frames.min.js"></script>
<script>
// nitialization
MultiexcFrames.init({
boundCardToken: "******",
});
// Calling card binding
MultiexcFrames.dispatch("submitCard");
</script>
<div id="multiexcFrame"></div>
SDK parameters
Functions
Method name | Description |
---|---|
init(object) | Initialization method for loading form MultiexcFrames.init(object) |
addEventHandler(event, handler) | Add a call method for specified trigger events. "event" refers to the name of a valid event, and "handler" refers to the callback handling. Example: MultiexcFrames.addEventHandler(Events.CARD_TOKENIZED, (event) => {}) |
removeEventHandler(event, handler) | This is used to remove events added via the addEventHandler method. "event" refers to the name of a valid event, and "handler" refers to a specified function to remove. Example: MultiexcFrames.removeEventHandler(Events.CARD_TOKENIZED, (event) => {}) |
removeAllEventHandlers(event) | Removes all listeners added to the specified event. "event" refers to the name of a valid event. Example: MultiexcFrames.removeAllEventHandlers(Events.CARD_TOKENIZED) |
dispatch(event, handler) | Manually triggers a specified event. "event" refers to a list of valid events, and "handle" represents a callback handling (optional). Example: MultiexcFrames.dispatch(Events.CARD_SUBMIT, (e) => {}) |
Init configuration
Configuration name | Description | Mandatory | Default value |
---|---|---|---|
boundCardToken | Card binding token | Y | none |
locale | Language | N | en View supported languages. |
getContainer | Node DOM inserted to iframe | N | () => document.querySelector("#multiexcFrame") |
fields | Form options | N | { phone: false, billState: false } |
addEventHandler Event
Event name | Javascript constant | Description |
---|---|---|
cardTokenizationValid | CARD_TOKENIZATION_VALID | Triggered upon completion of card binding token verification. It will return to isValid: true / false |
cardValidationChanged | CARD_VALIDATION_CHANGED | Triggered when the status of the card verification changes. It will return to isValid: true / false |
dispatch Event
Event name | Javascript constant | Description | Response |
---|---|---|---|
submitCard | CARD_SUBMIT | Method for card form submission | { tokenValid: true/false, status: true/false, cardId: "622***111" } |
resetForm | CARD_RESET_FORM | Method for clearing card form | undefined |
isCardValid | CARD_IS_VALID | Obtain the result of whether the card verification has been successful | { isValid: true / false } |
Fields Option
Name | Javascript constant | Description |
---|---|---|
phone | FIELD_PHONE | Cardholder's mobile number and area code |
billState | FIELD_BILL_STATE | Cardholder's State/Province of Residence If the bank card's issuing country is the United States or Canada, this field is mandatory. if the bank card's issuing country is any other country or region, this field is optional. |
Custom CSS
If you want to override the default style of Frames and customize the element's CSS, pass a style object to the init method.
Property name | Description |
---|---|
backgroundColor | The iframe element background color. |
input | The default input element style Accepts an object with color 、 backgroundColor 、fontSize 、 height 、padding 、rounded 、border |
label | The form lable element style Accepts an object with color 、 paddingBottom 、fontSize |
focus | Rules applied when the element is focused Accepts an object with color |
invalid | Rules applied when the element is invalid Accepts an object with color 、 padding 、fontSize |
placeholder | The input element placeholder style Accepts an object with color |
select | The default select element style Accepts an object with options 、backgroundColor options Accepts an object with activeBackgroundColor 、fontSize 、color 、height |
For example, an instance of Frames initialized with these values:
- javascript
MultiexcFrames.init({
boundCardToken: "YOUR-CARD-TOKEN",
style: {
backgroundColor: "#000000",
padding: "10px 5px",
input: {
color: "#e7d2c4",
backgroundColor: "#F8F6F9",
fontSize: "20px",
height: "80px",
padding: "10px 10px 10px 10px",
rounded: "20px",
border: "1px solid #e7d2c4",
},
label: {
color: "#e7d2c4",
fontSize: "14px",
paddingBottom: "15px",
},
focus: {
color: "#afd523",
},
invalid: {
color: "#9a1313",
fontSize: "20px",
padding: "10px 10px 10px 10px",
},
placeholder: {
color: "#ba8397",
},
select: {
backgroundColor: "#e7d2c4",
border: "1px solid #9a1313",
options: {
activeBackgroundColor: "#bcc397",
fontSize: "20px",
color: "#26bfd4",
height: "64px",
},
},
},
});