@paystack/checkout-js 1.25.0-dev.21 → 1.25.0-dev.22

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 CHANGED
@@ -18933,6 +18933,10 @@ var Paystack = (function (exports) {
18933
18933
  };
18934
18934
 
18935
18935
  var paymentMethod$4 = 'card';
18936
+ var savedCardMethods = {
18937
+ payment: 'saved card',
18938
+ authentication: 'otp'
18939
+ };
18936
18940
 
18937
18941
  function validate$4(card, isSetter) {
18938
18942
  return new Promise(function (resolve, reject) {
@@ -19120,29 +19124,32 @@ var Paystack = (function (exports) {
19120
19124
  switch (_context.prev = _context.next) {
19121
19125
  case 0:
19122
19126
  _context.prev = 0;
19123
- _context.next = 3;
19127
+
19128
+ _this9.logAuth(savedCardMethods.authentication);
19129
+
19130
+ _context.next = 4;
19124
19131
  return CardAPI$1.sendSavedCardsOTP({
19125
19132
  phone: phone,
19126
19133
  transaction: _this9.id
19127
19134
  });
19128
19135
 
19129
- case 3:
19136
+ case 4:
19130
19137
  response = _context.sent;
19131
19138
  _this9.savedCardsTempAuthToken = response.data.token;
19132
19139
  return _context.abrupt("return", response);
19133
19140
 
19134
- case 8:
19135
- _context.prev = 8;
19141
+ case 9:
19142
+ _context.prev = 9;
19136
19143
  _context.t0 = _context["catch"](0);
19137
19144
  _this9.savedCardsTempAuthToken = null;
19138
19145
  throw _context.t0;
19139
19146
 
19140
- case 12:
19147
+ case 13:
19141
19148
  case "end":
19142
19149
  return _context.stop();
19143
19150
  }
19144
19151
  }
19145
- }, _callee, null, [[0, 8]]);
19152
+ }, _callee, null, [[0, 9]]);
19146
19153
  }))();
19147
19154
  },
