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