@paystack/checkout-js 1.28.0-dev.9 → 1.28.0

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/es/checkout.js CHANGED
@@ -11568,38 +11568,6 @@ var PayWithTransferAPI = {
11568
11568
  }).then(function (response) {
11569
11569
  return ChargeResponses.parse(response.data);
11570
11570
  });
11571
- },
11572
- incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
11573
- var language = getLanguage();
11574
-
11575
- var headers = _objectSpread2({
11576
- Authorization: "Bearer ".concat(publicKey)
11577
- }, language && {
11578
- 'Accept-Language': language
11579
- });
11580
-
11581
- var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
11582
- return axiosInstance.post(url, params, {
11583
- headers: headers
11584
- }).then(function (response) {
11585
- return ChargeResponses.parse(response.data);
11586
- });
11587
- },
11588
- authenticatePayer: function authenticatePayer(params, publicKey) {
11589
- var language = getLanguage();
11590
-
11591
- var headers = _objectSpread2({
11592
- Authorization: "Bearer ".concat(publicKey)
11593
- }, language && {
11594
- 'Accept-Language': language
11595
- });
11596
-
11597
- var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
11598
- return axiosInstance.post(url, params, {
11599
- headers: headers
11600
- }).then(function (response) {
11601
- return ChargeResponses.parse(response.data);
11602
- });
11603
11571
  }
11604
11572
  };
11605
11573
 
@@ -11630,25 +11598,6 @@ var PayWithTransferCharge = {
11630
11598
  paymentMethod: 'bank_transfer'
11631
11599
  };
11632
11600
  return this.listenForCharge(listenerOptions, callback);
11633
- },
11634
- sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
11635
- var params = {
11636
- transaction_id: this.id,
11637
- decision: decisionMade
11638
- };
11639
- return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
11640
- },
11641
- sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
11642
- var amountPaid = _ref2.amountPaid,
11643
- payerAccountNumber = _ref2.payerAccountNumber,
11644
- payerBankSlug = _ref2.payerBankSlug;
11645
- var params = {
11646
- transaction_id: this.id,
11647
- amount: amountPaid,
11648
- payer_account_number: payerAccountNumber,
11649
- payer_bank_slug: payerBankSlug
11650
- };
11651
- return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
11652
11601
  }
11653
11602
  };
11654
11603
 
@@ -18754,21 +18703,23 @@ var CardAPI$1 = {
18754
18703
  },
18755
18704
  sendSavedCardsOTP: function sendSavedCardsOTP(_ref6) {
18756
18705
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
18757
- var transaction, phone, channels, url, language, headers, data, response;
18706
+ var transaction, phone, channels, email, url, language, headers, data, response;
18758
18707
  return regeneratorRuntime.wrap(function _callee$(_context) {
18759
18708
  while (1) {
18760
18709
  switch (_context.prev = _context.next) {
18761
18710
  case 0:
18762
- transaction = _ref6.transaction, phone = _ref6.phone, channels = _ref6.channels;
18711
+ transaction = _ref6.transaction, phone = _ref6.phone, channels = _ref6.channels, email = _ref6.email;
18763
18712
  url = new URL('/saved_cards/authorize', configToUse.paystackApiUrl).toString();
18764
18713
  language = getLanguage();
18765
18714
  headers = _objectSpread2({}, language && {
18766
18715
  'Accept-Language': language
18767
18716
  });
18768
- data = _objectSpread2(_objectSpread2(_objectSpread2({}, phone && {
18717
+ data = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, phone && {
18769
18718
  phone: phone
18770
18719
  }), channels && {
18771
18720
  channels: channels
18721
+ }), email && {
18722
+ email: email
18772
18723
  }), {}, {
18773
18724
  transaction: transaction
18774
18725
  });
@@ -19113,46 +19064,48 @@ var CardCharge = {
19113
19064
  };
19114
19065
  return this.listenForCharge(listenerOptions, callback);
19115
19066
  },
19116
- sendSavedCardsOTP: function sendSavedCardsOTP(phone, channels) {
19067
+ sendSavedCardsOTP: function sendSavedCardsOTP(_ref4) {
19117
19068
  var _this9 = this;
19118
19069
 
19119
19070
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
19120
- var response;
19071
+ var phone, channels, email, response;
19121
19072
  return regeneratorRuntime.wrap(function _callee$(_context) {
19122
19073
  while (1) {
19123
19074
  switch (_context.prev = _context.next) {
19124
19075
  case 0:
19125
- _context.prev = 0;
19076
+ phone = _ref4.phone, channels = _ref4.channels, email = _ref4.email;
19077
+ _context.prev = 1;
19126
19078
 
19127
19079
  _this9.logAuth(savedCardMethods.authentication);
19128
19080
 
19129
- _context.next = 4;
19081
+ _context.next = 5;
19130
19082
  return CardAPI$1.sendSavedCardsOTP({
19131
19083
  phone: phone,
19132
19084
  transaction: _this9.id,
19133
- channels: channels
19085
+ channels: channels,
19086
+ email: email
19134
19087
  });
19135
19088
 
19136
- case 4:
19089
+ case 5:
19137
19090
  response = _context.sent;
19138
19091
  _this9.savedCardsTempAuthToken = response.data.token;
19139
19092
  return _context.abrupt("return", response);
19140
19093
 
19141
- case 9:
19142
- _context.prev = 9;
19143
- _context.t0 = _context["catch"](0);
19094
+ case 10:
19095
+ _context.prev = 10;
19096
+ _context.t0 = _context["catch"](1);
19144
19097
  _this9.savedCardsTempAuthToken = null;
19145
19098
  throw _context.t0;
19146
19099
 
19147
- case 13:
19100
+ case 14:
19148
19101
  case "end":
19149
19102
  return _context.stop();
19150
19103
  }
19151
19104
  }
19152
- }, _callee, null, [[0, 9]]);
19105
+ }, _callee, null, [[1, 10]]);
19153
19106
  }))();
19154
19107
  },
