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

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