19148
19155
  verifySavedCardsOtp: function verifySavedCardsOtp(_ref4) {
@@ -19196,6 +19203,7 @@ var Paystack = (function (exports) {
19196
19203
  },
19197
19204
  chargeSavedCard: function chargeSavedCard(_ref5) {
19198
19205
  var cardCode = _ref5.cardCode;
19206
+ this.logAttempt(savedCardMethods.payment);
19199
19207
  return CardAPI$1.chargeSavedCard({
19200
19208
  cardCode: cardCode,
19201
19209
  transaction: this.id,
@@ -20355,6 +20363,14 @@ var Paystack = (function (exports) {
20355
20363
  });
20356
20364
  return this.saveLog();
20357
20365
  },
20366
+ logSavedCardSelect: function logSavedCardSelect() {
20367
+ this.log.history.push({
20368
+ type: 'action',
20369
+ message: 'Selected saved card',
20370
+ time: this.getTimeSpent()
20371
+ });
20372
+ return this.saveLog();
20373
+ },
20358
20374
  logAuthWindowOpen: function logAuthWindowOpen() {
20359
20375
  this.log.history.push({
20360
20376
  type: 'action',
package/es/checkout.js CHANGED
@@ -18930,6 +18930,10 @@ var CardAPI$1 = {
18930
18930
  };
18931
18931
 
18932
18932
  var paymentMethod$4 = 'card';
18933
+ var savedCardMethods = {
18934
+ payment: 'saved card',
18935
+ authentication: 'otp'
18936
+ };
18933
18937
 
18934
18938
  function validate$4(card, isSetter) {
18935
18939
  return new Promise(function (resolve, reject) {
@@ -19117,29 +19121,32 @@ var CardCharge = {
19117
19121
  switch (_context.prev = _context.next) {
19118
19122
  case 0:
19119
19123
  _context.prev = 0;
19120
- _context.next = 3;
19124
+
19125
+ _this9.logAuth(savedCardMethods.authentication);
19126
+
19127
+ _context.next = 4;
19121
19128
  return CardAPI$1.sendSavedCardsOTP({
19122
19129
  phone: phone,
19123
19130
  transaction: _this9.id
19124
19131
  });
19125
19132
 
19126
- case 3:
19133
+ case 4:
19127
19134
  response = _context.sent;
19128
19135
  _this9.savedCardsTempAuthToken = response.data.token;
19129
19136
  return _context.abrupt("return", response);
19130
19137
 
19131
- case 8:
19132
- _context.prev = 8;
19138
+ case 9:
19139
+ _context.prev = 9;
19133
19140
  _context.t0 = _context["catch"](0);
19134
19141
  _this9.savedCardsTempAuthToken = null;
19135
19142
  throw _context.t0;
19136
19143
 
19137
- case 12:
19144
+ case 13:
19138
19145
  case "end":
19139
19146
  return _context.stop();
19140
19147
  }
19141
19148
  }
19142
- }, _callee, null, [[0, 8]]);
19149
+ }, _callee, null, [[0, 9]]);
19143
19150
  }))();
19144
19151
  },
19145
19152
  verifySavedCardsOtp: function verifySavedCardsOtp(_ref4) {
@@ -19193,6 +19200,7 @@ var CardCharge = {
19193
19200
  },
19194
19201
  chargeSavedCard: function chargeSavedCard(_ref5) {
19195
19202
  var cardCode = _ref5.cardCode;
19203
+ this.logAttempt(savedCardMethods.payment);
19196
19204
  return CardAPI$1.chargeSavedCard({
19197
19205
  cardCode: cardCode,
19198
19206
  transaction: this.id,
@@ -20352,6 +20360,14 @@ var AnalyticsFunctions$1 = {
20352
20360
  });
20353
20361
  return this.saveLog();
20354
20362
  },
20363
+ logSavedCardSelect: function logSavedCardSelect() {
20364
+ this.log.history.push({
20365
+ type: 'action',
20366
+ message: 'Selected saved card',
20367
+ time: this.getTimeSpent()
20368
+ });
20369
+ return this.saveLog();
20370
+ },
20355
20371
  logAuthWindowOpen: function logAuthWindowOpen() {
20356
20372
  this.log.history.push({
20357
20373
  type: 'action',
package/lib/checkout.js CHANGED
@@ -18934,6 +18934,10 @@ var CardAPI$1 = {
18934
18934
  };
18935
18935
 
18936
18936
  var paymentMethod$4 = 'card';
18937
+ var savedCardMethods = {
18938
+ payment: 'saved card',
18939
+ authentication: 'otp'
18940
+ };
18937
18941
 
18938
18942
  function validate$4(card, isSetter) {
18939
18943
  return new Promise(function (resolve, reject) {
@@ -19121,29 +19125,32 @@ var CardCharge = {
19121
19125
  switch (_context.prev = _context.next) {
19122
19126
  case 0:
19123
19127
  _context.prev = 0;
19124
- _context.next = 3;
19128
+
19129
+ _this9.logAuth(savedCardMethods.authentication);
19130
+
19131
+ _context.next = 4;
19125
19132
  return CardAPI$1.sendSavedCardsOTP({
19126
19133
  phone: phone,
19127
19134
  transaction: _this9.id
19128
19135
  });
19129
19136
 
19130
- case 3:
19137
+ case 4:
19131
19138
  response = _context.sent;
19132
19139
  _this9.savedCardsTempAuthToken = response.data.token;
19133
19140
  return _context.abrupt("return", response);
19134
19141
 
19135
- case 8:
19136
- _context.prev = 8;
19142
+ case 9:
19143
+ _context.prev = 9;
19137
19144
  _context.t0 = _context["catch"](0);
19138
19145
  _this9.savedCardsTempAuthToken = null;
19139
19146
  throw _context.t0;
19140
19147
 
19141
- case 12:
19148
+ case 13:
19142
19149
  case "end":
19143
19150
  return _context.stop();
19144
19151
  }
19145
19152
  }
19146
- }, _callee, null, [[0, 8]]);
19153
+ }, _callee, null, [[0, 9]]);
19147
19154
  }))();
19148
19155
  },
19149
19156
  verifySavedCardsOtp: function verifySavedCardsOtp(_ref4) {
@@ -19197,6 +19204,7 @@ var CardCharge = {
19197
19204
  },
19198
19205
  chargeSavedCard: function chargeSavedCard(_ref5) {
19199
19206
  var cardCode = _ref5.cardCode;
19207
+ this.logAttempt(savedCardMethods.payment);
19200
19208
  return CardAPI$1.chargeSavedCard({
19201
19209
  cardCode: cardCode,
19202
19210
  transaction: this.id,
@@ -20356,6 +20364,14 @@ var AnalyticsFunctions$1 = {
20356
20364
  });
20357
20365
  return this.saveLog();
20358
20366
  },
20367
+ logSavedCardSelect: function logSavedCardSelect() {
20368
+ this.log.history.push({
20369
+ type: 'action',
20370
+ message: 'Selected saved card',
20371
+ time: this.getTimeSpent()
20372
+ });
20373
+ return this.saveLog();
20374
+ },
20359
20375
  logAuthWindowOpen: function logAuthWindowOpen() {
20360
20376
  this.log.history.push({
20361
20377
  type: 'action',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.25.0-dev.21",
3
+ "version": "1.25.0-dev.22",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",