@paystack/checkout-js 1.49.0-dev.3 → 1.49.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/checkout.js +48 -9
- package/es/checkout.js +48 -9
- package/lib/checkout.js +48 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# Checkout JS Documentation
|
|
2
|
+
|
|
2
3
|
Checkout JS is a billing library for building web checkout flows on Paystack.
|
|
3
4
|
|
|
4
5
|
# Installation
|
|
6
|
+
|
|
5
7
|
```bash
|
|
6
8
|
npm install @paystack/checkout-js --save
|
|
7
9
|
```
|
|
8
10
|
|
|
9
11
|
or just grab the js file and add it to your html directly
|
|
12
|
+
|
|
10
13
|
```html
|
|
11
14
|
<script src="https://js.paystack.co/v1/checkout.js"></script>
|
|
12
15
|
```
|
package/dist/checkout.js
CHANGED
|
@@ -22065,7 +22065,7 @@ var Paystack = (function (exports) {
|
|
|
22065
22065
|
};
|
|
22066
22066
|
|
|
22067
22067
|
var PreauthorizationAPI = {
|
|
22068
|
-
|
|
22068
|
+
verifyAccessCode: function verifyAccessCode(accessCode) {
|
|
22069
22069
|
var language = getLanguage();
|
|
22070
22070
|
var headers = _objectSpread2({}, language && {
|
|
22071
22071
|
'Accept-Language': language
|
|
@@ -22092,6 +22092,20 @@ var Paystack = (function (exports) {
|
|
|
22092
22092
|
}).then(function (response) {
|
|
22093
22093
|
return ChargeResponses.parse(response.data);
|
|
22094
22094
|
});
|
|
22095
|
+
},
|
|
22096
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22097
|
+
var language = getLanguage();
|
|
22098
|
+
var headers = _objectSpread2({
|
|
22099
|
+
Authorization: "Bearer ".concat(publicKey)
|
|
22100
|
+
}, language && {
|
|
22101
|
+
'Accept-Language': language
|
|
22102
|
+
});
|
|
22103
|
+
var url = new URL("preauthorization/verify_access_code/".concat(accessCode), configToUse.paystackApiUrl).toString();
|
|
22104
|
+
return axiosInstance.get(url, {
|
|
22105
|
+
headers: headers
|
|
22106
|
+
}).then(function (response) {
|
|
22107
|
+
return response.data;
|
|
22108
|
+
});
|
|
22095
22109
|
}
|
|
22096
22110
|
};
|
|
22097
22111
|
|
|
@@ -22321,21 +22335,20 @@ var Paystack = (function (exports) {
|
|
|
22321
22335
|
initialize: function initialize(data) {
|
|
22322
22336
|
return Object.seal(new PreauthorizationInstance(data));
|
|
22323
22337
|
},
|
|
22324
|
-
|
|
22338
|
+
requestWithAccessCode: function requestWithAccessCode(accessCode) {
|
|
22325
22339
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
22326
|
-
var
|
|
22340
|
+
var _yield$Promise$all, _yield$Promise$all2, response, deviceFingerprint;
|
|
22327
22341
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22328
22342
|
while (1) {
|
|
22329
22343
|
switch (_context.prev = _context.next) {
|
|
22330
22344
|
case 0:
|
|
22331
22345
|
_context.next = 2;
|
|
22332
|
-
return getDeviceFingerprint();
|
|
22346
|
+
return Promise.all([PreauthorizationAPI.verifyAccessCode(accessCode), getDeviceFingerprint()]);
|
|
22333
22347
|
case 2:
|
|
22334
|
-
|
|
22335
|
-
|
|
22336
|
-
|
|
22337
|
-
|
|
22338
|
-
response = _context.sent;
|
|
22348
|
+
_yield$Promise$all = _context.sent;
|
|
22349
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
22350
|
+
response = _yield$Promise$all2[0];
|
|
22351
|
+
deviceFingerprint = _yield$Promise$all2[1];
|
|
22339
22352
|
return _context.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22340
22353
|
deviceFingerprint: deviceFingerprint,
|
|
22341
22354
|
accessCode: accessCode
|
|
@@ -22347,6 +22360,32 @@ var Paystack = (function (exports) {
|
|
|
22347
22360
|
}
|
|
22348
22361
|
}, _callee);
|
|
22349
22362
|
}))();
|
|
22363
|
+
},
|
|
22364
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22365
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
22366
|
+
var _yield$Promise$all3, _yield$Promise$all4, response, deviceFingerprint;
|
|
22367
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
22368
|
+
while (1) {
|
|
22369
|
+
switch (_context2.prev = _context2.next) {
|
|
22370
|
+
case 0:
|
|
22371
|
+
_context2.next = 2;
|
|
22372
|
+
return Promise.all([PreauthorizationAPI.getByAccessCode(accessCode, publicKey), getDeviceFingerprint()]);
|
|
22373
|
+
case 2:
|
|
22374
|
+
_yield$Promise$all3 = _context2.sent;
|
|
22375
|
+
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
|
22376
|
+
response = _yield$Promise$all4[0];
|
|
22377
|
+
deviceFingerprint = _yield$Promise$all4[1];
|
|
22378
|
+
return _context2.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22379
|
+
deviceFingerprint: deviceFingerprint,
|
|
22380
|
+
accessCode: accessCode
|
|
22381
|
+
}))));
|
|
22382
|
+
case 7:
|
|
22383
|
+
case "end":
|
|
22384
|
+
return _context2.stop();
|
|
22385
|
+
}
|
|
22386
|
+
}
|
|
22387
|
+
}, _callee2);
|
|
22388
|
+
}))();
|
|
22350
22389
|
}
|
|
22351
22390
|
};
|
|
22352
22391
|
|
package/es/checkout.js
CHANGED
|
@@ -22062,7 +22062,7 @@ var CardPreauthorization = {
|
|
|
22062
22062
|
};
|
|
22063
22063
|
|
|
22064
22064
|
var PreauthorizationAPI = {
|
|
22065
|
-
|
|
22065
|
+
verifyAccessCode: function verifyAccessCode(accessCode) {
|
|
22066
22066
|
var language = getLanguage();
|
|
22067
22067
|
var headers = _objectSpread2({}, language && {
|
|
22068
22068
|
'Accept-Language': language
|
|
@@ -22089,6 +22089,20 @@ var PreauthorizationAPI = {
|
|
|
22089
22089
|
}).then(function (response) {
|
|
22090
22090
|
return ChargeResponses.parse(response.data);
|
|
22091
22091
|
});
|
|
22092
|
+
},
|
|
22093
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22094
|
+
var language = getLanguage();
|
|
22095
|
+
var headers = _objectSpread2({
|
|
22096
|
+
Authorization: "Bearer ".concat(publicKey)
|
|
22097
|
+
}, language && {
|
|
22098
|
+
'Accept-Language': language
|
|
22099
|
+
});
|
|
22100
|
+
var url = new URL("preauthorization/verify_access_code/".concat(accessCode), configToUse.paystackApiUrl).toString();
|
|
22101
|
+
return axiosInstance.get(url, {
|
|
22102
|
+
headers: headers
|
|
22103
|
+
}).then(function (response) {
|
|
22104
|
+
return response.data;
|
|
22105
|
+
});
|
|
22092
22106
|
}
|
|
22093
22107
|
};
|
|
22094
22108
|
|
|
@@ -22318,21 +22332,20 @@ var Preauthorization = {
|
|
|
22318
22332
|
initialize: function initialize(data) {
|
|
22319
22333
|
return Object.seal(new PreauthorizationInstance(data));
|
|
22320
22334
|
},
|
|
22321
|
-
|
|
22335
|
+
requestWithAccessCode: function requestWithAccessCode(accessCode) {
|
|
22322
22336
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
22323
|
-
var
|
|
22337
|
+
var _yield$Promise$all, _yield$Promise$all2, response, deviceFingerprint;
|
|
22324
22338
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22325
22339
|
while (1) {
|
|
22326
22340
|
switch (_context.prev = _context.next) {
|
|
22327
22341
|
case 0:
|
|
22328
22342
|
_context.next = 2;
|
|
22329
|
-
return getDeviceFingerprint();
|
|
22343
|
+
return Promise.all([PreauthorizationAPI.verifyAccessCode(accessCode), getDeviceFingerprint()]);
|
|
22330
22344
|
case 2:
|
|
22331
|
-
|
|
22332
|
-
|
|
22333
|
-
|
|
22334
|
-
|
|
22335
|
-
response = _context.sent;
|
|
22345
|
+
_yield$Promise$all = _context.sent;
|
|
22346
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
22347
|
+
response = _yield$Promise$all2[0];
|
|
22348
|
+
deviceFingerprint = _yield$Promise$all2[1];
|
|
22336
22349
|
return _context.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22337
22350
|
deviceFingerprint: deviceFingerprint,
|
|
22338
22351
|
accessCode: accessCode
|
|
@@ -22344,6 +22357,32 @@ var Preauthorization = {
|
|
|
22344
22357
|
}
|
|
22345
22358
|
}, _callee);
|
|
22346
22359
|
}))();
|
|
22360
|
+
},
|
|
22361
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22362
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
22363
|
+
var _yield$Promise$all3, _yield$Promise$all4, response, deviceFingerprint;
|
|
22364
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
22365
|
+
while (1) {
|
|
22366
|
+
switch (_context2.prev = _context2.next) {
|
|
22367
|
+
case 0:
|
|
22368
|
+
_context2.next = 2;
|
|
22369
|
+
return Promise.all([PreauthorizationAPI.getByAccessCode(accessCode, publicKey), getDeviceFingerprint()]);
|
|
22370
|
+
case 2:
|
|
22371
|
+
_yield$Promise$all3 = _context2.sent;
|
|
22372
|
+
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
|
22373
|
+
response = _yield$Promise$all4[0];
|
|
22374
|
+
deviceFingerprint = _yield$Promise$all4[1];
|
|
22375
|
+
return _context2.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22376
|
+
deviceFingerprint: deviceFingerprint,
|
|
22377
|
+
accessCode: accessCode
|
|
22378
|
+
}))));
|
|
22379
|
+
case 7:
|
|
22380
|
+
case "end":
|
|
22381
|
+
return _context2.stop();
|
|
22382
|
+
}
|
|
22383
|
+
}
|
|
22384
|
+
}, _callee2);
|
|
22385
|
+
}))();
|
|
22347
22386
|
}
|
|
22348
22387
|
};
|
|
22349
22388
|
|
package/lib/checkout.js
CHANGED
|
@@ -22066,7 +22066,7 @@ var CardPreauthorization = {
|
|
|
22066
22066
|
};
|
|
22067
22067
|
|
|
22068
22068
|
var PreauthorizationAPI = {
|
|
22069
|
-
|
|
22069
|
+
verifyAccessCode: function verifyAccessCode(accessCode) {
|
|
22070
22070
|
var language = getLanguage();
|
|
22071
22071
|
var headers = _objectSpread2({}, language && {
|
|
22072
22072
|
'Accept-Language': language
|
|
@@ -22093,6 +22093,20 @@ var PreauthorizationAPI = {
|
|
|
22093
22093
|
}).then(function (response) {
|
|
22094
22094
|
return ChargeResponses.parse(response.data);
|
|
22095
22095
|
});
|
|
22096
|
+
},
|
|
22097
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22098
|
+
var language = getLanguage();
|
|
22099
|
+
var headers = _objectSpread2({
|
|
22100
|
+
Authorization: "Bearer ".concat(publicKey)
|
|
22101
|
+
}, language && {
|
|
22102
|
+
'Accept-Language': language
|
|
22103
|
+
});
|
|
22104
|
+
var url = new URL("preauthorization/verify_access_code/".concat(accessCode), configToUse.paystackApiUrl).toString();
|
|
22105
|
+
return axiosInstance.get(url, {
|
|
22106
|
+
headers: headers
|
|
22107
|
+
}).then(function (response) {
|
|
22108
|
+
return response.data;
|
|
22109
|
+
});
|
|
22096
22110
|
}
|
|
22097
22111
|
};
|
|
22098
22112
|
|
|
@@ -22322,21 +22336,20 @@ var Preauthorization = {
|
|
|
22322
22336
|
initialize: function initialize(data) {
|
|
22323
22337
|
return Object.seal(new PreauthorizationInstance(data));
|
|
22324
22338
|
},
|
|
22325
|
-
|
|
22339
|
+
requestWithAccessCode: function requestWithAccessCode(accessCode) {
|
|
22326
22340
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
22327
|
-
var
|
|
22341
|
+
var _yield$Promise$all, _yield$Promise$all2, response, deviceFingerprint;
|
|
22328
22342
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22329
22343
|
while (1) {
|
|
22330
22344
|
switch (_context.prev = _context.next) {
|
|
22331
22345
|
case 0:
|
|
22332
22346
|
_context.next = 2;
|
|
22333
|
-
return getDeviceFingerprint();
|
|
22347
|
+
return Promise.all([PreauthorizationAPI.verifyAccessCode(accessCode), getDeviceFingerprint()]);
|
|
22334
22348
|
case 2:
|
|
22335
|
-
|
|
22336
|
-
|
|
22337
|
-
|
|
22338
|
-
|
|
22339
|
-
response = _context.sent;
|
|
22349
|
+
_yield$Promise$all = _context.sent;
|
|
22350
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
22351
|
+
response = _yield$Promise$all2[0];
|
|
22352
|
+
deviceFingerprint = _yield$Promise$all2[1];
|
|
22340
22353
|
return _context.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22341
22354
|
deviceFingerprint: deviceFingerprint,
|
|
22342
22355
|
accessCode: accessCode
|
|
@@ -22348,6 +22361,32 @@ var Preauthorization = {
|
|
|
22348
22361
|
}
|
|
22349
22362
|
}, _callee);
|
|
22350
22363
|
}))();
|
|
22364
|
+
},
|
|
22365
|
+
getByAccessCode: function getByAccessCode(accessCode, publicKey) {
|
|
22366
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
22367
|
+
var _yield$Promise$all3, _yield$Promise$all4, response, deviceFingerprint;
|
|
22368
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
22369
|
+
while (1) {
|
|
22370
|
+
switch (_context2.prev = _context2.next) {
|
|
22371
|
+
case 0:
|
|
22372
|
+
_context2.next = 2;
|
|
22373
|
+
return Promise.all([PreauthorizationAPI.getByAccessCode(accessCode, publicKey), getDeviceFingerprint()]);
|
|
22374
|
+
case 2:
|
|
22375
|
+
_yield$Promise$all3 = _context2.sent;
|
|
22376
|
+
_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 2);
|
|
22377
|
+
response = _yield$Promise$all4[0];
|
|
22378
|
+
deviceFingerprint = _yield$Promise$all4[1];
|
|
22379
|
+
return _context2.abrupt("return", response && Object.seal(new PreauthorizationInstance(_objectSpread2(_objectSpread2({}, response.data), {}, {
|
|
22380
|
+
deviceFingerprint: deviceFingerprint,
|
|
22381
|
+
accessCode: accessCode
|
|
22382
|
+
}))));
|
|
22383
|
+
case 7:
|
|
22384
|
+
case "end":
|
|
22385
|
+
return _context2.stop();
|
|
22386
|
+
}
|
|
22387
|
+
}
|
|
22388
|
+
}, _callee2);
|
|
22389
|
+
}))();
|
|
22351
22390
|
}
|
|
22352
22391
|
};
|
|
22353
22392
|
|