sfl_sdk
v0.0.8
Published
Xload Shop For Load SDK
Downloads
9
Readme
Shop For Load SDK
Integrate e-commerce platforms with Xload's Shop For Load.
Tech
The Shop For Load SDK uses a number of open source projects to work properly:
- [Node.js] - evented I/O for the backend
- validator - A library of string validators and sanitizers.
- Axios - Promise based HTTP client for the browser and node.js.
- jsonwebtoken - An implementation of JSON Web Tokens.
Installation
$ npm install sfl_sdk
Usage
createOrderObject(orderId, amount, firstName, lastName, country, currency, title)
Create Shop For Load Order Object. Returns the order object to be used for createTransactionsAsync() or an error. | Parameter | Data Type | Description | | ----------- | ----------- | --------- | | orderId | string | Order id | | amount | number | Order amount | | firstName | string | Customer first name | | lastName | string | Customer last name | | country | string | Store base location| | currency | number | Order payment currency | | title (optional) | number | Order title |
Allowed country strings
["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua & Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia & Herzegovina","Botswana","Brazil","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Cape Verde","Cayman Islands","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica","Cote D Ivoire","Croatia","Cruise Ship","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","Guinea Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kuwait","Kyrgyz Republic","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Mauritania","Mauritius","Mexico","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Namibia","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint Pierre & Miquelon","Samoa","San Marino","Satellite","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","South Africa","South Korea","Spain","Sri Lanka","St Kitts & Nevis","St Lucia","St Vincent","St. Lucia","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor L'Este","Togo","Tonga","Trinidad & Tobago","Tunisia","Turkey","Turkmenistan","Turks & Caicos","Uganda","Ukraine","United Arab Emirates","United Kingdom","Uruguay","Uzbekistan","Venezuela","Vietnam","Virgin Islands (US)","Yemen","Zambia","Zimbabwe"]
Allowed currency codes
"AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XFU", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMW"
createOrderVerificationObject(orderId, status)
Create Shop For Load Order Verification Object. Returns the order verification object to be used for verifyTransactionsAsync() or an error.
| Parameter | Data Type | Description | | ----------- | ----------- | --------- | | orderId | string | Order id | | status | string | Order status |
Allowed status codes
|Status| |----| |'pending'| |'verified'| |'refunded'| |'cancelled'|
createTransactionAsync(appId, userId, publicKey, secret, order, sandboxMode)
Create Shop For Load Transaction. Returns request data or an axios error.
| Parameter | Data Type | Description | | ----------- | ----------- | --------- | | appId | number | Xload Merchant App Id | | userId | number | Xload User Id | | publicKey | string | Shop For Load Merchant Public Key | | secret | string | Shop For Load Merchant Secret | | order | Order | Order object created by createOrderObject() | | sandboxMode | boolean | Optional parameter, set to true to use sandbox endpoint. Defaults to false if no argument is provided. |
verifyTransactionsAsync(appId, publicKey, secret, orders, sandboxMode)
Verify Shop For Load Transactions. Returns request data or an axios error.
Implementation: Please include this in your platform's cron jobs and fetch orders from your database based on your platform's return policy(days). Make a call to our API at least once a day to update eligible pending Shop For Load transactions.
| Parameter | Data Type | Description | | ----------- | ----------- | --------- | | appId | number | Xload Merchant App Id | | publicKey | string | Shop For Load Merchant Public Key | | secret | string | Shop For Load Merchant Secret | | orders | Array[OrderVerification] | Accepts an array of OrderVerification objects. Generate OrderVerification objects using createOrderVerificationObject(). | | sandboxMode | boolean | Optional parameter, set to true to use sandbox endpoint. Defaults to false if no argument is provided.|
License
ISC