@paystack/inline-js 2.13.0-dev.10 → 2.13.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/inline.js CHANGED
@@ -1448,25 +1448,32 @@ var PaystackPop = (function () {
1448
1448
  }
1449
1449
  };
1450
1450
 
1451
- /* eslint-env browser */
1451
+ var _excluded$1 = ["language"];
1452
1452
  var TransactionApi = {
1453
1453
  requestInline: function requestInline() {
1454
1454
  var inlineTransactionInstance = this;
1455
+
1456
+ var _this$urlParameters = this.urlParameters,
1457
+ language = _this$urlParameters.language,
1458
+ params = _objectWithoutProperties(_this$urlParameters, _excluded$1);
1459
+
1455
1460
  var request;
1456
1461
 
1462
+ var headers = _objectSpread2({
1463
+ 'Content-Type': 'application/json'
1464
+ }, language && {
1465
+ 'Accept-Language': language
1466
+ });
1467
+
1457
1468
  if (this.accessCode) {
1458
1469
  request = fetch(new URL("transaction/verify_access_code/".concat(this.accessCode), config.paystackApiUrl).toString(), {
1459
- headers: {
1460
- 'Content-Type': 'application/json'
1461
- }
1470
+ headers: headers
1462
1471
  });
1463
1472
  } else {
1464
1473
  request = fetch(new URL('/checkout/request_inline', config.paystackApiUrl).toString(), {
1465
1474
  method: 'POST',
1466
- body: JSON.stringify(this.urlParameters),
1467
- headers: {
1468
- 'Content-Type': 'application/json'
1469
- }
1475
+ body: JSON.stringify(params),
1476
+ headers: headers
1470
1477
  });
1471
1478
  }
1472
1479
 
package/es/inline.js CHANGED
@@ -1445,25 +1445,32 @@ var AnalyticsFunctions = {
1445
1445
  }
1446
1446
  };
1447
1447
 
1448
- /* eslint-env browser */
1448
+ var _excluded$1 = ["language"];
1449
1449
  var TransactionApi = {
1450
1450
  requestInline: function requestInline() {
1451
1451
  var inlineTransactionInstance = this;
1452
+
1453
+ var _this$urlParameters = this.urlParameters,
1454
+ language = _this$urlParameters.language,
1455
+ params = _objectWithoutProperties(_this$urlParameters, _excluded$1);
1456
+
1452
1457
  var request;
1453
1458
 
1459
+ var headers = _objectSpread2({
1460
+ 'Content-Type': 'application/json'
1461
+ }, language && {
1462
+ 'Accept-Language': language
1463
+ });
1464
+
1454
1465
  if (this.accessCode) {
1455
1466
  request = fetch(new URL("transaction/verify_access_code/".concat(this.accessCode), config.paystackApiUrl).toString(), {
1456
- headers: {
1457
- 'Content-Type': 'application/json'
1458
- }
1467
+ headers: headers
1459
1468
  });
1460
1469
  } else {
1461
1470
  request = fetch(new URL('/checkout/request_inline', config.paystackApiUrl).toString(), {
1462
1471
  method: 'POST',
1463
- body: JSON.stringify(this.urlParameters),
1464
- headers: {
1465
- 'Content-Type': 'application/json'
1466
- }
1472
+ body: JSON.stringify(params),
1473
+ headers: headers
1467
1474
  });
1468
1475
  }
1469
1476
 
package/lib/inline.js CHANGED
@@ -1447,25 +1447,32 @@ var AnalyticsFunctions = {
1447
1447
  }
1448
1448
  };
1449
1449
 
1450
- /* eslint-env browser */
1450
+ var _excluded$1 = ["language"];
1451
1451
  var TransactionApi = {
1452
1452
  requestInline: function requestInline() {
1453
1453
  var inlineTransactionInstance = this;
1454
+
1455
+ var _this$urlParameters = this.urlParameters,
1456
+ language = _this$urlParameters.language,
1457
+ params = _objectWithoutProperties(_this$urlParameters, _excluded$1);
1458
+
1454
1459
  var request;
1455
1460
 
1461
+ var headers = _objectSpread2({
1462
+ 'Content-Type': 'application/json'
1463
+ }, language && {
1464
+ 'Accept-Language': language
1465
+ });
1466
+
1456
1467
  if (this.accessCode) {
1457
1468
  request = fetch(new URL("transaction/verify_access_code/".concat(this.accessCode), config.paystackApiUrl).toString(), {
1458
- headers: {
1459
- 'Content-Type': 'application/json'
1460
- }
1469
+ headers: headers
1461
1470
  });
1462
1471
  } else {
1463
1472
  request = fetch(new URL('/checkout/request_inline', config.paystackApiUrl).toString(), {
1464
1473
  method: 'POST',
1465
- body: JSON.stringify(this.urlParameters),
1466
- headers: {
1467
- 'Content-Type': 'application/json'
1468
- }
1474
+ body: JSON.stringify(params),
1475
+ headers: headers
1469
1476
  });
1470
1477
  }
1471
1478
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/inline-js",
3
- "version": "2.13.0-dev.10",
3
+ "version": "2.13.0-dev.11",
4
4
  "description": "Client-side library to load the Paystack checkout form",
5
5
  "main": "lib/inline.js",
6
6
  "module": "es/inline.js",