@emilgroup/payment-sdk 1.6.1-beta.6 → 1.6.1-beta.7

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/README.md CHANGED
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
17
17
  Navigate to the folder of your consuming project and run one of the following commands:
18
18
 
19
19
  ```
20
- npm install @emilgroup/payment-sdk@1.6.1-beta.6 --save
20
+ npm install @emilgroup/payment-sdk@1.6.1-beta.7 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/payment-sdk@1.6.1-beta.6
24
+ yarn add @emilgroup/payment-sdk@1.6.1-beta.7
25
25
  ```
26
26
 
27
27
  And then you can import `PaymentsApi`.
@@ -32,16 +32,19 @@ export const WebhooksApiAxiosParamCreator = function (configuration?: Configurat
32
32
  * @param {string} pspType The type of the payment service provider (PSP).<br/> <br/> <i>Supported PSP: braintree, stripe, b4u, eis, adyen</i>
33
33
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
34
34
  * @param {string} productSlug
35
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
35
36
  * @param {*} [options] Override http request option.
36
37
  * @throws {RequiredError}
37
38
  */
38
- postWebhook: async (pspType: string, tenantSlug: string, productSlug: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
39
+ postWebhook: async (pspType: string, tenantSlug: string, productSlug: string, body: object, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
39
40
  // verify required parameter 'pspType' is not null or undefined
40
41
  assertParamExists('postWebhook', 'pspType', pspType)
41
42
  // verify required parameter 'tenantSlug' is not null or undefined
42
43
  assertParamExists('postWebhook', 'tenantSlug', tenantSlug)
43
44
  // verify required parameter 'productSlug' is not null or undefined
44
45
  assertParamExists('postWebhook', 'productSlug', productSlug)
46
+ // verify required parameter 'body' is not null or undefined
47
+ assertParamExists('postWebhook', 'body', body)
45
48
  const localVarPath = `/paymentservice/v1/webhooks/{pspType}/{tenantSlug}/{productSlug}`
46
49
  .replace(`{${"pspType"}}`, encodeURIComponent(String(pspType)))
47
50
  .replace(`{${"tenantSlug"}}`, encodeURIComponent(String(tenantSlug)))
@@ -61,9 +64,12 @@ export const WebhooksApiAxiosParamCreator = function (configuration?: Configurat
61
64
 
62
65
 
63
66
 
67
+ localVarHeaderParameter['Content-Type'] = 'application/json';
68
+
64
69
  setSearchParams(localVarUrlObj, localVarQueryParameter);
65
70
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
66
71
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
72
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
67
73
 
68
74
  return {
69
75
  url: toPathString(localVarUrlObj),
@@ -86,11 +92,12 @@ export const WebhooksApiFp = function(configuration?: Configuration) {
86
92
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
87
93
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
88
94
  * @param {string} productSlug
95
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
89
96
  * @param {*} [options] Override http request option.
90
97
  * @throws {RequiredError}
91
98
  */
92
- async postWebhook(pspType: string, tenantSlug: string, productSlug: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
93
- const localVarAxiosArgs = await localVarAxiosParamCreator.postWebhook(pspType, tenantSlug, productSlug, options);
99
+ async postWebhook(pspType: string, tenantSlug: string, productSlug: string, body: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
100
+ const localVarAxiosArgs = await localVarAxiosParamCreator.postWebhook(pspType, tenantSlug, productSlug, body, options);
94
101
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
95
102
  },
96
103
  }
@@ -109,11 +116,12 @@ export const WebhooksApiFactory = function (configuration?: Configuration, baseP
109
116
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
110
117
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
111
118
  * @param {string} productSlug
119
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
112
120
  * @param {*} [options] Override http request option.
113
121
  * @throws {RequiredError}
114
122
  */
115
- postWebhook(pspType: string, tenantSlug: string, productSlug: string, options?: any): AxiosPromise<void> {
116
- return localVarFp.postWebhook(pspType, tenantSlug, productSlug, options).then((request) => request(axios, basePath));
123
+ postWebhook(pspType: string, tenantSlug: string, productSlug: string, body: object, options?: any): AxiosPromise<void> {
124
+ return localVarFp.postWebhook(pspType, tenantSlug, productSlug, body, options).then((request) => request(axios, basePath));
117
125
  },
118
126
  };
119
127
  };
@@ -144,6 +152,13 @@ export interface WebhooksApiPostWebhookRequest {
144
152
  * @memberof WebhooksApiPostWebhook
145
153
  */
146
154
  readonly productSlug: string
155
+
156
+ /**
157
+ * Accepts a webhook payload. The structure may vary depending on the payment service provider.
158
+ * @type {object}
159
+ * @memberof WebhooksApiPostWebhook
160
+ */
161
+ readonly body: object
147
162
  }
148
163
 
149
164
  /**
@@ -162,6 +177,6 @@ export class WebhooksApi extends BaseAPI {
162
177
  * @memberof WebhooksApi
163
178
  */
164
179
  public postWebhook(requestParameters: WebhooksApiPostWebhookRequest, options?: AxiosRequestConfig) {
165
- return WebhooksApiFp(this.configuration).postWebhook(requestParameters.pspType, requestParameters.tenantSlug, requestParameters.productSlug, options).then((request) => request(this.axios, this.basePath));
180
+ return WebhooksApiFp(this.configuration).postWebhook(requestParameters.pspType, requestParameters.tenantSlug, requestParameters.productSlug, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
166
181
  }
167
182
  }
@@ -23,10 +23,11 @@ export declare const WebhooksApiAxiosParamCreator: (configuration?: Configuratio
23
23
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
24
24
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
25
25
  * @param {string} productSlug
26
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
26
27
  * @param {*} [options] Override http request option.
27
28
  * @throws {RequiredError}
28
29
  */
29
- postWebhook: (pspType: string, tenantSlug: string, productSlug: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
30
+ postWebhook: (pspType: string, tenantSlug: string, productSlug: string, body: object, options?: AxiosRequestConfig) => Promise<RequestArgs>;
30
31
  };
31
32
  /**
32
33
  * WebhooksApi - functional programming interface
@@ -39,10 +40,11 @@ export declare const WebhooksApiFp: (configuration?: Configuration) => {
39
40
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
40
41
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
41
42
  * @param {string} productSlug
43
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
42
44
  * @param {*} [options] Override http request option.
43
45
  * @throws {RequiredError}
44
46
  */
45
- postWebhook(pspType: string, tenantSlug: string, productSlug: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
47
+ postWebhook(pspType: string, tenantSlug: string, productSlug: string, body: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
46
48
  };
47
49
  /**
48
50
  * WebhooksApi - factory interface
@@ -55,10 +57,11 @@ export declare const WebhooksApiFactory: (configuration?: Configuration, basePat
55
57
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
56
58
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
57
59
  * @param {string} productSlug
60
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
58
61
  * @param {*} [options] Override http request option.
59
62
  * @throws {RequiredError}
60
63
  */
61
- postWebhook(pspType: string, tenantSlug: string, productSlug: string, options?: any): AxiosPromise<void>;
64
+ postWebhook(pspType: string, tenantSlug: string, productSlug: string, body: object, options?: any): AxiosPromise<void>;
62
65
  };
63
66
  /**
64
67
  * Request parameters for postWebhook operation in WebhooksApi.
@@ -84,6 +87,12 @@ export interface WebhooksApiPostWebhookRequest {
84
87
  * @memberof WebhooksApiPostWebhook
85
88
  */
86
89
  readonly productSlug: string;
90
+ /**
91
+ * Accepts a webhook payload. The structure may vary depending on the payment service provider.
92
+ * @type {object}
93
+ * @memberof WebhooksApiPostWebhook
94
+ */
95
+ readonly body: object;
87
96
  }
88
97
  /**
89
98
  * WebhooksApi - object-oriented interface
@@ -98,10 +98,11 @@ var WebhooksApiAxiosParamCreator = function (configuration) {
98
98
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
99
99
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
100
100
  * @param {string} productSlug
101
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
101
102
  * @param {*} [options] Override http request option.
102
103
  * @throws {RequiredError}
103
104
  */
104
- postWebhook: function (pspType, tenantSlug, productSlug, options) {
105
+ postWebhook: function (pspType, tenantSlug, productSlug, body, options) {
105
106
  if (options === void 0) { options = {}; }
106
107
  return __awaiter(_this, void 0, void 0, function () {
107
108
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -112,6 +113,8 @@ var WebhooksApiAxiosParamCreator = function (configuration) {
112
113
  (0, common_1.assertParamExists)('postWebhook', 'tenantSlug', tenantSlug);
113
114
  // verify required parameter 'productSlug' is not null or undefined
114
115
  (0, common_1.assertParamExists)('postWebhook', 'productSlug', productSlug);
116
+ // verify required parameter 'body' is not null or undefined
117
+ (0, common_1.assertParamExists)('postWebhook', 'body', body);
115
118
  localVarPath = "/paymentservice/v1/webhooks/{pspType}/{tenantSlug}/{productSlug}"
116
119
  .replace("{".concat("pspType", "}"), encodeURIComponent(String(pspType)))
117
120
  .replace("{".concat("tenantSlug", "}"), encodeURIComponent(String(tenantSlug)))
@@ -124,9 +127,11 @@ var WebhooksApiAxiosParamCreator = function (configuration) {
124
127
  localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
125
128
  localVarHeaderParameter = {};
126
129
  localVarQueryParameter = {};
130
+ localVarHeaderParameter['Content-Type'] = 'application/json';
127
131
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
128
132
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
129
133
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
134
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
130
135
  return [2 /*return*/, {
131
136
  url: (0, common_1.toPathString)(localVarUrlObj),
132
137
  options: localVarRequestOptions,
@@ -150,15 +155,16 @@ var WebhooksApiFp = function (configuration) {
150
155
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
151
156
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
152
157
  * @param {string} productSlug
158
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
153
159
  * @param {*} [options] Override http request option.
154
160
  * @throws {RequiredError}
155
161
  */
156
- postWebhook: function (pspType, tenantSlug, productSlug, options) {
162
+ postWebhook: function (pspType, tenantSlug, productSlug, body, options) {
157
163
  return __awaiter(this, void 0, void 0, function () {
158
164
  var localVarAxiosArgs;
159
165
  return __generator(this, function (_a) {
160
166
  switch (_a.label) {
161
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.postWebhook(pspType, tenantSlug, productSlug, options)];
167
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.postWebhook(pspType, tenantSlug, productSlug, body, options)];
162
168
  case 1:
163
169
  localVarAxiosArgs = _a.sent();
164
170
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -182,11 +188,12 @@ var WebhooksApiFactory = function (configuration, basePath, axios) {
182
188
  * @param {string} pspType The type of the payment service provider (PSP).&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Supported PSP: braintree, stripe, b4u, eis, adyen&lt;/i&gt;
183
189
  * @param {string} tenantSlug Unique slug identifier representing a tenant.
184
190
  * @param {string} productSlug
191
+ * @param {object} body Accepts a webhook payload. The structure may vary depending on the payment service provider.
185
192
  * @param {*} [options] Override http request option.
186
193
  * @throws {RequiredError}
187
194
  */
188
- postWebhook: function (pspType, tenantSlug, productSlug, options) {
189
- return localVarFp.postWebhook(pspType, tenantSlug, productSlug, options).then(function (request) { return request(axios, basePath); });
195
+ postWebhook: function (pspType, tenantSlug, productSlug, body, options) {
196
+ return localVarFp.postWebhook(pspType, tenantSlug, productSlug, body, options).then(function (request) { return request(axios, basePath); });
190
197
  },
191
198
  };
192
199
  };
@@ -212,7 +219,7 @@ var WebhooksApi = /** @class */ (function (_super) {
212
219
  */
213
220
  WebhooksApi.prototype.postWebhook = function (requestParameters, options) {
214
221
  var _this = this;
215
- return (0, exports.WebhooksApiFp)(this.configuration).postWebhook(requestParameters.pspType, requestParameters.tenantSlug, requestParameters.productSlug, options).then(function (request) { return request(_this.axios, _this.basePath); });
222
+ return (0, exports.WebhooksApiFp)(this.configuration).postWebhook(requestParameters.pspType, requestParameters.tenantSlug, requestParameters.productSlug, requestParameters.body, options).then(function (request) { return request(_this.axios, _this.basePath); });
216
223
  };
217
224
  return WebhooksApi;
218
225
  }(base_1.BaseAPI));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/payment-sdk",
3
- "version": "1.6.1-beta.6",
3
+ "version": "1.6.1-beta.7",
4
4
  "description": "OpenAPI client for @emilgroup/payment-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [