@paystack/checkout-js 1.20.0-dev.1 → 1.20.0-dev.11

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/lib/checkout.js CHANGED
@@ -17238,7 +17238,55 @@ function encrypt(toEncrypt) {
17238
17238
  return jsEncrypt.encrypt(toEncrypt);
17239
17239
  }
17240
17240
 
17241
+ var DESCRIPTORS = descriptors;
17242
+ var uncurryThis$1 = functionUncurryThis;
17243
+ var objectKeys = objectKeys$3;
17244
+ var toIndexedObject = toIndexedObject$8;
17245
+ var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
17246
+
17247
+ var propertyIsEnumerable = uncurryThis$1($propertyIsEnumerable);
17248
+ var push = uncurryThis$1([].push);
17249
+
17250
+ // `Object.{ entries, values }` methods implementation
17251
+ var createMethod = function (TO_ENTRIES) {
17252
+ return function (it) {
17253
+ var O = toIndexedObject(it);
17254
+ var keys = objectKeys(O);
17255
+ var length = keys.length;
17256
+ var i = 0;
17257
+ var result = [];
17258
+ var key;
17259
+ while (length > i) {
17260
+ key = keys[i++];
17261
+ if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
17262
+ push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
17263
+ }
17264
+ }
17265
+ return result;
17266
+ };
17267
+ };
17268
+
17269
+ var objectToArray = {
17270
+ // `Object.entries` method
17271
+ // https://tc39.es/ecma262/#sec-object.entries
17272
+ entries: createMethod(true),
17273
+ // `Object.values` method
17274
+ // https://tc39.es/ecma262/#sec-object.values
17275
+ values: createMethod(false)
17276
+ };
17277
+
17241
17278
  var $$2 = _export;
17279
+ var $values = objectToArray.values;
17280
+
17281
+ // `Object.values` method
17282
+ // https://tc39.es/ecma262/#sec-object.values
17283
+ $$2({ target: 'Object', stat: true }, {
17284
+ values: function values(O) {
17285
+ return $values(O);
17286
+ }
17287
+ });
17288
+
17289
+ var $$1 = _export;
17242
17290
  var $find = arrayIteration.find;
17243
17291
  var addToUnscopables = addToUnscopables$3;
17244
17292
 
@@ -17250,7 +17298,7 @@ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
17250
17298
 
17251
17299
  // `Array.prototype.find` method
17252
17300
  // https://tc39.es/ecma262/#sec-array.prototype.find
17253
- $$2({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
17301
+ $$1({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
17254
17302
  find: function find(callbackfn /* , that = undefined */) {
17255
17303
  return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
17256
17304
  }
@@ -18198,54 +18246,69 @@ var cardValidator = {
18198
18246
  creditCardType: creditCardType_1
18199
18247
  };
18200
18248
 
18201
- var DESCRIPTORS = descriptors;
18202
- var uncurryThis$1 = functionUncurryThis;
18203
- var objectKeys = objectKeys$3;
18204
- var toIndexedObject = toIndexedObject$8;
18205
- var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
18206
-
18207
- var propertyIsEnumerable = uncurryThis$1($propertyIsEnumerable);
18208
- var push = uncurryThis$1([].push);
18209
-
18210
- // `Object.{ entries, values }` methods implementation
18211
- var createMethod = function (TO_ENTRIES) {
18212
- return function (it) {
18213
- var O = toIndexedObject(it);
18214
- var keys = objectKeys(O);
18215
- var length = keys.length;
18216
- var i = 0;
18217
- var result = [];
18218
- var key;
18219
- while (length > i) {
18220
- key = keys[i++];
18221
- if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
18222
- push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
18223
- }
18224
- }
18225
- return result;
18226
- };
18227
- };
18249
+ var testCards = [{
18250
+ type: 'bank_auth',
18251
+ name: 'Bank authorization',
18252
+ number: '4084080000000409',
18253
+ cvv: '000',
18254
+ month: '01',
18255
+ year: '30'
18256
+ }, {
18257
+ type: 'success',
18258
+ name: 'Success',
18259
+ number: '4084084084084081',
18260
+ cvv: '408',
18261
+ month: '12',
18262
+ year: '30'
18263
+ }, {
18264
+ type: 'declined',
18265
+ name: 'Declined',
18266
+ number: '4084080000005408',
18267
+ cvv: '001',
18268
+ month: '12',
18269
+ year: '30'
18270
+ }, {
18271
+ type: 'pin',
18272
+ name: 'Pin only validation',
18273
+ number: '507850785078507812',
18274
+ cvv: '884',
18275
+ month: '01',
18276
+ year: '30'
18277
+ }, {
18278
+ type: 'pin+otp',
18279
+ name: 'Pin and OTP validation',
18280
+ number: '5060666666666666666',
18281
+ cvv: '123',
18282
+ month: '01',
18283
+ year: '30'
18284
+ }, {
18285
+ type: 'pin+phone+otp',
18286
+ name: 'Pin, phone and OTP validation',
18287
+ number: '507850785078507812',
18288
+ cvv: '884',
18289
+ month: '01',
18290
+ year: '30'
18291
+ }, {
18292
+ type: 'default',
18293
+ name: 'No validation',
18294
+ number: '4084084084084081',
18295
+ cvv: '408',
18296
+ month: '01',
18297
+ year: '30'
18298
+ }];
18228
18299
 
18229
- var objectToArray = {
18230
- // `Object.entries` method
18231
- // https://tc39.es/ecma262/#sec-object.entries
18232
- entries: createMethod(true),
18233
- // `Object.values` method
18234
- // https://tc39.es/ecma262/#sec-object.values
18235
- values: createMethod(false)
18236
- };
18237
-
18238
- var $$1 = _export;
18239
- var $values = objectToArray.values;
18240
-
18241
- // `Object.values` method
18242
- // https://tc39.es/ecma262/#sec-object.values
18243
- $$1({ target: 'Object', stat: true }, {
18244
- values: function values(O) {
18245
- return $values(O);
18300
+ cardValidator.creditCardType.addCard({
18301
+ niceType: 'Verve',
18302
+ type: 'verve',
18303
+ patterns: [[506000, 507999], [650000, 650009]],
18304
+ gaps: [4, 8, 12, 16],
18305
+ lengths: [16, 18, 19],
18306
+ code: {
18307
+ name: 'CVV',
18308
+ size: 3
18246
18309
  }
18247
18310
  });
18248
-
18311
+ cardValidator.creditCardType.changeOrder('verve', 0);
18249
18312
  var Card$2 = {
18250
18313
  getEncryptedPin: function getEncryptedPin(pin) {
18251
18314
  return pin ? encrypt(pin) : undefined;
@@ -18316,7 +18379,7 @@ var Card$2 = {
18316
18379
  return Card$2.validateCVV(cvv, cardType).isValid;
18317
18380
  },
18318
18381
  validateExpiry: function validateExpiry(value) {
18319
- if (_typeof$1(value) === 'object') {
18382
+ if (value !== null && _typeof$1(value) === 'object') {
18320
18383
  var month = value.month,
18321
18384
  year = value.year;
18322
18385
  return cardValidator.expirationMonth(month) && cardValidator.expirationYear(year);
@@ -18326,22 +18389,15 @@ var Card$2 = {
18326
18389
  },
18327
18390
  isExpiryValid: function isExpiryValid(value) {
18328
18391
  return Card$2.validateExpiry(value).isValid;
18392
+ },
18393
+ findTestCard: function findTestCard(cardType) {
18394
+ var type = cardType || 'default';
18395
+ return testCards.find(function (card) {
18396
+ return card.type === type;
18397
+ });
18329
18398
  }
18330
18399
  };
18331
18400
 
18332
- cardValidator.creditCardType.addCard({
18333
- niceType: 'Verve',
18334
- type: 'verve',
18335
- patterns: [[506000, 507999], [650000, 650009]],
18336
- gaps: [4, 8, 12, 16],
18337
- lengths: [16, 18, 19],
18338
- code: {
18339
- name: 'CVV',
18340
- size: 3
18341
- }
18342
- });
18343
- cardValidator.creditCardType.changeOrder('verve', 0);
18344
-
18345
18401
  var Card$1 = /*#__PURE__*/function () {
18346
18402
  function Card(_ref) {
18347
18403
  var number = _ref.number,
@@ -18431,11 +18487,7 @@ var Card$1 = /*#__PURE__*/function () {
18431
18487
  }, {
18432
18488
  key: "generateTestCard",
18433
18489
  value: function generateTestCard(cardType) {
18434
- var type = cardType || 'default';
18435
- var cardParams = testCards.find(function (card) {
18436
- return card.type === type;
18437
- });
18438
- return new Card(cardParams);
18490
+ return new Card(Card$2.findTestCard(cardType));
18439
18491
  }
18440
18492
  }]);
18441
18493
 
@@ -18619,7 +18671,7 @@ var CardAPI$1 = {
18619
18671
  return ChargeResponses.parse(response.data);
18620
18672
  });
18621
18673
  },
18622
- requestSavedCardsOTP: function requestSavedCardsOTP(phoneNumber) {
18674
+ sendSavedCardsOTP: function sendSavedCardsOTP(email) {
18623
18675
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
18624
18676
  var url, language, headers, _yield$axiosInstance$, data;
18625
18677
 
@@ -18627,13 +18679,15 @@ var CardAPI$1 = {
18627
18679
  while (1) {
18628
18680
  switch (_context.prev = _context.next) {
18629
18681
  case 0:
18630
- url = new URL("/authorize/".concat(phoneNumber), configToUse.savedCardsApiUrl).toString();
18682
+ url = new URL("/authorize", configToUse.savedCardsApiUrl).toString();
18631
18683
  language = getLanguage();
18632
18684
  headers = _objectSpread2({}, language && {
18633
18685
  'Accept-Language': language
18634
18686
  });
18635
18687
  _context.next = 5;
18636
18688
  return axiosInstance.post(url, {
18689
+ email: email
18690
+ }, {
18637
18691
  headers: headers
18638
18692
  });
18639
18693
 
@@ -18686,12 +18740,12 @@ var CardAPI$1 = {
18686
18740
  },
18687
18741
  verifySavedCardsOtp: function verifySavedCardsOtp(_ref7) {
18688
18742
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
18689
- var code, phone, transaction, url, language, headers, data, response;
18743
+ var code, transaction, url, language, headers, data, response;
18690
18744
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
18691
18745
  while (1) {
18692
18746
  switch (_context3.prev = _context3.next) {
18693
18747
  case 0:
18694
- code = _ref7.code, phone = _ref7.phone, transaction = _ref7.transaction;
18748
+ code = _ref7.code, transaction = _ref7.transaction;
18695
18749
  url = new URL('/authorize/verify', configToUse.savedCardsApiUrl).toString();
18696
18750
  language = getLanguage();
18697
18751
  headers = _objectSpread2({}, language && {
@@ -18699,7 +18753,6 @@ var CardAPI$1 = {
18699
18753
  });
18700
18754
  data = {
18701
18755
  code: code,
18702
- phone: phone,
18703
18756
  transaction: transaction
18704
18757
  };
18705
18758
  _context3.next = 7;
@@ -19000,8 +19053,8 @@ var CardCharge = {
19000
19053
  };
19001
19054
  return this.listenForCharge(listenerOptions, callback);
19002
19055
  },
19003
- requestSavedCardsOTP: function requestSavedCardsOTP(phoneNumber) {
19004
- return CardAPI$1.requestSavedCardsOTP(phoneNumber);
19056
+ sendSavedCardsOTP: function sendSavedCardsOTP() {
19057
+ return CardAPI$1.sendSavedCardsOTP(this.email);
19005
19058
  },
19006
19059
  addUserToSavedCards: function addUserToSavedCards(_ref4) {
19007
19060
  var phone = _ref4.phone;
@@ -19014,15 +19067,14 @@ var CardCharge = {
19014
19067
  var _this9 = this;
19015
19068
 
19016
19069
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
19017
- var code, phone, payload, response;
19070
+ var code, payload, response;
19018
19071
  return regeneratorRuntime.wrap(function _callee$(_context) {
19019
19072
  while (1) {
19020
19073
  switch (_context.prev = _context.next) {
19021
19074
  case 0:
19022
- code = _ref5.code, phone = _ref5.phone;
19075
+ code = _ref5.code;
19023
19076
  payload = {
19024
19077
  code: code,
19025
- phone: phone,
19026
19078
  transaction: _this9.id
19027
19079
  };
19028
19080
  _context.prev = 2;
@@ -20738,19 +20790,6 @@ var Toolkit = /*#__PURE__*/function () {
20738
20790
  return Toolkit;
20739
20791
  }();
20740
20792
 
20741
- cardValidator.creditCardType.addCard({
20742
- niceType: 'Verve',
20743
- type: 'verve',
20744
- patterns: [[506000, 507999], [650000, 650009]],
20745
- gaps: [4, 8, 12, 16],
20746
- lengths: [16, 18, 19],
20747
- code: {
20748
- name: 'CVV',
20749
- size: 3
20750
- }
20751
- });
20752
- cardValidator.creditCardType.changeOrder('verve', 0);
20753
-
20754
20793
  var Card = /*#__PURE__*/function () {
20755
20794
  function Card(_ref) {
20756
20795
  var number = _ref.number,
@@ -20840,11 +20879,7 @@ var Card = /*#__PURE__*/function () {
20840
20879
  }, {
20841
20880
  key: "generateTestCard",
20842
20881
  value: function generateTestCard(cardType) {
20843
- var type = cardType || 'default';
20844
- var cardParams = testCards.find(function (card) {
20845
- return card.type === type;
20846
- });
20847
- return new Card(cardParams);
20882
+ return new Card(Card$2.findTestCard(cardType));
20848
20883
  }
20849
20884
  }]);
20850
20885
 
@@ -20855,11 +20890,14 @@ var CardAPI = {
20855
20890
  reserve: function reserve(_ref) {
20856
20891
  var clientdata = _ref.clientdata,
20857
20892
  last4 = _ref.last4,
20858
- preauthorizationId = _ref.preauthorizationId;
20893
+ preauthorizationId = _ref.preauthorizationId,
20894
+ publicKey = _ref.publicKey;
20859
20895
  var url = "".concat(configToUse.paystackApiUrl, "preauthorization/reserve");
20860
20896
  var language = getLanguage();
20861
20897
 
20862
- var headers = _objectSpread2({}, language && {
20898
+ var headers = _objectSpread2({
20899
+ Authorization: "Bearer ".concat(publicKey)
20900
+ }, language && {
20863
20901
  'Accept-Language': language
20864
20902
  });
20865
20903
 
@@ -20872,120 +20910,7 @@ var CardAPI = {
20872
20910
  }).then(function (response) {
20873
20911
  return ChargeResponses.parse(response.data);
20874
20912
  });
20875
- } // charge({
20876
- // clientdata,
20877
- // last4,
20878
- // pin,
20879
- // trans,
20880
- // device,
20881
- // rememberCard,
20882
- // transactionType,
20883
- // subscription,
20884
- // customFields,
20885
- // }) {
20886
- // const url = `${config.paymentBaseUrl}charge/`;
20887
- // const language = getLanguage();
20888
- // const headers = {
20889
- // 'Content-Type': 'application/x-www-form-urlencoded',
20890
- // ...(language && { 'Accept-Language': language }),
20891
- // };
20892
- // const chargeParams = {
20893
- // clientdata,
20894
- // last4,
20895
- // trans,
20896
- // device,
20897
- // offset: new Date().getTimezoneOffset(),
20898
- // remember_card: rememberCard,
20899
- // ...(transactionType && { transaction_type: transactionType }),
20900
- // ...(subscription && { subscription }),
20901
- // ...(customFields && customFields),
20902
- // };
20903
- // if (pin) {
20904
- // chargeParams.handle = pin;
20905
- // }
20906
- // const urlEncodedParams = formurlencoded(chargeParams);
20907
- // return axiosInstance
20908
- // .post(url, urlEncodedParams, { headers })
20909
- // .then((response) => ChargeResponses.parse(response.data));
20910
- // },
20911
- // resumeCardCharge({ device, accessCode, pin }) {
20912
- // const url = `${config.paymentBaseUrl}charge/resume/${accessCode}`;
20913
- // const language = getLanguage();
20914
- // const headers = {
20915
- // 'Content-Type': 'application/x-www-form-urlencoded',
20916
- // ...(language && { 'Accept-Language': language }),
20917
- // };
20918
- // const data = { device, ...(pin && { handle: pin }) };
20919
- // const urlEncodedData = formurlencoded(data);
20920
- // return axiosInstance
20921
- // .post(url, urlEncodedData, { headers })
20922
- // .then((response) => ChargeResponses.parse(response.data));
20923
- // },
20924
- // chargeRememberedCard({
20925
- // last4,
20926
- // trans,
20927
- // device,
20928
- // authorizationCode,
20929
- // cvv,
20930
- // pin,
20931
- // transactionType,
20932
- // subscription,
20933
- // }) {
20934
- // const url = `${config.paymentBaseUrl}charge/`;
20935
- // const language = getLanguage();
20936
- // const headers = {
20937
- // 'Content-Type': 'application/x-www-form-urlencoded',
20938
- // ...(language && { 'Accept-Language': language }),
20939
- // };
20940
- // const chargeParams = {
20941
- // last4,
20942
- // trans,
20943
- // device,
20944
- // cvv,
20945
- // handle: pin,
20946
- // authorization_code: authorizationCode,
20947
- // ...(transactionType && { transaction_type: transactionType }),
20948
- // ...(subscription && { subscription }),
20949
- // };
20950
- // const urlEncodedParams = formurlencoded(chargeParams);
20951
- // return axiosInstance
20952
- // .post(url, urlEncodedParams, { headers })
20953
- // .then((response) => ChargeResponses.parse(response.data));
20954
- // },
20955
- // verifyAddress({ address, city, state, zipCode, transactionId }) {
20956
- // const url = `${config.paymentBaseUrl}charge/avs`;
20957
- // const language = getLanguage();
20958
- // const headers = {
20959
- // 'Content-Type': 'application/x-www-form-urlencoded',
20960
- // ...(language && { 'Accept-Language': language }),
20961
- // };
20962
- // const data = {
20963
- // city,
20964
- // state,
20965
- // address,
20966
- // zip_code: zipCode,
20967
- // trans: transactionId,
20968
- // };
20969
- // const urlEncodedData = formurlencoded(data);
20970
- // return axiosInstance
20971
- // .post(url, urlEncodedData, { headers })
20972
- // .then((response) => ChargeResponses.parse(response.data));
20973
- // },
20974
- // forgetRememberedCard({ authorizationId, publicKey }) {
20975
- // const language = getLanguage();
20976
- // const headers = {
20977
- // Authorization: `Bearer ${publicKey}`,
20978
- // ...(language && { 'Accept-Language': language }),
20979
- // };
20980
- // const params = {
20981
- // authorization_id: authorizationId,
20982
- // };
20983
- // const url = `${config.paystackApiUrl}rememberme/forget_card`;
20984
- // return axiosInstance
20985
- // .post(url, params, { headers })
20986
- // .then((response) => ChargeResponses.parse(response.data));
20987
- // },
20988
-
20913
+ }
20989
20914
  };
20990
20915
 
20991
20916
  var paymentMethod = 'card';
@@ -21007,7 +20932,7 @@ function validate(card, isSetter) {
21007
20932
  });
21008
20933
  }
21009
20934
 
21010
- var ReserveCardFunds = {
20935
+ var CardPreauthorization = {
21011
20936
  setCard: function setCard(params) {
21012
20937
  var _this = this;
21013
20938
 
@@ -21015,20 +20940,24 @@ var ReserveCardFunds = {
21015
20940
  _this.card = new Card(params);
21016
20941
  });
21017
20942
  },
21018
- reserve: function reserve(preauthorizationId) {
20943
+ reserve: function reserve(_ref) {
21019
20944
  var _this2 = this;
21020
20945
 
21021
- var customFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20946
+ var preauthorizationId = _ref.preauthorizationId,
20947
+ publicKey = _ref.publicKey,
20948
+ _ref$customFields = _ref.customFields,
20949
+ customFields = _ref$customFields === void 0 ? {} : _ref$customFields;
21022
20950
  // TODO: Log payment method
21023
20951
  // https://paystack.atlassian.net/browse/RAILS-3070
21024
20952
  return validate(this.card).then(function () {
21025
20953
  var chargeParams = {
21026
20954
  clientdata: _this2.card.tokenize(),
21027
20955
  last4: _this2.card.getLast4(),
21028
- preauthorization: preauthorizationId,
20956
+ preauthorizationId: preauthorizationId,
20957
+ publicKey: publicKey,
21029
20958
  customFields: customFields
21030
20959
  };
21031
- return CardAPI.charge(chargeParams).then(function (response) {
20960
+ return CardAPI.reserve(chargeParams).then(function (response) {
21032
20961
  // TODO: Log API Response
21033
20962
  // https://paystack.atlassian.net/browse/RAILS-3070
21034
20963
  return response;
@@ -21041,118 +20970,14 @@ var ReserveCardFunds = {
21041
20970
  paymentMethod: paymentMethod
21042
20971
  };
21043
20972
  return this.listenForCharge(listenerOptions, callback);
21044
- } // rememberCard() {
21045
- // this.remember_card = true;
21046
- // },
21047
- // chargeCard(customFields = {}) {
21048
- // if (!this.card.number && this.card.pin) {
21049
- // return this.chargeCardWithPin(customFields);
21050
- // }
21051
- // return validate(this.card).then(() => {
21052
- // this.logAttempt(paymentMethod);
21053
- // const chargeParams = {
21054
- // clientdata: this.card.tokenize(),
21055
- // last4: this.card.getLast4(),
21056
- // pin: this.card.getEncryptedPin(),
21057
- // trans: this.id,
21058
- // device: this.deviceFingerprint,
21059
- // rememberCard: this.remember_card,
21060
- // transactionType: this.transactionType,
21061
- // subscription: this.subscription,
21062
- // customFields,
21063
- // };
21064
- // return CardAPI.charge(chargeParams).then((response) => {
21065
- // this.logAPIResponse(response, paymentMethod);
21066
- // return response;
21067
- // });
21068
- // });
21069
- // },
21070
-
21071
- /**
21072
- * Handles submitting a card pin after
21073
- * other card details have been previously submitted.
21074
- */
21075
- // chargeCardWithPin(customFields = {}) {
21076
- // this.logAttempt(paymentMethod);
21077
- // const chargeParams = {
21078
- // pin: encrypt(this.card.pin),
21079
- // trans: this.id,
21080
- // device: this.deviceFingerprint,
21081
- // rememberCard: this.remember_card,
21082
- // transactionType: this.transactionType,
21083
- // subscription: this.subscription,
21084
- // customFields,
21085
- // };
21086
- // return CardAPI.charge(chargeParams).then((response) => {
21087
- // this.logAPIResponse(response, paymentMethod);
21088
- // return response;
21089
- // });
21090
- // },
21091
- // chargeRememberedCard({ cvv, authorizationCode, cardLast4, pin }) {
21092
- // this.logAttempt(paymentMethod);
21093
- // const encryptedPin = encrypt(pin);
21094
- // const chargeParams = {
21095
- // authorizationCode,
21096
- // cvv,
21097
- // last4: cardLast4,
21098
- // trans: this.id,
21099
- // device: this.deviceFingerprint,
21100
- // pin: encryptedPin,
21101
- // transactionType: this.transactionType,
21102
- // subscription: this.subscription,
21103
- // };
21104
- // return CardAPI.chargeRememberedCard(chargeParams).then((response) => {
21105
- // this.logAPIResponse(response, paymentMethod);
21106
- // return response;
21107
- // });
21108
- // },
21109
- // resumeCardCharge({ accessCode, pin }) {
21110
- // const params = {
21111
- // ...(pin && { pin: encrypt(pin) }),
21112
- // accessCode,
21113
- // device: this.deviceFingerprint,
21114
- // };
21115
- // return CardAPI.resumeCardCharge(params).then((response) => {
21116
- // this.logAPIResponse(response, paymentMethod);
21117
- // return response;
21118
- // });
21119
- // },
21120
- // forgetRememberedCard(authorizationId) {
21121
- // const params = {
21122
- // authorizationId,
21123
- // publicKey: this.merchant.key,
21124
- // };
21125
- // return CardAPI.forgetRememberedCard(params).then((response) => {
21126
- // this.logAPIResponse(response, paymentMethod);
21127
- // return response;
21128
- // });
21129
- // },
21130
- // authenticateCard(token) {
21131
- // return CardAPI.authenticate(this.id, token).then((response) => {
21132
- // this.logAPIResponse(response, paymentMethod);
21133
- // return response;
21134
- // });
21135
- // },
21136
- // verifyAddress({ address, city, state, zipCode }) {
21137
- // const payload = {
21138
- // city,
21139
- // state,
21140
- // address,
21141
- // zipCode,
21142
- // transactionId: this.id,
21143
- // };
21144
- // return CardAPI.verifyAddress(payload).then((response) => {
21145
- // this.logAPIResponse(response, paymentMethod);
21146
- // return response;
21147
- // });
21148
- // },
21149
-
20973
+ }
21150
20974
  };
21151
20975
 
21152
20976
  var PreauthorizationInstance = /*#__PURE__*/function () {
21153
20977
  function PreauthorizationInstance(data) {
21154
20978
  _classCallCheck(this, PreauthorizationInstance);
21155
20979
 
20980
+ this.id = data.id;
21156
20981
  this.email = data.email;
21157
20982
  this.status = data.status;
21158
20983
  this.reference = data.reference;
@@ -21168,10 +20993,11 @@ var PreauthorizationInstance = /*#__PURE__*/function () {
21168
20993
  name: data.merchant_name,
21169
20994
  key: data.merchant_key
21170
20995
  };
20996
+ this.card = {};
21171
20997
  loadPusher(); // TODO: Analytics
21172
20998
  // https://paystack.atlassian.net/browse/RAILS-3070
21173
20999
 
21174
- Object.assign(this, ReserveCardFunds);
21000
+ Object.assign(this, CardPreauthorization);
21175
21001
  }
21176
21002
 
21177
21003
  _createClass(PreauthorizationInstance, [{
@@ -21205,8 +21031,6 @@ var PreauthorisationAPI = {
21205
21031
  });
21206
21032
  },
21207
21033
  requery: function requery() {// TODO: https://paystack.atlassian.net/browse/RAILS-2890
21208
- },
21209
- reserveFunds: function reserveFunds() {// TODO: https://paystack.atlassian.net/browse/RAILS-2887
21210
21034
  }
21211
21035
  };
21212
21036
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.20.0-dev.1",
3
+ "version": "1.20.0-dev.11",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",