@paystack/checkout-js 1.19.0-dev.5 → 1.19.0-dev.7
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/dist/checkout.js +3 -3
- package/es/checkout.js +58 -4
- package/lib/checkout.js +58 -4
- package/package.json +1 -1
package/es/checkout.js
CHANGED
|
@@ -18698,6 +18698,41 @@ var CardAPI = {
|
|
|
18698
18698
|
}
|
|
18699
18699
|
}, _callee4);
|
|
18700
18700
|
}))();
|
|
18701
|
+
},
|
|
18702
|
+
chargeSavedCard: function chargeSavedCard(_ref9) {
|
|
18703
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
18704
|
+
var token, device, cardCode, transaction, selectedCurrency, url, language, headers, data;
|
|
18705
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
18706
|
+
while (1) {
|
|
18707
|
+
switch (_context5.prev = _context5.next) {
|
|
18708
|
+
case 0:
|
|
18709
|
+
token = _ref9.token, device = _ref9.device, cardCode = _ref9.cardCode, transaction = _ref9.transaction, selectedCurrency = _ref9.selectedCurrency;
|
|
18710
|
+
url = new URL("/cards/".concat(cardCode, "/charge"), configToUse.savedCardsApiUrl).toString();
|
|
18711
|
+
language = getLanguage();
|
|
18712
|
+
headers = _objectSpread2({
|
|
18713
|
+
Authorization: "Bearer ".concat(token),
|
|
18714
|
+
'jwt-auth': true
|
|
18715
|
+
}, language && {
|
|
18716
|
+
'Accept-Language': language
|
|
18717
|
+
});
|
|
18718
|
+
data = {
|
|
18719
|
+
device: device,
|
|
18720
|
+
transaction: transaction,
|
|
18721
|
+
selectedCurrency: selectedCurrency
|
|
18722
|
+
};
|
|
18723
|
+
return _context5.abrupt("return", axiosInstance.post(url, data, {
|
|
18724
|
+
headers: headers
|
|
18725
|
+
}).then(function (response) {
|
|
18726
|
+
return ChargeResponses.parse(response.data);
|
|
18727
|
+
}));
|
|
18728
|
+
|
|
18729
|
+
case 6:
|
|
18730
|
+
case "end":
|
|
18731
|
+
return _context5.stop();
|
|
18732
|
+
}
|
|
18733
|
+
}
|
|
18734
|
+
}, _callee5);
|
|
18735
|
+
}))();
|
|
18701
18736
|
}
|
|
18702
18737
|
};
|
|
18703
18738
|
|
|
@@ -18897,20 +18932,27 @@ var CardCharge = {
|
|
|
18897
18932
|
phone: phone,
|
|
18898
18933
|
transaction: _this9.id
|
|
18899
18934
|
};
|
|
18900
|
-
_context.
|
|
18935
|
+
_context.prev = 2;
|
|
18936
|
+
_context.next = 5;
|
|
18901
18937
|
return CardAPI.verifySavedCardsOtp(payload);
|
|
18902
18938
|
|
|
18903
|
-
case
|
|
18939
|
+
case 5:
|
|
18904
18940
|
response = _context.sent;
|
|
18905
18941
|
_this9.savedCardsToken = response.data.token;
|
|
18906
18942
|
return _context.abrupt("return", response);
|
|
18907
18943
|
|
|
18908
|
-
case
|
|
18944
|
+
case 10:
|
|
18945
|
+
_context.prev = 10;
|
|
18946
|
+
_context.t0 = _context["catch"](2);
|
|
18947
|
+
_this9.savedCardsToken = null;
|
|
18948
|
+
return _context.abrupt("return", _context.t0);
|
|
18949
|
+
|
|
18950
|
+
case 14:
|
|
18909
18951
|
case "end":
|
|
18910
18952
|
return _context.stop();
|
|
18911
18953
|
}
|
|
18912
18954
|
}
|
|
18913
|
-
}, _callee);
|
|
18955
|
+
}, _callee, null, [[2, 10]]);
|
|
18914
18956
|
}))();
|
|
18915
18957
|
},
|
|
18916
18958
|
getSavedCards: function getSavedCards() {
|
|
@@ -18923,6 +18965,18 @@ var CardCharge = {
|
|
|
18923
18965
|
cardCode: cardCode,
|
|
18924
18966
|
token: this.savedCardsToken
|
|
18925
18967
|
});
|
|
18968
|
+
},
|
|
18969
|
+
chargeSavedCard: function chargeSavedCard(_ref5) {
|
|
18970
|
+
var cardCode = _ref5.cardCode,
|
|
18971
|
+
transaction = _ref5.transaction,
|
|
18972
|
+
selectedCurrency = _ref5.selectedCurrency;
|
|
18973
|
+
return CardAPI.chargeSavedCard({
|
|
18974
|
+
cardCode: cardCode,
|
|
18975
|
+
transaction: transaction,
|
|
18976
|
+
selectedCurrency: selectedCurrency,
|
|
18977
|
+
token: this.savedCardsToken,
|
|
18978
|
+
device: this.deviceFingerprint
|
|
18979
|
+
});
|
|
18926
18980
|
}
|
|
18927
18981
|
};
|
|
18928
18982
|
|
package/lib/checkout.js
CHANGED
|
@@ -18702,6 +18702,41 @@ var CardAPI = {
|
|
|
18702
18702
|
}
|
|
18703
18703
|
}, _callee4);
|
|
18704
18704
|
}))();
|
|
18705
|
+
},
|
|
18706
|
+
chargeSavedCard: function chargeSavedCard(_ref9) {
|
|
18707
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
18708
|
+
var token, device, cardCode, transaction, selectedCurrency, url, language, headers, data;
|
|
18709
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
18710
|
+
while (1) {
|
|
18711
|
+
switch (_context5.prev = _context5.next) {
|
|
18712
|
+
case 0:
|
|
18713
|
+
token = _ref9.token, device = _ref9.device, cardCode = _ref9.cardCode, transaction = _ref9.transaction, selectedCurrency = _ref9.selectedCurrency;
|
|
18714
|
+
url = new URL("/cards/".concat(cardCode, "/charge"), configToUse.savedCardsApiUrl).toString();
|
|
18715
|
+
language = getLanguage();
|
|
18716
|
+
headers = _objectSpread2({
|
|
18717
|
+
Authorization: "Bearer ".concat(token),
|
|
18718
|
+
'jwt-auth': true
|
|
18719
|
+
}, language && {
|
|
18720
|
+
'Accept-Language': language
|
|
18721
|
+
});
|
|
18722
|
+
data = {
|
|
18723
|
+
device: device,
|
|
18724
|
+
transaction: transaction,
|
|
18725
|
+
selectedCurrency: selectedCurrency
|
|
18726
|
+
};
|
|
18727
|
+
return _context5.abrupt("return", axiosInstance.post(url, data, {
|
|
18728
|
+
headers: headers
|
|
18729
|
+
}).then(function (response) {
|
|
18730
|
+
return ChargeResponses.parse(response.data);
|
|
18731
|
+
}));
|
|
18732
|
+
|
|
18733
|
+
case 6:
|
|
18734
|
+
case "end":
|
|
18735
|
+
return _context5.stop();
|
|
18736
|
+
}
|
|
18737
|
+
}
|
|
18738
|
+
}, _callee5);
|
|
18739
|
+
}))();
|
|
18705
18740
|
}
|
|
18706
18741
|
};
|
|
18707
18742
|
|
|
@@ -18901,20 +18936,27 @@ var CardCharge = {
|
|
|
18901
18936
|
phone: phone,
|
|
18902
18937
|
transaction: _this9.id
|
|
18903
18938
|
};
|
|
18904
|
-
_context.
|
|
18939
|
+
_context.prev = 2;
|
|
18940
|
+
_context.next = 5;
|
|
18905
18941
|
return CardAPI.verifySavedCardsOtp(payload);
|
|
18906
18942
|
|
|
18907
|
-
case
|
|
18943
|
+
case 5:
|
|
18908
18944
|
response = _context.sent;
|
|
18909
18945
|
_this9.savedCardsToken = response.data.token;
|
|
18910
18946
|
return _context.abrupt("return", response);
|
|
18911
18947
|
|
|
18912
|
-
case
|
|
18948
|
+
case 10:
|
|
18949
|
+
_context.prev = 10;
|
|
18950
|
+
_context.t0 = _context["catch"](2);
|
|
18951
|
+
_this9.savedCardsToken = null;
|
|
18952
|
+
return _context.abrupt("return", _context.t0);
|
|
18953
|
+
|
|
18954
|
+
case 14:
|
|
18913
18955
|
case "end":
|
|
18914
18956
|
return _context.stop();
|
|
18915
18957
|
}
|
|
18916
18958
|
}
|
|
18917
|
-
}, _callee);
|
|
18959
|
+
}, _callee, null, [[2, 10]]);
|
|
18918
18960
|
}))();
|
|
18919
18961
|
},
|
|
18920
18962
|
getSavedCards: function getSavedCards() {
|
|
@@ -18927,6 +18969,18 @@ var CardCharge = {
|
|
|
18927
18969
|
cardCode: cardCode,
|
|
18928
18970
|
token: this.savedCardsToken
|
|
18929
18971
|
});
|
|
18972
|
+
},
|
|
18973
|
+
chargeSavedCard: function chargeSavedCard(_ref5) {
|
|
18974
|
+
var cardCode = _ref5.cardCode,
|
|
18975
|
+
transaction = _ref5.transaction,
|
|
18976
|
+
selectedCurrency = _ref5.selectedCurrency;
|
|
18977
|
+
return CardAPI.chargeSavedCard({
|
|
18978
|
+
cardCode: cardCode,
|
|
18979
|
+
transaction: transaction,
|
|
18980
|
+
selectedCurrency: selectedCurrency,
|
|
18981
|
+
token: this.savedCardsToken,
|
|
18982
|
+
device: this.deviceFingerprint
|
|
18983
|
+
});
|
|
18930
18984
|
}
|
|
18931
18985
|
};
|
|
18932
18986
|
|