19155
- verifySavedCardsOtp: function verifySavedCardsOtp(_ref4) {
19108
+ verifySavedCardsOtp: function verifySavedCardsOtp(_ref5) {
19156
19109
  var _this10 = this;
19157
19110
 
19158
19111
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -19161,7 +19114,7 @@ var CardCharge = {
19161
19114
  while (1) {
19162
19115
  switch (_context2.prev = _context2.next) {
19163
19116
  case 0:
19164
- code = _ref4.code;
19117
+ code = _ref5.code;
19165
19118
  payload = {
19166
19119
  code: code,
19167
19120
  transaction: _this10.id,
@@ -19201,10 +19154,10 @@ var CardCharge = {
19201
19154
  token: this.savedCardsToken
19202
19155
  });
19203
19156
  },
19204
- chargeSavedCard: function chargeSavedCard(_ref5) {
19205
- var cardCode = _ref5.cardCode,
19206
- _ref5$selectedCurrenc = _ref5.selectedCurrency,
19207
- selectedCurrency = _ref5$selectedCurrenc === void 0 ? this.currency : _ref5$selectedCurrenc;
19157
+ chargeSavedCard: function chargeSavedCard(_ref6) {
19158
+ var cardCode = _ref6.cardCode,
19159
+ _ref6$selectedCurrenc = _ref6.selectedCurrency,
19160
+ selectedCurrency = _ref6$selectedCurrenc === void 0 ? this.currency : _ref6$selectedCurrenc;
19208
19161
  this.logAttempt(savedCardMethods.payment);
19209
19162
  return CardAPI$1.chargeSavedCard({
19210
19163
  cardCode: cardCode,
@@ -20912,21 +20865,6 @@ var ToolkitAPI = {
20912
20865
  resolvedCardBins[bin] = data;
20913
20866
  return data;
20914
20867
  });
20915
- },
20916
- resolveIPAddress: function resolveIPAddress(ipAddress) {
20917
- var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
20918
- var language = getLanguage();
20919
-
20920
- var headers = _objectSpread2({}, language && {
20921
- 'Accept-Language': language
20922
- });
20923
-
20924
- return axiosInstance.get(url, {
20925
- headers: headers
20926
- }).then(function (_ref2) {
20927
- var data = _ref2.data;
20928
- return data;
20929
- });
20930
20868
  }
20931
20869
  };
20932
20870
 
@@ -20992,11 +20930,6 @@ var Toolkit = /*#__PURE__*/function () {
20992
20930
  value: function resolveCardBin(bin) {
20993
20931
  return ToolkitAPI.resolveCardBin(bin);
20994
20932
  }
20995
- }, {
20996
- key: "resolveIPAddress",
20997
- value: function resolveIPAddress(ipAddress) {
20998
- return ToolkitAPI.resolveIPAddress(ipAddress);
20999
- }
21000
20933
  }]);
21001
20934
 
21002
20935
  return Toolkit;
@@ -21304,8 +21237,6 @@ var AnalyticsFunctions = {
21304
21237
  return this.saveLog();
21305
21238
  },
21306
21239
  logAPIResponse: function logAPIResponse(response, channel) {
21307
- console.log('api response', response);
21308
-
21309
21240
  switch (response.status) {
21310
21241
  case 'authorized':
21311
21242
  return this.logAuthorized(channel);
package/lib/checkout.js CHANGED
@@ -11572,38 +11572,6 @@ var PayWithTransferAPI = {
11572
11572
  }).then(function (response) {
11573
11573
  return ChargeResponses.parse(response.data);
11574
11574
  });
11575
- },
11576
- incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
11577
- var language = getLanguage();
11578
-
11579
- var headers = _objectSpread2({
11580
- Authorization: "Bearer ".concat(publicKey)
11581
- }, language && {
11582
- 'Accept-Language': language
11583
- });
11584
-
11585
- var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
11586
- return axiosInstance.post(url, params, {
11587
- headers: headers
11588
- }).then(function (response) {
11589
- return ChargeResponses.parse(response.data);
11590
- });
11591
- },
11592
- authenticatePayer: function authenticatePayer(params, publicKey) {
11593
- var language = getLanguage();
11594
-
11595
- var headers = _objectSpread2({
11596
- Authorization: "Bearer ".concat(publicKey)
11597
- }, language && {
11598
- 'Accept-Language': language
11599
- });
11600
-
11601
- var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
11602
- return axiosInstance.post(url, params, {
11603
- headers: headers
11604
- }).then(function (response) {
11605
- return ChargeResponses.parse(response.data);
11606
- });
11607
11575
  }
11608
11576
  };
11609
11577
 
@@ -11634,25 +11602,6 @@ var PayWithTransferCharge = {
11634
11602
  paymentMethod: 'bank_transfer'
11635
11603
  };
11636
11604
  return this.listenForCharge(listenerOptions, callback);
11637
- },
11638
- sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
11639
- var params = {
11640
- transaction_id: this.id,
11641
- decision: decisionMade
11642
- };
11643
- return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
11644
- },
11645
- sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
11646
- var amountPaid = _ref2.amountPaid,
11647
- payerAccountNumber = _ref2.payerAccountNumber,
11648
- payerBankSlug = _ref2.payerBankSlug;
11649
- var params = {
11650
- transaction_id: this.id,
11651
- amount: amountPaid,
11652
- payer_account_number: payerAccountNumber,
11653
- payer_bank_slug: payerBankSlug
11654
- };
11655
- return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
11656
11605
  }
11657
11606
  };
11658
11607
 
@@ -18758,21 +18707,23 @@ var CardAPI$1 = {
18758
18707
  },
18759
18708
  sendSavedCardsOTP: function sendSavedCardsOTP(_ref6) {
18760
18709
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
18761
- var transaction, phone, channels, url, language, headers, data, response;
18710
+ var transaction, phone, channels, email, url, language, headers, data, response;
18762
18711
  return regeneratorRuntime.wrap(function _callee$(_context) {
18763
18712
  while (1) {
18764
18713
  switch (_context.prev = _context.next) {
18765
18714
  case 0:
18766
- transaction = _ref6.transaction, phone = _ref6.phone, channels = _ref6.channels;
18715
+ transaction = _ref6.transaction, phone = _ref6.phone, channels = _ref6.channels, email = _ref6.email;
18767
18716
  url = new URL('/saved_cards/authorize', configToUse.paystackApiUrl).toString();
18768
18717
  language = getLanguage();
18769
18718
  headers = _objectSpread2({}, language && {
18770
18719
  'Accept-Language': language
18771
18720
  });
18772
- data = _objectSpread2(_objectSpread2(_objectSpread2({}, phone && {
18721
+ data = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, phone && {
18773
18722
  phone: phone
18774
18723
  }), channels && {
18775
18724
  channels: channels
18725
+ }), email && {
18726
+ email: email
18776
18727
  }), {}, {
18777
18728
  transaction: transaction
18778
18729
  });
@@ -19117,46 +19068,48 @@ var CardCharge = {
19117
19068
  };
19118
19069
  return this.listenForCharge(listenerOptions, callback);
19119
19070
  },
19120
- sendSavedCardsOTP: function sendSavedCardsOTP(phone, channels) {
19071
+ sendSavedCardsOTP: function sendSavedCardsOTP(_ref4) {
19121
19072
  var _this9 = this;
19122
19073
 
19123
19074
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
19124
- var response;
19075
+ var phone, channels, email, response;
19125
19076
  return regeneratorRuntime.wrap(function _callee$(_context) {
19126
19077
  while (1) {
19127
19078
  switch (_context.prev = _context.next) {
19128
19079
  case 0:
19129
- _context.prev = 0;
19080
+ phone = _ref4.phone, channels = _ref4.channels, email = _ref4.email;
19081
+ _context.prev = 1;
19130
19082
 
19131
19083
  _this9.logAuth(savedCardMethods.authentication);
19132
19084
 
19133
- _context.next = 4;
19085
+ _context.next = 5;
19134
19086
  return CardAPI$1.sendSavedCardsOTP({
19135
19087
  phone: phone,
19136
19088
  transaction: _this9.id,
19137
- channels: channels
19089
+ channels: channels,
19090
+ email: email
19138
19091
  });
19139
19092
 
19140
- case 4:
19093
+ case 5:
19141
19094
  response = _context.sent;
19142
19095
  _this9.savedCardsTempAuthToken = response.data.token;
19143
19096
  return _context.abrupt("return", response);
19144
19097
 
19145
- case 9:
19146
- _context.prev = 9;
19147
- _context.t0 = _context["catch"](0);
19098
+ case 10:
19099
+ _context.prev = 10;
19100
+ _context.t0 = _context["catch"](1);
19148
19101
  _this9.savedCardsTempAuthToken = null;
19149
19102
  throw _context.t0;
19150
19103
 
19151
- case 13:
19104
+ case 14:
19152
19105
  case "end":
19153
19106
  return _context.stop();
19154
19107
  }
19155
19108
  }
19156
- }, _callee, null, [[0, 9]]);
19109
+ }, _callee, null, [[1, 10]]);
19157
19110
  }))();
19158
19111
  },
