cashfree-pg 4.2.2 → 4.3.0

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/common.d.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  import type { Configuration } from "./configuration";
13
13
  import type { RequestArgs } from "./base";
14
14
  import type { AxiosInstance, AxiosResponse } from 'axios';
15
+ import { CashfreeConfiguration } from "./api";
15
16
  /**
16
17
  *
17
18
  * @export
@@ -27,6 +28,11 @@ export declare const assertParamExists: (functionName: string, paramName: string
27
28
  * @export
28
29
  */
29
30
  export declare const setApiKeyToObject: (object: any, keyParamName: string) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setApiKeyToObjectWithConfiguration: (object: any, keyParamName: string, cashfreeConfiguration: CashfreeConfiguration) => Promise<void>;
30
36
  /**
31
37
  *
32
38
  * @export
package/dist/common.js CHANGED
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = void 0;
25
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObjectWithConfiguration = exports.setApiKeyToObject = exports.assertParamExists = void 0;
26
26
  const base_1 = require("./base");
27
27
  const api_1 = require("./api");
28
28
  /**
@@ -74,6 +74,40 @@ const setApiKeyToObject = function (object, keyParamName) {
74
74
  });
75
75
  };
76
76
  exports.setApiKeyToObject = setApiKeyToObject;
77
+ /**
78
+ *
79
+ * @export
80
+ */
81
+ const setApiKeyToObjectWithConfiguration = function (object, keyParamName, cashfreeConfiguration) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ if (keyParamName == "x-client-id") {
84
+ if (cashfreeConfiguration.XClientId != null && cashfreeConfiguration.XClientId != undefined) {
85
+ object[keyParamName] = cashfreeConfiguration.XClientId;
86
+ }
87
+ }
88
+ if (keyParamName == "x-client-secret") {
89
+ if (cashfreeConfiguration.XClientSecret != null && cashfreeConfiguration.XClientSecret != undefined) {
90
+ object[keyParamName] = cashfreeConfiguration.XClientSecret;
91
+ }
92
+ }
93
+ if (keyParamName == "x-partner-apikey") {
94
+ if (cashfreeConfiguration.XPartnerKey != null && cashfreeConfiguration.XPartnerKey != undefined) {
95
+ object[keyParamName] = cashfreeConfiguration.XPartnerKey;
96
+ }
97
+ }
98
+ if (keyParamName == "x-partner-merchantid") {
99
+ if (cashfreeConfiguration.XPartnerMerchantId != null && cashfreeConfiguration.XPartnerMerchantId != undefined) {
100
+ object[keyParamName] = cashfreeConfiguration.XPartnerMerchantId;
101
+ }
102
+ }
103
+ if (keyParamName == "x-client-signature") {
104
+ if (cashfreeConfiguration.XClientSignature != null && cashfreeConfiguration.XClientSignature != undefined) {
105
+ object[keyParamName] = cashfreeConfiguration.XClientSignature;
106
+ }
107
+ }
108
+ });
109
+ };
110
+ exports.setApiKeyToObjectWithConfiguration = setApiKeyToObjectWithConfiguration;
77
111
  /**
78
112
  *
79
113
  * @export