@paystack/checkout-js 1.15.0-dev.6 → 1.16.0-dev.1

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
@@ -1228,7 +1228,7 @@ var fails$q = fails$t;
1228
1228
  var classof$a = classofRaw$1;
1229
1229
 
1230
1230
  var Object$5 = global$Q.Object;
1231
- var split$3 = uncurryThis$t(''.split);
1231
+ var split$4 = uncurryThis$t(''.split);
1232
1232
 
1233
1233
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
1234
1234
  var indexedObject = fails$q(function () {
@@ -1236,7 +1236,7 @@ var indexedObject = fails$q(function () {
1236
1236
  // eslint-disable-next-line no-prototype-builtins -- safe
1237
1237
  return !Object$5('z').propertyIsEnumerable(0);
1238
1238
  }) ? function (it) {
1239
- return classof$a(it) == 'String' ? split$3(it, '') : Object$5(it);
1239
+ return classof$a(it) == 'String' ? split$4(it, '') : Object$5(it);
1240
1240
  } : Object$5;
1241
1241
 
1242
1242
  var global$P = global$R;
@@ -2278,7 +2278,7 @@ var classof$7 = classofRaw$1;
2278
2278
  // `IsArray` abstract operation
2279
2279
  // https://tc39.es/ecma262/#sec-isarray
2280
2280
  // eslint-disable-next-line es/no-array-isarray -- safe
2281
- var isArray$8 = Array.isArray || function isArray(argument) {
2281
+ var isArray$9 = Array.isArray || function isArray(argument) {
2282
2282
  return classof$7(argument) == 'Array';
2283
2283
  };
2284
2284
 
@@ -2376,7 +2376,7 @@ var isConstructor$3 = !construct || fails$h(function () {
2376
2376
  }) ? isConstructorLegacy : isConstructorModern;
2377
2377
 
2378
2378
  var global$u = global$R;
2379
- var isArray$7 = isArray$8;
2379
+ var isArray$8 = isArray$9;
2380
2380
  var isConstructor$2 = isConstructor$3;
2381
2381
  var isObject$8 = isObject$h;
2382
2382
  var wellKnownSymbol$f = wellKnownSymbol$j;
@@ -2388,10 +2388,10 @@ var Array$3 = global$u.Array;
2388
2388
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
2389
2389
  var arraySpeciesConstructor$1 = function (originalArray) {
2390
2390
  var C;
2391
- if (isArray$7(originalArray)) {
2391
+ if (isArray$8(originalArray)) {
2392
2392
  C = originalArray.constructor;
2393
2393
  // cross-realm fallback
2394
- if (isConstructor$2(C) && (C === Array$3 || isArray$7(C.prototype))) C = undefined;
2394
+ if (isConstructor$2(C) && (C === Array$3 || isArray$8(C.prototype))) C = undefined;
2395
2395
  else if (isObject$8(C)) {
2396
2396
  C = C[SPECIES$4];
2397
2397
  if (C === null) C = undefined;
@@ -2430,7 +2430,7 @@ var arrayMethodHasSpeciesSupport$3 = function (METHOD_NAME) {
2430
2430
  var $$h = _export;
2431
2431
  var global$t = global$R;
2432
2432
  var fails$f = fails$t;
2433
- var isArray$6 = isArray$8;
2433
+ var isArray$7 = isArray$9;
2434
2434
  var isObject$7 = isObject$h;
2435
2435
  var toObject$6 = toObject$8;
2436
2436
  var lengthOfArrayLike$4 = lengthOfArrayLike$7;
@@ -2459,7 +2459,7 @@ var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$2('concat');
2459
2459
  var isConcatSpreadable = function (O) {
2460
2460
  if (!isObject$7(O)) return false;
2461
2461
  var spreadable = O[IS_CONCAT_SPREADABLE];
2462
- return spreadable !== undefined ? !!spreadable : isArray$6(O);
2462
+ return spreadable !== undefined ? !!spreadable : isArray$7(O);
2463
2463
  };
2464
2464
 
2465
2465
  var FORCED$4 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
@@ -3458,7 +3458,7 @@ function isPublicKey(value) {
3458
3458
  function isValidEmail(value) {
3459
3459
  return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(value);
3460
3460
  }
3461
- function isArray$5(value) {
3461
+ function isArray$6(value) {
3462
3462
  return value instanceof Array;
3463
3463
  }
3464
3464
  function isInteger(value) {
@@ -3506,7 +3506,7 @@ var fields = {
3506
3506
  },
3507
3507
  channels: {
3508
3508
  required: false,
3509
- isValid: isArray$5
3509
+ isValid: isArray$6
3510
3510
  },
3511
3511
  currency: {
3512
3512
  required: false,
@@ -7141,7 +7141,7 @@ var charCodeAt$1 = uncurryThis$4(''.charCodeAt);
7141
7141
  var join$2 = uncurryThis$4([].join);
7142
7142
  var push$4 = uncurryThis$4([].push);
7143
7143
  var replace$4 = uncurryThis$4(''.replace);
7144
- var split$2 = uncurryThis$4(''.split);
7144
+ var split$3 = uncurryThis$4(''.split);
7145
7145
  var toLowerCase$1 = uncurryThis$4(''.toLowerCase);
7146
7146
 
7147
7147
  /**
@@ -7288,7 +7288,7 @@ var encode$2 = function (input) {
7288
7288
 
7289
7289
  var stringPunycodeToAscii = function (input) {
7290
7290
  var encoded = [];
7291
- var labels = split$2(replace$4(toLowerCase$1(input), regexSeparators, '\u002E'), '.');
7291
+ var labels = split$3(replace$4(toLowerCase$1(input), regexSeparators, '\u002E'), '.');
7292
7292
  var i, label;
7293
7293
  for (i = 0; i < labels.length; i++) {
7294
7294
  label = labels[i];
@@ -7348,7 +7348,7 @@ var push$3 = uncurryThis$3([].push);
7348
7348
  var replace$3 = uncurryThis$3(''.replace);
7349
7349
  var shift$1 = uncurryThis$3([].shift);
7350
7350
  var splice = uncurryThis$3([].splice);
7351
- var split$1 = uncurryThis$3(''.split);
7351
+ var split$2 = uncurryThis$3(''.split);
7352
7352
  var stringSlice$1 = uncurryThis$3(''.slice);
7353
7353
 
7354
7354
  var plus = /\+/g;
@@ -7453,13 +7453,13 @@ URLSearchParamsState.prototype = {
7453
7453
  },
7454
7454
  parseQuery: function (query) {
7455
7455
  if (query) {
7456
- var attributes = split$1(query, '&');
7456
+ var attributes = split$2(query, '&');
7457
7457
  var index = 0;
7458
7458
  var attribute, entry;
7459
7459
  while (index < attributes.length) {
7460
7460
  attribute = attributes[index++];
7461
7461
  if (attribute.length) {
7462
- entry = split$1(attribute, '=');
7462
+ entry = split$2(attribute, '=');
7463
7463
  push$3(this.entries, {
7464
7464
  key: deserialize(shift$1(entry)),
7465
7465
  value: deserialize(join$1(entry, '='))
@@ -7721,7 +7721,7 @@ var pop = uncurryThis$2([].pop);
7721
7721
  var push$2 = uncurryThis$2([].push);
7722
7722
  var replace$2 = uncurryThis$2(''.replace);
7723
7723
  var shift = uncurryThis$2([].shift);
7724
- var split = uncurryThis$2(''.split);
7724
+ var split$1 = uncurryThis$2(''.split);
7725
7725
  var stringSlice = uncurryThis$2(''.slice);
7726
7726
  var toLowerCase = uncurryThis$2(''.toLowerCase);
7727
7727
  var unshift = uncurryThis$2([].unshift);
@@ -7749,7 +7749,7 @@ var EOF;
7749
7749
 
7750
7750
  // https://url.spec.whatwg.org/#ipv4-number-parser
7751
7751
  var parseIPv4 = function (input) {
7752
- var parts = split(input, '.');
7752
+ var parts = split$1(input, '.');
7753
7753
  var partsLength, numbers, index, part, radix, number, ipv4;
7754
7754
  if (parts.length && parts[parts.length - 1] == '') {
7755
7755
  parts.length--;
@@ -8748,7 +8748,7 @@ var toString = Object.prototype.toString;
8748
8748
  * @param {Object} val The value to test
8749
8749
  * @returns {boolean} True if value is an Array, otherwise false
8750
8750
  */
8751
- function isArray$4(val) {
8751
+ function isArray$5(val) {
8752
8752
  return toString.call(val) === '[object Array]';
8753
8753
  }
8754
8754
 
@@ -8975,7 +8975,7 @@ function forEach(obj, fn) {
8975
8975
  obj = [obj];
8976
8976
  }
8977
8977
 
8978
- if (isArray$4(obj)) {
8978
+ if (isArray$5(obj)) {
8979
8979
  // Iterate over array values
8980
8980
  for (var i = 0, l = obj.length; i < l; i++) {
8981
8981
  fn.call(null, obj[i], i, obj);
@@ -9014,7 +9014,7 @@ function merge$1(/* obj1, obj2, obj3, ... */) {
9014
9014
  result[key] = merge$1(result[key], val);
9015
9015
  } else if (isPlainObject(val)) {
9016
9016
  result[key] = merge$1({}, val);
9017
- } else if (isArray$4(val)) {
9017
+ } else if (isArray$5(val)) {
9018
9018
  result[key] = val.slice();
9019
9019
  } else {
9020
9020
  result[key] = val;
@@ -9060,7 +9060,7 @@ function stripBOM(content) {
9060
9060
  }
9061
9061
 
9062
9062
  var utils$g = {
9063
- isArray: isArray$4,
9063
+ isArray: isArray$5,
9064
9064
  isArrayBuffer: isArrayBuffer,
9065
9065
  isBuffer: isBuffer$1,
9066
9066
  isFormData: isFormData,
@@ -10541,7 +10541,7 @@ axios$2.exports.default = axios$1;
10541
10541
  var axios = axios$2.exports;
10542
10542
 
10543
10543
  var has$2 = Object.prototype.hasOwnProperty;
10544
- var isArray$3 = Array.isArray;
10544
+ var isArray$4 = Array.isArray;
10545
10545
 
10546
10546
  var hexTable = (function () {
10547
10547
  var array = [];
@@ -10557,7 +10557,7 @@ var compactQueue = function compactQueue(queue) {
10557
10557
  var item = queue.pop();
10558
10558
  var obj = item.obj[item.prop];
10559
10559
 
10560
- if (isArray$3(obj)) {
10560
+ if (isArray$4(obj)) {
10561
10561
  var compacted = [];
10562
10562
 
10563
10563
  for (var j = 0; j < obj.length; ++j) {
@@ -10588,11 +10588,11 @@ var merge = function merge(target, source, options) {
10588
10588
  }
10589
10589
 
10590
10590
  if (typeof source !== 'object') {
10591
- if (isArray$3(target)) {
10591
+ if (isArray$4(target)) {
10592
10592
  target.push(source);
10593
10593
  } else if (target && typeof target === 'object') {
10594
10594
  if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
10595
- target[source] = true;
10595
+ target[source] = true; // eslint-disable-line no-param-reassign
10596
10596
  }
10597
10597
  } else {
10598
10598
  return [target, source];
@@ -10606,21 +10606,21 @@ var merge = function merge(target, source, options) {
10606
10606
  }
10607
10607
 
10608
10608
  var mergeTarget = target;
10609
- if (isArray$3(target) && !isArray$3(source)) {
10609
+ if (isArray$4(target) && !isArray$4(source)) {
10610
10610
  mergeTarget = arrayToObject(target, options);
10611
10611
  }
10612
10612
 
10613
- if (isArray$3(target) && isArray$3(source)) {
10613
+ if (isArray$4(target) && isArray$4(source)) {
10614
10614
  source.forEach(function (item, i) {
10615
10615
  if (has$2.call(target, i)) {
10616
10616
  var targetItem = target[i];
10617
10617
  if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
10618
- target[i] = merge(targetItem, item, options);
10618
+ target[i] = merge(targetItem, item, options); // eslint-disable-line no-param-reassign
10619
10619
  } else {
10620
10620
  target.push(item);
10621
10621
  }
10622
10622
  } else {
10623
- target[i] = item;
10623
+ target[i] = item; // eslint-disable-line no-param-reassign
10624
10624
  }
10625
10625
  });
10626
10626
  return target;
@@ -10630,9 +10630,9 @@ var merge = function merge(target, source, options) {
10630
10630
  var value = source[key];
10631
10631
 
10632
10632
  if (has$2.call(acc, key)) {
10633
- acc[key] = merge(acc[key], value, options);
10633
+ acc[key] = merge(acc[key], value, options); // eslint-disable-line no-param-reassign
10634
10634
  } else {
10635
- acc[key] = value;
10635
+ acc[key] = value; // eslint-disable-line no-param-reassign
10636
10636
  }
10637
10637
  return acc;
10638
10638
  }, mergeTarget);
@@ -10640,7 +10640,7 @@ var merge = function merge(target, source, options) {
10640
10640
 
10641
10641
  var assign = function assignSingleSource(target, source) {
10642
10642
  return Object.keys(source).reduce(function (acc, key) {
10643
- acc[key] = source[key];
10643
+ acc[key] = source[key]; // eslint-disable-line no-param-reassign
10644
10644
  return acc;
10645
10645
  }, target);
10646
10646
  };
@@ -10708,6 +10708,7 @@ var encode = function encode(str, defaultEncoder, charset) {
10708
10708
 
10709
10709
  i += 1;
10710
10710
  c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
10711
+ /* eslint operator-linebreak: [2, "before"] */
10711
10712
  out += hexTable[0xF0 | (c >> 18)]
10712
10713
  + hexTable[0x80 | ((c >> 12) & 0x3F)]
10713
10714
  + hexTable[0x80 | ((c >> 6) & 0x3F)]
@@ -10772,45 +10773,55 @@ var utils$2 = {
10772
10773
  var replace$1 = String.prototype.replace;
10773
10774
  var percentTwenties = /%20/g;
10774
10775
 
10775
- var formats$2 = {
10776
- 'default': 'RFC3986',
10777
- formatters: {
10778
- RFC1738: function (value) {
10779
- return replace$1.call(value, percentTwenties, '+');
10780
- },
10781
- RFC3986: function (value) {
10782
- return value;
10783
- }
10784
- },
10776
+ var util = utils$2;
10777
+
10778
+ var Format = {
10785
10779
  RFC1738: 'RFC1738',
10786
10780
  RFC3986: 'RFC3986'
10787
10781
  };
10788
10782
 
10783
+ var formats$2 = util.assign(
10784
+ {
10785
+ 'default': Format.RFC3986,
10786
+ formatters: {
10787
+ RFC1738: function (value) {
10788
+ return replace$1.call(value, percentTwenties, '+');
10789
+ },
10790
+ RFC3986: function (value) {
10791
+ return String(value);
10792
+ }
10793
+ }
10794
+ },
10795
+ Format
10796
+ );
10797
+
10789
10798
  var utils$1 = utils$2;
10790
10799
  var formats$1 = formats$2;
10791
10800
  var has$1 = Object.prototype.hasOwnProperty;
10792
10801
 
10793
10802
  var arrayPrefixGenerators = {
10794
- brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
10803
+ brackets: function brackets(prefix) {
10795
10804
  return prefix + '[]';
10796
10805
  },
10797
10806
  comma: 'comma',
10798
- indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
10807
+ indices: function indices(prefix, key) {
10799
10808
  return prefix + '[' + key + ']';
10800
10809
  },
10801
- repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
10810
+ repeat: function repeat(prefix) {
10802
10811
  return prefix;
10803
10812
  }
10804
10813
  };
10805
10814
 
10806
- var isArray$2 = Array.isArray;
10815
+ var isArray$3 = Array.isArray;
10816
+ var split = String.prototype.split;
10807
10817
  var push$1 = Array.prototype.push;
10808
10818
  var pushToArray = function (arr, valueOrArray) {
10809
- push$1.apply(arr, isArray$2(valueOrArray) ? valueOrArray : [valueOrArray]);
10819
+ push$1.apply(arr, isArray$3(valueOrArray) ? valueOrArray : [valueOrArray]);
10810
10820
  };
10811
10821
 
10812
10822
  var toISO = Date.prototype.toISOString;
10813
10823
 
10824
+ var defaultFormat = formats$1['default'];
10814
10825
  var defaults$1 = {
10815
10826
  addQueryPrefix: false,
10816
10827
  allowDots: false,
@@ -10820,17 +10831,18 @@ var defaults$1 = {
10820
10831
  encode: true,
10821
10832
  encoder: utils$1.encode,
10822
10833
  encodeValuesOnly: false,
10823
- formatter: formats$1.formatters[formats$1['default']],
10834
+ format: defaultFormat,
10835
+ formatter: formats$1.formatters[defaultFormat],
10824
10836
  // deprecated
10825
10837
  indices: false,
10826
- serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
10838
+ serializeDate: function serializeDate(date) {
10827
10839
  return toISO.call(date);
10828
10840
  },
10829
10841
  skipNulls: false,
10830
10842
  strictNullHandling: false
10831
10843
  };
10832
10844
 
10833
- var stringify$1 = function stringify( // eslint-disable-line func-name-matching
10845
+ var stringify$1 = function stringify(
10834
10846
  object,
10835
10847
  prefix,
10836
10848
  generateArrayPrefix,
@@ -10850,7 +10862,7 @@ var stringify$1 = function stringify( // eslint-disable-line func-name-matching
10850
10862
  obj = filter(prefix, obj);
10851
10863
  } else if (obj instanceof Date) {
10852
10864
  obj = serializeDate(obj);
10853
- } else if (generateArrayPrefix === 'comma' && isArray$2(obj)) {
10865
+ } else if (generateArrayPrefix === 'comma' && isArray$3(obj)) {
10854
10866
  obj = obj.join(',');
10855
10867
  }
10856
10868
 
@@ -10865,6 +10877,14 @@ var stringify$1 = function stringify( // eslint-disable-line func-name-matching
10865
10877
  if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils$1.isBuffer(obj)) {
10866
10878
  if (encoder) {
10867
10879
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset);
10880
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
10881
+ var valuesArray = split.call(String(obj), ',');
10882
+ var valuesJoined = '';
10883
+ for (var i = 0; i < valuesArray.length; ++i) {
10884
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset));
10885
+ }
10886
+ return [formatter(keyValue) + '=' + valuesJoined];
10887
+ }
10868
10888
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset))];
10869
10889
  }
10870
10890
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -10877,23 +10897,24 @@ var stringify$1 = function stringify( // eslint-disable-line func-name-matching
10877
10897
  }
10878
10898
 
10879
10899
  var objKeys;
10880
- if (isArray$2(filter)) {
10900
+ if (isArray$3(filter)) {
10881
10901
  objKeys = filter;
10882
10902
  } else {
10883
10903
  var keys = Object.keys(obj);
10884
10904
  objKeys = sort ? keys.sort(sort) : keys;
10885
10905
  }
10886
10906
 
10887
- for (var i = 0; i < objKeys.length; ++i) {
10888
- var key = objKeys[i];
10907
+ for (var j = 0; j < objKeys.length; ++j) {
10908
+ var key = objKeys[j];
10909
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
10889
10910
 
10890
10911
  if (skipNulls && obj[key] === null) {
10891
10912
  continue;
10892
10913
  }
10893
10914
 
10894
- if (isArray$2(obj)) {
10915
+ if (isArray$3(obj)) {
10895
10916
  pushToArray(values, stringify(
10896
- obj[key],
10917
+ value,
10897
10918
  typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
10898
10919
  generateArrayPrefix,
10899
10920
  strictNullHandling,
@@ -10909,7 +10930,7 @@ var stringify$1 = function stringify( // eslint-disable-line func-name-matching
10909
10930
  ));
10910
10931
  } else {
10911
10932
  pushToArray(values, stringify(
10912
- obj[key],
10933
+ value,
10913
10934
  prefix + (allowDots ? '.' + key : '[' + key + ']'),
10914
10935
  generateArrayPrefix,
10915
10936
  strictNullHandling,
@@ -10934,7 +10955,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
10934
10955
  return defaults$1;
10935
10956
  }
10936
10957
 
10937
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
10958
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
10938
10959
  throw new TypeError('Encoder has to be a function.');
10939
10960
  }
10940
10961
 
@@ -10953,7 +10974,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
10953
10974
  var formatter = formats$1.formatters[format];
10954
10975
 
10955
10976
  var filter = defaults$1.filter;
10956
- if (typeof opts.filter === 'function' || isArray$2(opts.filter)) {
10977
+ if (typeof opts.filter === 'function' || isArray$3(opts.filter)) {
10957
10978
  filter = opts.filter;
10958
10979
  }
10959
10980
 
@@ -10985,7 +11006,7 @@ var stringify_1 = function (object, opts) {
10985
11006
  if (typeof options.filter === 'function') {
10986
11007
  filter = options.filter;
10987
11008
  obj = filter('', obj);
10988
- } else if (isArray$2(options.filter)) {
11009
+ } else if (isArray$3(options.filter)) {
10989
11010
  filter = options.filter;
10990
11011
  objKeys = filter;
10991
11012
  }
@@ -11057,6 +11078,7 @@ var stringify_1 = function (object, opts) {
11057
11078
  var utils = utils$2;
11058
11079
 
11059
11080
  var has = Object.prototype.hasOwnProperty;
11081
+ var isArray$2 = Array.isArray;
11060
11082
 
11061
11083
  var defaults = {
11062
11084
  allowDots: false,
@@ -11082,6 +11104,25 @@ var interpretNumericEntities = function (str) {
11082
11104
  });
11083
11105
  };
11084
11106
 
11107
+ var parseArrayValue = function (val, options) {
11108
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
11109
+ return val.split(',');
11110
+ }
11111
+
11112
+ return val;
11113
+ };
11114
+
11115
+ var maybeMap = function maybeMap(val, fn) {
11116
+ if (isArray$2(val)) {
11117
+ var mapped = [];
11118
+ for (var i = 0; i < val.length; i += 1) {
11119
+ mapped.push(fn(val[i]));
11120
+ }
11121
+ return mapped;
11122
+ }
11123
+ return fn(val);
11124
+ };
11125
+
11085
11126
  // This is what browsers will submit when the ✓ character occurs in an
11086
11127
  // application/x-www-form-urlencoded body and the encoding of the page containing
11087
11128
  // the form is iso-8859-1, or when the submitted form has an accept-charset
@@ -11130,15 +11171,20 @@ var parseValues = function parseQueryStringValues(str, options) {
11130
11171
  val = options.strictNullHandling ? null : '';
11131
11172
  } else {
11132
11173
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset);
11133
- val = options.decoder(part.slice(pos + 1), defaults.decoder, charset);
11174
+ val = maybeMap(
11175
+ parseArrayValue(part.slice(pos + 1), options),
11176
+ function (encodedVal) {
11177
+ return options.decoder(encodedVal, defaults.decoder, charset);
11178
+ }
11179
+ );
11134
11180
  }
11135
11181
 
11136
11182
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
11137
11183
  val = interpretNumericEntities(val);
11138
11184
  }
11139
11185
 
11140
- if (val && options.comma && val.indexOf(',') > -1) {
11141
- val = val.split(',');
11186
+ if (part.indexOf('[]=') > -1) {
11187
+ val = isArray$2(val) ? [val] : val;
11142
11188
  }
11143
11189
 
11144
11190
  if (has.call(obj, key)) {
@@ -11151,8 +11197,8 @@ var parseValues = function parseQueryStringValues(str, options) {
11151
11197
  return obj;
11152
11198
  };
11153
11199
 
11154
- var parseObject = function (chain, val, options) {
11155
- var leaf = val;
11200
+ var parseObject = function (chain, val, options, valuesParsed) {
11201
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
11156
11202
 
11157
11203
  for (var i = chain.length - 1; i >= 0; --i) {
11158
11204
  var obj;
@@ -11175,18 +11221,18 @@ var parseObject = function (chain, val, options) {
11175
11221
  ) {
11176
11222
  obj = [];
11177
11223
  obj[index] = leaf;
11178
- } else {
11224
+ } else if (cleanRoot !== '__proto__') {
11179
11225
  obj[cleanRoot] = leaf;
11180
11226
  }
11181
11227
  }
11182
11228
 
11183
- leaf = obj;
11229
+ leaf = obj; // eslint-disable-line no-param-reassign
11184
11230
  }
11185
11231
 
11186
11232
  return leaf;
11187
11233
  };
11188
11234
 
11189
- var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
11235
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
11190
11236
  if (!givenKey) {
11191
11237
  return;
11192
11238
  }
@@ -11237,7 +11283,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
11237
11283
  keys.push('[' + key.slice(segment.index) + ']');
11238
11284
  }
11239
11285
 
11240
- return parseObject(keys, val, options);
11286
+ return parseObject(keys, val, options, valuesParsed);
11241
11287
  };
11242
11288
 
11243
11289
  var normalizeParseOptions = function normalizeParseOptions(opts) {
@@ -11250,7 +11296,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
11250
11296
  }
11251
11297
 
11252
11298
  if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
11253
- throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
11299
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
11254
11300
  }
11255
11301
  var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
11256
11302
 
@@ -11288,7 +11334,7 @@ var parse$1 = function (str, opts) {
11288
11334
  var keys = Object.keys(tempObj);
11289
11335
  for (var i = 0; i < keys.length; ++i) {
11290
11336
  var key = keys[i];
11291
- var newObj = parseKeys(key, tempObj[key], options);
11337
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
11292
11338
  obj = utils.merge(obj, newObj, options);
11293
11339
  }
11294
11340
 
@@ -19247,6 +19293,33 @@ var MobileMoneyAPI = {
19247
19293
  var response = _ref2.response;
19248
19294
  return ChargeResponses.parse(response.data);
19249
19295
  });
19296
+ },
19297
+ submitCode: function submitCode(_ref3) {
19298
+ var transaction = _ref3.transaction,
19299
+ phone = _ref3.phone,
19300
+ device = _ref3.device,
19301
+ channelName = _ref3.channel_name,
19302
+ provider = _ref3.provider,
19303
+ code = _ref3.code;
19304
+ var params = {
19305
+ transaction: transaction,
19306
+ phone: phone,
19307
+ device: device,
19308
+ channel_name: channelName,
19309
+ provider: provider,
19310
+ code: code
19311
+ };
19312
+ var language = getLanguage();
19313
+
19314
+ var headers = _objectSpread2({}, language && {
19315
+ 'Accept-Language': language
19316
+ });
19317
+
19318
+ return axiosInstance.post("".concat(configToUse.paystackApiUrl, "charge/submit_otp"), params, {
19319
+ headers: headers
19320
+ }).then(function (response) {
19321
+ return ChargeResponses.parse(response.data);
19322
+ });
19250
19323
  }
19251
19324
  };
19252
19325
 
@@ -19330,6 +19403,17 @@ var MobileMoneyCharge = {
19330
19403
  });
19331
19404
  });
19332
19405
  },
19406
+ submitCode: function submitCode(payload) {
19407
+ var _this3 = this;
19408
+
19409
+ return validate$1(payload.phoneNumber).then(function () {
19410
+ MobileMoneyAPI.submitCode(payload).then(function (response) {
19411
+ _this3.logAPIResponse(response, 'mobile_money');
19412
+
19413
+ return response;
19414
+ });
19415
+ });
19416
+ },
19333
19417
  listenForMobileMoneyCharge: function listenForMobileMoneyCharge(callback) {
19334
19418
  if (this.mobileMoney.status !== 'success') {
19335
19419
  return Promise.reject(Error('Please start a mobile money charge with Transaction.chargeMobileMoney()'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.15.0-dev.6",
3
+ "version": "1.16.0-dev.1",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",