19159
- verifySavedCardsOtp: function verifySavedCardsOtp(_ref4) {
19112
+ verifySavedCardsOtp: function verifySavedCardsOtp(_ref5) {
19160
19113
  var _this10 = this;
19161
19114
 
19162
19115
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -19165,7 +19118,7 @@ var CardCharge = {
19165
19118
  while (1) {
19166
19119
  switch (_context2.prev = _context2.next) {
19167
19120
  case 0:
19168
- code = _ref4.code;
19121
+ code = _ref5.code;
19169
19122
  payload = {
19170
19123
  code: code,
19171
19124
  transaction: _this10.id,
@@ -19205,10 +19158,10 @@ var CardCharge = {
19205
19158
  token: this.savedCardsToken
19206
19159
  });
19207
19160
  },
19208
- chargeSavedCard: function chargeSavedCard(_ref5) {
19209
- var cardCode = _ref5.cardCode,
19210
- _ref5$selectedCurrenc = _ref5.selectedCurrency,
19211
- selectedCurrency = _ref5$selectedCurrenc === void 0 ? this.currency : _ref5$selectedCurrenc;
19161
+ chargeSavedCard: function chargeSavedCard(_ref6) {
19162
+ var cardCode = _ref6.cardCode,
19163
+ _ref6$selectedCurrenc = _ref6.selectedCurrency,
19164
+ selectedCurrency = _ref6$selectedCurrenc === void 0 ? this.currency : _ref6$selectedCurrenc;
19212
19165
  this.logAttempt(savedCardMethods.payment);
19213
19166
  return CardAPI$1.chargeSavedCard({
19214
19167
  cardCode: cardCode,
@@ -20916,21 +20869,6 @@ var ToolkitAPI = {
20916
20869
  resolvedCardBins[bin] = data;
20917
20870
  return data;
20918
20871
  });
20919
- },
20920
- resolveIPAddress: function resolveIPAddress(ipAddress) {
20921
- var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
20922
- var language = getLanguage();
20923
-
20924
- var headers = _objectSpread2({}, language && {
20925
- 'Accept-Language': language
20926
- });
20927
-
20928
- return axiosInstance.get(url, {
20929
- headers: headers
20930
- }).then(function (_ref2) {
20931
- var data = _ref2.data;
20932
- return data;
20933
- });
20934
20872
  }
20935
20873
  };
20936
20874
 
@@ -20996,11 +20934,6 @@ var Toolkit = /*#__PURE__*/function () {
20996
20934
  value: function resolveCardBin(bin) {
20997
20935
  return ToolkitAPI.resolveCardBin(bin);
20998
20936
  }
20999
- }, {
21000
- key: "resolveIPAddress",
21001
- value: function resolveIPAddress(ipAddress) {
21002
- return ToolkitAPI.resolveIPAddress(ipAddress);
21003
- }
21004
20937
  }]);
21005
20938
 
21006
20939
  return Toolkit;
@@ -21308,8 +21241,6 @@ var AnalyticsFunctions = {
21308
21241
  return this.saveLog();
21309
21242
  },
21310
21243
  logAPIResponse: function logAPIResponse(response, channel) {
21311
- console.log('api response', response);
21312
-
21313
21244
  switch (response.status) {
21314
21245
  case 'authorized':
21315
21246
  return this.logAuthorized(channel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.28.0-dev.9",
3
+ "version": "1.28.0",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",