SDK Documentation
Bond card management SDK details.
Changelog
04/01/2021 - Added method showMultiple
04/16/2021 - Added new property hideValue
to method field
Classes
BondCards
This represents the BondCards SDKSDK - A collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger, and sometimes a software framework.. It allows developers to make all calls to the APIs that securely store PCI data with a single function.
Typedefs
FieldType
—StringFieldParams
—ObjectsuccessCallback
—FunctionerrorCallback
—Function
BondCards
Kind: global class
- new BondCards
- bondCards.show
- bondCards.showMultiple
- bondCards.copy
- bondCards.field
- bonCards.submit
- bondCards.reset
new BondCards
new BondCards([live])
Create a BondCards instance.
Param | Type | Default | Description |
---|---|---|---|
| boolean | True | Set to "True" to work with live data. "False" for sandbox data |
bondCards.show
bondCards.show(cardId, identity, authorization, field, [htmlWrapper], htmlSelector, [css]) ⇒ <code>Promise</code>
Display appropriate card data.
Kind: instance method of BondCards
Returns: Promise
—Returns a Promise that, when fulfilled, will either return an iFrame with the appropriate data or an error.
Param | Type | Default | Description |
---|---|---|---|
| string | Unique ID used to identify a specific card | |
| string | Temporary identity token allowing the call | |
| string | Temporary Authorization token | |
|
| Field to get/show | |
| string | "text" | Expected type of response data. 'image' is wrapped in an HTML tag. 'text' is inserted into an element inside the iframe |
| string | Selector for the field/element where the iFrame will be placed | |
| object | Object of the CSS rules to apply to the response |
bondCards.showMultiple
bondCards.showMultiple(cardId, identity, authorization, fields) ⇒ <code>Promise</code>
Display appropriate card data.
Kind: instance method of BondCards
Returns: Promise
—Returns a Promise that, when fulfilled, will either return list of iFrames with the appropriate data or an error.
Parameter | Description |
---|---|
| Unique ID used to identify a specific card |
| Temporary identity token that allows the call |
| Temporary Authorization token |
| Object containing the requested fields |
bondCards.copy
bondCards.copy(iframe, htmlSelector, [css], [text], [callback]) ⇒ <code>Promise</code>
Copy card data (one of number, expiry, cvv).
Kind: instance method of BondCards
Returns: Promise
—Returns a Promise that, when fulfilled, will either return an iFrame with the appropriate data or an error.
Param | Type | Default | Description |
---|---|---|---|
| object | Iframe object returned from show method | |
| string | Selector for the field/element where the iframe will be placed | |
| object | {} | An object of CSS rules to apply to the response |
| string | "Copy" | Text of button |
| function | function() {} | Function to call when copy handler called |
bondCards.field
bondCards.field(selector, type, [css], [placeholder], [successColor], [errorColor], [color], [lineHeight], [fontSize], [fontFamily], [disabled], [readOnly], [autoFocus]) ⇒ <code>Promise</code>
Initialize a field in a form to submit for card manipulation.
Kind: instance method of BondCards
Returns: Promise
—Returns a Promise that, when fulfilled, will either initialize the field or return an error.
Param | Type | Default | Description | Version |
---|---|---|---|---|
| string | CSS selector that points to the element where the field will be added | ||
| 'current_pin' | 'new_pin' | 'confirm_pin' | Type of the field targeted | ||
| object | {} | Object of CSS rules to apply to the field | |
| string | Text to display when the field is empty | ||
| string | Text color when the field is valid | ||
| string | Text color when the field is invalid | ||
| string | Text color | ||
| string | Line height value | ||
| string | Size of text | ||
| string | Font family used in the text | ||
| 'disabled' | Specifies that the input field is disabled | ||
| 'readonly' | Specifies that the input field is read only | ||
| string | Specifies that the input field should automatically be in focus when the page loads | ||
| boolean | true | Specifies that the input field should be masked with **** | 1.6.0 and above |
bondCards.submit
bondCards.submit(cardId, identity, authorization, currentPin, newPin, confirmPin, callback, callback) ⇒ <code>Promise</code>
Show appropriate card data.
Kind: instance method of BondCards
Returns: Promise
—Returns a Promise that, when fulfilled, will either return an iFrame with the appropriate data or an error.
Param | Type | Description |
---|---|---|
| string | Unique ID used to identify a specific card |
| string | Temporary identity token allowing the call |
| string | Temporary Authorization token |
| string | Current pin number |
| string | New pin number |
| string | Repeated new pin number |
| Function that will be executed when the HTTPRequest finishes successfully | |
| Function Error handling callback. Triggered if one of the fields has an invalid value on submission. By default, pushes the error messages to the console |
bondCards.reset()
Reset the form or a field.
Kind: Instance method of BondCards
FieldType : String
String
Kind: global typedef
Value: number
| cvv
| expiry
FieldParams : Object
Object
Kind: global typedef
Param | Type | Description |
---|---|---|
| string | "text" |
| string | |
| object | {} |
successCallback : function
function
Kind: global typedef
| string | HTTP status code of HTTPRequest |
---|---|---|
| object | Data object of the response |
errorCallback : function
function
Kind: global typedef
Param | Type | Description |
---|---|---|
| object | Object of the error messages |
Updated about 1 month ago