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.
@@ -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
@@ -69,6 +69,39 @@ export const setApiKeyToObject = function (object, keyParamName) {
69
69
  }
70
70
  });
71
71
  };
72
+ /**
73
+ *
74
+ * @export
75
+ */
76
+ export const setApiKeyToObjectWithConfiguration = function (object, keyParamName, cashfreeConfiguration) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ if (keyParamName == "x-client-id") {
79
+ if (cashfreeConfiguration.XClientId != null && cashfreeConfiguration.XClientId != undefined) {
80
+ object[keyParamName] = cashfreeConfiguration.XClientId;
81
+ }
82
+ }
83
+ if (keyParamName == "x-client-secret") {
84
+ if (cashfreeConfiguration.XClientSecret != null && cashfreeConfiguration.XClientSecret != undefined) {
85
+ object[keyParamName] = cashfreeConfiguration.XClientSecret;
86
+ }
87
+ }
88
+ if (keyParamName == "x-partner-apikey") {
89
+ if (cashfreeConfiguration.XPartnerKey != null && cashfreeConfiguration.XPartnerKey != undefined) {
90
+ object[keyParamName] = cashfreeConfiguration.XPartnerKey;
91
+ }
92
+ }
93
+ if (keyParamName == "x-partner-merchantid") {
94
+ if (cashfreeConfiguration.XPartnerMerchantId != null && cashfreeConfiguration.XPartnerMerchantId != undefined) {
95
+ object[keyParamName] = cashfreeConfiguration.XPartnerMerchantId;
96
+ }
97
+ }
98
+ if (keyParamName == "x-client-signature") {
99
+ if (cashfreeConfiguration.XClientSignature != null && cashfreeConfiguration.XClientSignature != undefined) {
100
+ object[keyParamName] = cashfreeConfiguration.XClientSignature;
101
+ }
102
+ }
103
+ });
104
+ };
72
105
  /**
73
106
  *
74
107
  * @export
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cashfree-pg",
3
- "version": "4.2.2",
3
+ "version": "4.3.0",
4
4
  "description": "Cashfree client for cashfree-pg",
5
5
  "author": "Cashfree Payments",
6
6
  "repository": {