SDK for Javascript

Overview

The purpose of the Cardknox JS SDK is to allow the developer to easily implement payments into their web based system. One of the benefits that this has over BBPOS is that it does not require an application to be installed on each computer that uses a device and it can run on multiple different platforms. This SDK currently only supports PAX devices.

Sample Page

Find us on GitHub

Getting Started

Load our SDK.
​https://cdn.cardknox.com/sdk-js/1.0.2009.1101-alpha/cardknox-sdk.min.js <script src="https://cdn.cardknox.com/sdk-js/1.0.2009.1101-alpha/cardknox-sdk.min.js"></script>

SDK Functions

process
Process a transaction.
​
Arguments
Returns
Type
TransactionRequest
TransactionResponse
1
var Key = "xxxxxxxxxxxxxx";
2
var SoftwareName = "CardknoxJSSDK";
3
var SoftwareVersion = "1.0";
4
var Command = "cc:sale";
5
var Amount = "1";
6
var IpAddress = "1.1.1.1";
7
var IpPort = "10009";
8
process({
9
xKey: Key,
10
xSoftwareName: SoftwareName,
11
xSoftwareVersion: SoftwareVersion,
12
xCommand: Command,
13
xAmount: Amount,
14
settings: {
15
deviceIpAddress: IpAddress,
16
deviceIpPort: IpPort
17
}
18
}).then(function (response) {
19
console.log(response)
20
}).catch(function (error) {
21
console.error(error)
22
});
Copied!
getSignature
Prompts for signature on the device. This returns a base64 encoded PNG without the data header.
​
Args
Returns
Type
Settings
String
1
var ipAddress = "1.1.1.1";
2
var ipPort = "10009";
3
getSignature({
4
deviceIpAddress: ipAddress,
5
deviceIpPort: ipPort
6
}).then(function (response) {
7
console.log(response)
8
}).catch(function (error) {
9
console.error(error)
10
});
Copied!

Transaction Request Parameters

TransactionRequest
Name
Type
Description
Valid values
xCommand
String
Transaction type
Enum xCommand
xKey
String
Your Cardknox sale-only key
​
xSoftwareName
String
Your software name
​
xSoftwareVersion
String
Your software version
​
xAmount
Number
Transaction amount
​
settings
Settings
Transaction settings, these should be the same for all transactions
​

Setting Parameters

Settings
Name
Type
Description
Valid values
deviceIpAddress
String
IP address of your device
​
deviceIpPort
String
IP port of your device. Default is β€œ10009”
​

xCommand parameters

xCommand
List of supported transaction types. These enums are available from the SDK. See more details about each command at https://kb.cardknox.com/api/​
Name
Command
CC_SALE
cc:sale
CC_CREDIT
cc:credit
CC_AUTHONLY
cc:authonly
CC_CAPTURE
cc:capture
CC_POSTAUTH
cc:postauth
CC_VOID
cc:void
CC_VOIDRELEASE
cc:voidrelease
CC_VOIDREFUND
cc:voidrefund
CC_BALANCE
cc:balance
EBTFS_SALE
ebtfs:sale
EBTFS_CREDIT
ebtfs:credit
EBTFS_BALANCE
ebtfs:balance
EBTCB_SALE
ebtcb:sale
EBTCB_BALANCE
ebtcb:balance
GIFT_REDEEM
gift:redeem
GIFT_ISSUE
gift:issue
GIFT_BALANCE
gift:balance
Last modified 4mo ago