@emilgroup/payment-sdk-node 1.0.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.
Files changed (118) hide show
  1. package/.openapi-generator/FILES +44 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +68 -0
  5. package/api/bank-accounts-api.ts +167 -0
  6. package/api/payment-methods-api.ts +581 -0
  7. package/api/payment-service-providers-api.ts +165 -0
  8. package/api/payment-setup-api.ts +268 -0
  9. package/api/payments-api.ts +491 -0
  10. package/api/webhooks-api.ts +154 -0
  11. package/api.ts +46 -0
  12. package/base.ts +293 -0
  13. package/common.ts +138 -0
  14. package/configuration.ts +109 -0
  15. package/dist/api/bank-accounts-api.d.ts +96 -0
  16. package/dist/api/bank-accounts-api.js +228 -0
  17. package/dist/api/payment-methods-api.d.ts +327 -0
  18. package/dist/api/payment-methods-api.js +551 -0
  19. package/dist/api/payment-service-providers-api.d.ts +93 -0
  20. package/dist/api/payment-service-providers-api.js +224 -0
  21. package/dist/api/payment-setup-api.d.ts +146 -0
  22. package/dist/api/payment-setup-api.js +313 -0
  23. package/dist/api/payments-api.d.ts +281 -0
  24. package/dist/api/payments-api.js +463 -0
  25. package/dist/api/webhooks-api.d.ts +91 -0
  26. package/dist/api/webhooks-api.js +213 -0
  27. package/dist/api.d.ts +21 -0
  28. package/dist/api.js +41 -0
  29. package/dist/base.d.ts +77 -0
  30. package/dist/base.js +394 -0
  31. package/dist/common.d.ts +66 -0
  32. package/dist/common.js +244 -0
  33. package/dist/configuration.d.ts +90 -0
  34. package/dist/configuration.js +44 -0
  35. package/dist/index.d.ts +15 -0
  36. package/dist/index.js +35 -0
  37. package/dist/models/complete-braintree-payment-setup-request-dto.d.ts +48 -0
  38. package/dist/models/complete-braintree-payment-setup-request-dto.js +15 -0
  39. package/dist/models/complete-payment-setup-request-dto.d.ts +32 -0
  40. package/dist/models/complete-payment-setup-request-dto.js +15 -0
  41. package/dist/models/complete-payment-setup-response-class.d.ts +25 -0
  42. package/dist/models/complete-payment-setup-response-class.js +15 -0
  43. package/dist/models/complete-stripe-payment-setup-request-dto.d.ts +54 -0
  44. package/dist/models/complete-stripe-payment-setup-request-dto.js +15 -0
  45. package/dist/models/create-bank-account-request-dto.d.ts +30 -0
  46. package/dist/models/create-bank-account-request-dto.js +15 -0
  47. package/dist/models/create-payment-method-response-class.d.ts +25 -0
  48. package/dist/models/create-payment-method-response-class.js +15 -0
  49. package/dist/models/create-payment-request-dto.d.ts +42 -0
  50. package/dist/models/create-payment-request-dto.js +15 -0
  51. package/dist/models/create-payment-response-class.d.ts +25 -0
  52. package/dist/models/create-payment-response-class.js +15 -0
  53. package/dist/models/create-psp-payment-method-request-dto.d.ts +53 -0
  54. package/dist/models/create-psp-payment-method-request-dto.js +31 -0
  55. package/dist/models/get-payment-method-response-class.d.ts +25 -0
  56. package/dist/models/get-payment-method-response-class.js +15 -0
  57. package/dist/models/get-payment-response-class.d.ts +25 -0
  58. package/dist/models/get-payment-response-class.js +15 -0
  59. package/dist/models/get-request-dto.d.ts +30 -0
  60. package/dist/models/get-request-dto.js +15 -0
  61. package/dist/models/index.d.ts +25 -0
  62. package/dist/models/index.js +41 -0
  63. package/dist/models/initiate-braintree-payment-setup-request-dto.d.ts +24 -0
  64. package/dist/models/initiate-braintree-payment-setup-request-dto.js +15 -0
  65. package/dist/models/initiate-braintree-payment-setup-response-class.d.ts +24 -0
  66. package/dist/models/initiate-braintree-payment-setup-response-class.js +15 -0
  67. package/dist/models/initiate-payment-setup-request-dto.d.ts +32 -0
  68. package/dist/models/initiate-payment-setup-request-dto.js +15 -0
  69. package/dist/models/initiate-payment-setup-response-class.d.ts +32 -0
  70. package/dist/models/initiate-payment-setup-response-class.js +15 -0
  71. package/dist/models/initiate-stripe-payment-setup-request-dto.d.ts +24 -0
  72. package/dist/models/initiate-stripe-payment-setup-request-dto.js +15 -0
  73. package/dist/models/initiate-stripe-payment-setup-response-class.d.ts +30 -0
  74. package/dist/models/initiate-stripe-payment-setup-response-class.js +15 -0
  75. package/dist/models/list-payment-methods-response-class.d.ts +30 -0
  76. package/dist/models/list-payment-methods-response-class.js +15 -0
  77. package/dist/models/list-payments-response-class.d.ts +30 -0
  78. package/dist/models/list-payments-response-class.js +15 -0
  79. package/dist/models/payment-class.d.ts +72 -0
  80. package/dist/models/payment-class.js +15 -0
  81. package/dist/models/payment-method-class.d.ts +60 -0
  82. package/dist/models/payment-method-class.js +15 -0
  83. package/dist/models/sepa-direct-dto.d.ts +24 -0
  84. package/dist/models/sepa-direct-dto.js +15 -0
  85. package/dist/models/validate-pspconfig-request-dto.d.ts +41 -0
  86. package/dist/models/validate-pspconfig-request-dto.js +20 -0
  87. package/dist/models/validate-pspconfig-response-class.d.ts +24 -0
  88. package/dist/models/validate-pspconfig-response-class.js +15 -0
  89. package/git_push.sh +57 -0
  90. package/index.ts +19 -0
  91. package/models/complete-braintree-payment-setup-request-dto.ts +54 -0
  92. package/models/complete-payment-setup-request-dto.ts +38 -0
  93. package/models/complete-payment-setup-response-class.ts +31 -0
  94. package/models/complete-stripe-payment-setup-request-dto.ts +60 -0
  95. package/models/create-bank-account-request-dto.ts +36 -0
  96. package/models/create-payment-method-response-class.ts +31 -0
  97. package/models/create-payment-request-dto.ts +48 -0
  98. package/models/create-payment-response-class.ts +31 -0
  99. package/models/create-psp-payment-method-request-dto.ts +62 -0
  100. package/models/get-payment-method-response-class.ts +31 -0
  101. package/models/get-payment-response-class.ts +31 -0
  102. package/models/get-request-dto.ts +36 -0
  103. package/models/index.ts +25 -0
  104. package/models/initiate-braintree-payment-setup-request-dto.ts +30 -0
  105. package/models/initiate-braintree-payment-setup-response-class.ts +30 -0
  106. package/models/initiate-payment-setup-request-dto.ts +38 -0
  107. package/models/initiate-payment-setup-response-class.ts +38 -0
  108. package/models/initiate-stripe-payment-setup-request-dto.ts +30 -0
  109. package/models/initiate-stripe-payment-setup-response-class.ts +36 -0
  110. package/models/list-payment-methods-response-class.ts +36 -0
  111. package/models/list-payments-response-class.ts +36 -0
  112. package/models/payment-class.ts +78 -0
  113. package/models/payment-method-class.ts +66 -0
  114. package/models/sepa-direct-dto.ts +30 -0
  115. package/models/validate-pspconfig-request-dto.ts +50 -0
  116. package/models/validate-pspconfig-response-class.ts +30 -0
  117. package/package.json +30 -0
  118. package/tsconfig.json +22 -0
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Emil Payment Service
6
+ * This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (_) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.PaymentSetupApi = exports.PaymentSetupApiFactory = exports.PaymentSetupApiFp = exports.PaymentSetupApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * PaymentSetupApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var PaymentSetupApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ *
101
+ * @param {CompletePaymentSetupRequestDto} completePaymentSetupRequestDto
102
+ * @param {string} [authorization] Bearer Token
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ completePaymentSetup: function (completePaymentSetupRequestDto, authorization, options) {
107
+ if (options === void 0) { options = {}; }
108
+ return __awaiter(_this, void 0, void 0, function () {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0:
113
+ // verify required parameter 'completePaymentSetupRequestDto' is not null or undefined
114
+ (0, common_1.assertParamExists)('completePaymentSetup', 'completePaymentSetupRequestDto', completePaymentSetupRequestDto);
115
+ localVarPath = "/paymentservice/v1/payment-setup/complete";
116
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
117
+ if (configuration) {
118
+ baseOptions = configuration.baseOptions;
119
+ baseAccessToken = configuration.accessToken;
120
+ }
121
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
122
+ localVarHeaderParameter = {};
123
+ localVarQueryParameter = {};
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
127
+ case 1:
128
+ // authentication bearer required
129
+ // http bearer authentication required
130
+ _a.sent();
131
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
132
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
133
+ }
134
+ localVarHeaderParameter['Content-Type'] = 'application/json';
135
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
138
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(completePaymentSetupRequestDto, localVarRequestOptions, configuration);
139
+ return [2 /*return*/, {
140
+ url: (0, common_1.toPathString)(localVarUrlObj),
141
+ options: localVarRequestOptions,
142
+ }];
143
+ }
144
+ });
145
+ });
146
+ },
147
+ /**
148
+ *
149
+ * @param {InitiatePaymentSetupRequestDto} initiatePaymentSetupRequestDto
150
+ * @param {string} [authorization] Bearer Token
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ initiatePaymentSetup: function (initiatePaymentSetupRequestDto, authorization, options) {
155
+ if (options === void 0) { options = {}; }
156
+ return __awaiter(_this, void 0, void 0, function () {
157
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0:
161
+ // verify required parameter 'initiatePaymentSetupRequestDto' is not null or undefined
162
+ (0, common_1.assertParamExists)('initiatePaymentSetup', 'initiatePaymentSetupRequestDto', initiatePaymentSetupRequestDto);
163
+ localVarPath = "/paymentservice/v1/payment-setup/initiate";
164
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
165
+ if (configuration) {
166
+ baseOptions = configuration.baseOptions;
167
+ baseAccessToken = configuration.accessToken;
168
+ }
169
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
170
+ localVarHeaderParameter = {};
171
+ localVarQueryParameter = {};
172
+ // authentication bearer required
173
+ // http bearer authentication required
174
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
175
+ case 1:
176
+ // authentication bearer required
177
+ // http bearer authentication required
178
+ _a.sent();
179
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
180
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
181
+ }
182
+ localVarHeaderParameter['Content-Type'] = 'application/json';
183
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
184
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
185
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
186
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(initiatePaymentSetupRequestDto, localVarRequestOptions, configuration);
187
+ return [2 /*return*/, {
188
+ url: (0, common_1.toPathString)(localVarUrlObj),
189
+ options: localVarRequestOptions,
190
+ }];
191
+ }
192
+ });
193
+ });
194
+ },
195
+ };
196
+ };
197
+ exports.PaymentSetupApiAxiosParamCreator = PaymentSetupApiAxiosParamCreator;
198
+ /**
199
+ * PaymentSetupApi - functional programming interface
200
+ * @export
201
+ */
202
+ var PaymentSetupApiFp = function (configuration) {
203
+ var localVarAxiosParamCreator = (0, exports.PaymentSetupApiAxiosParamCreator)(configuration);
204
+ return {
205
+ /**
206
+ *
207
+ * @param {CompletePaymentSetupRequestDto} completePaymentSetupRequestDto
208
+ * @param {string} [authorization] Bearer Token
209
+ * @param {*} [options] Override http request option.
210
+ * @throws {RequiredError}
211
+ */
212
+ completePaymentSetup: function (completePaymentSetupRequestDto, authorization, options) {
213
+ return __awaiter(this, void 0, void 0, function () {
214
+ var localVarAxiosArgs;
215
+ return __generator(this, function (_a) {
216
+ switch (_a.label) {
217
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.completePaymentSetup(completePaymentSetupRequestDto, authorization, options)];
218
+ case 1:
219
+ localVarAxiosArgs = _a.sent();
220
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
221
+ }
222
+ });
223
+ });
224
+ },
225
+ /**
226
+ *
227
+ * @param {InitiatePaymentSetupRequestDto} initiatePaymentSetupRequestDto
228
+ * @param {string} [authorization] Bearer Token
229
+ * @param {*} [options] Override http request option.
230
+ * @throws {RequiredError}
231
+ */
232
+ initiatePaymentSetup: function (initiatePaymentSetupRequestDto, authorization, options) {
233
+ return __awaiter(this, void 0, void 0, function () {
234
+ var localVarAxiosArgs;
235
+ return __generator(this, function (_a) {
236
+ switch (_a.label) {
237
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiatePaymentSetup(initiatePaymentSetupRequestDto, authorization, options)];
238
+ case 1:
239
+ localVarAxiosArgs = _a.sent();
240
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
241
+ }
242
+ });
243
+ });
244
+ },
245
+ };
246
+ };
247
+ exports.PaymentSetupApiFp = PaymentSetupApiFp;
248
+ /**
249
+ * PaymentSetupApi - factory interface
250
+ * @export
251
+ */
252
+ var PaymentSetupApiFactory = function (configuration, basePath, axios) {
253
+ var localVarFp = (0, exports.PaymentSetupApiFp)(configuration);
254
+ return {
255
+ /**
256
+ *
257
+ * @param {CompletePaymentSetupRequestDto} completePaymentSetupRequestDto
258
+ * @param {string} [authorization] Bearer Token
259
+ * @param {*} [options] Override http request option.
260
+ * @throws {RequiredError}
261
+ */
262
+ completePaymentSetup: function (completePaymentSetupRequestDto, authorization, options) {
263
+ return localVarFp.completePaymentSetup(completePaymentSetupRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
264
+ },
265
+ /**
266
+ *
267
+ * @param {InitiatePaymentSetupRequestDto} initiatePaymentSetupRequestDto
268
+ * @param {string} [authorization] Bearer Token
269
+ * @param {*} [options] Override http request option.
270
+ * @throws {RequiredError}
271
+ */
272
+ initiatePaymentSetup: function (initiatePaymentSetupRequestDto, authorization, options) {
273
+ return localVarFp.initiatePaymentSetup(initiatePaymentSetupRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
274
+ },
275
+ };
276
+ };
277
+ exports.PaymentSetupApiFactory = PaymentSetupApiFactory;
278
+ /**
279
+ * PaymentSetupApi - object-oriented interface
280
+ * @export
281
+ * @class PaymentSetupApi
282
+ * @extends {BaseAPI}
283
+ */
284
+ var PaymentSetupApi = /** @class */ (function (_super) {
285
+ __extends(PaymentSetupApi, _super);
286
+ function PaymentSetupApi() {
287
+ return _super !== null && _super.apply(this, arguments) || this;
288
+ }
289
+ /**
290
+ *
291
+ * @param {PaymentSetupApiCompletePaymentSetupRequest} requestParameters Request parameters.
292
+ * @param {*} [options] Override http request option.
293
+ * @throws {RequiredError}
294
+ * @memberof PaymentSetupApi
295
+ */
296
+ PaymentSetupApi.prototype.completePaymentSetup = function (requestParameters, options) {
297
+ var _this = this;
298
+ return (0, exports.PaymentSetupApiFp)(this.configuration).completePaymentSetup(requestParameters.completePaymentSetupRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
299
+ };
300
+ /**
301
+ *
302
+ * @param {PaymentSetupApiInitiatePaymentSetupRequest} requestParameters Request parameters.
303
+ * @param {*} [options] Override http request option.
304
+ * @throws {RequiredError}
305
+ * @memberof PaymentSetupApi
306
+ */
307
+ PaymentSetupApi.prototype.initiatePaymentSetup = function (requestParameters, options) {
308
+ var _this = this;
309
+ return (0, exports.PaymentSetupApiFp)(this.configuration).initiatePaymentSetup(requestParameters.initiatePaymentSetupRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
310
+ };
311
+ return PaymentSetupApi;
312
+ }(base_1.BaseAPI));
313
+ exports.PaymentSetupApi = PaymentSetupApi;
@@ -0,0 +1,281 @@
1
+ /**
2
+ * Emil Payment Service
3
+ * This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
13
+ import { Configuration } from '../configuration';
14
+ import { RequestArgs, BaseAPI } from '../base';
15
+ import { CreatePaymentRequestDto } from '../models';
16
+ import { CreatePaymentResponseClass } from '../models';
17
+ import { GetPaymentResponseClass } from '../models';
18
+ import { ListPaymentsResponseClass } from '../models';
19
+ /**
20
+ * PaymentsApi - axios parameter creator
21
+ * @export
22
+ */
23
+ export declare const PaymentsApiAxiosParamCreator: (configuration?: Configuration) => {
24
+ /**
25
+ * Creates a payment for a specified account. This function is idempotent.
26
+ * @summary Create a payment
27
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
28
+ * @param {string} [authorization] Bearer Token
29
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
30
+ * @param {*} [options] Override http request option.
31
+ * @throws {RequiredError}
32
+ */
33
+ createPayment: (createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
34
+ /**
35
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
36
+ * @summary Retrieve a payment
37
+ * @param {string} code Unique identifier for the object.
38
+ * @param {string} [authorization] Bearer Token
39
+ * @param {string} [expand] Fields to expand response by
40
+ * @param {string} [expand2] Fields to expand response by
41
+ * @param {*} [options] Override http request option.
42
+ * @throws {RequiredError}
43
+ */
44
+ getPayment: (code: string, authorization?: string, expand?: string, expand2?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
45
+ /**
46
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
47
+ * @summary List payments
48
+ * @param {string} [authorization] Bearer Token
49
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
50
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
51
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
52
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
53
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
54
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
55
+ * @param {*} [options] Override http request option.
56
+ * @throws {RequiredError}
57
+ */
58
+ listPayments: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
59
+ };
60
+ /**
61
+ * PaymentsApi - functional programming interface
62
+ * @export
63
+ */
64
+ export declare const PaymentsApiFp: (configuration?: Configuration) => {
65
+ /**
66
+ * Creates a payment for a specified account. This function is idempotent.
67
+ * @summary Create a payment
68
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
69
+ * @param {string} [authorization] Bearer Token
70
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ createPayment(createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePaymentResponseClass>>;
75
+ /**
76
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
77
+ * @summary Retrieve a payment
78
+ * @param {string} code Unique identifier for the object.
79
+ * @param {string} [authorization] Bearer Token
80
+ * @param {string} [expand] Fields to expand response by
81
+ * @param {string} [expand2] Fields to expand response by
82
+ * @param {*} [options] Override http request option.
83
+ * @throws {RequiredError}
84
+ */
85
+ getPayment(code: string, authorization?: string, expand?: string, expand2?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPaymentResponseClass>>;
86
+ /**
87
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
88
+ * @summary List payments
89
+ * @param {string} [authorization] Bearer Token
90
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
91
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
92
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
93
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
94
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
95
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
96
+ * @param {*} [options] Override http request option.
97
+ * @throws {RequiredError}
98
+ */
99
+ listPayments(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPaymentsResponseClass>>;
100
+ };
101
+ /**
102
+ * PaymentsApi - factory interface
103
+ * @export
104
+ */
105
+ export declare const PaymentsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
106
+ /**
107
+ * Creates a payment for a specified account. This function is idempotent.
108
+ * @summary Create a payment
109
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
110
+ * @param {string} [authorization] Bearer Token
111
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ */
115
+ createPayment(createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, idempotencyKey?: string, options?: any): AxiosPromise<CreatePaymentResponseClass>;
116
+ /**
117
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
118
+ * @summary Retrieve a payment
119
+ * @param {string} code Unique identifier for the object.
120
+ * @param {string} [authorization] Bearer Token
121
+ * @param {string} [expand] Fields to expand response by
122
+ * @param {string} [expand2] Fields to expand response by
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ getPayment(code: string, authorization?: string, expand?: string, expand2?: string, options?: any): AxiosPromise<GetPaymentResponseClass>;
127
+ /**
128
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
129
+ * @summary List payments
130
+ * @param {string} [authorization] Bearer Token
131
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
132
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
133
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
134
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
135
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
136
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
137
+ * @param {*} [options] Override http request option.
138
+ * @throws {RequiredError}
139
+ */
140
+ listPayments(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListPaymentsResponseClass>;
141
+ };
142
+ /**
143
+ * Request parameters for createPayment operation in PaymentsApi.
144
+ * @export
145
+ * @interface PaymentsApiCreatePaymentRequest
146
+ */
147
+ export interface PaymentsApiCreatePaymentRequest {
148
+ /**
149
+ *
150
+ * @type {CreatePaymentRequestDto}
151
+ * @memberof PaymentsApiCreatePayment
152
+ */
153
+ readonly createPaymentRequestDto: CreatePaymentRequestDto;
154
+ /**
155
+ * Bearer Token
156
+ * @type {string}
157
+ * @memberof PaymentsApiCreatePayment
158
+ */
159
+ readonly authorization?: string;
160
+ /**
161
+ * Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
162
+ * @type {string}
163
+ * @memberof PaymentsApiCreatePayment
164
+ */
165
+ readonly idempotencyKey?: string;
166
+ }
167
+ /**
168
+ * Request parameters for getPayment operation in PaymentsApi.
169
+ * @export
170
+ * @interface PaymentsApiGetPaymentRequest
171
+ */
172
+ export interface PaymentsApiGetPaymentRequest {
173
+ /**
174
+ * Unique identifier for the object.
175
+ * @type {string}
176
+ * @memberof PaymentsApiGetPayment
177
+ */
178
+ readonly code: string;
179
+ /**
180
+ * Bearer Token
181
+ * @type {string}
182
+ * @memberof PaymentsApiGetPayment
183
+ */
184
+ readonly authorization?: string;
185
+ /**
186
+ * Fields to expand response by
187
+ * @type {string}
188
+ * @memberof PaymentsApiGetPayment
189
+ */
190
+ readonly expand?: string;
191
+ /**
192
+ * Fields to expand response by
193
+ * @type {string}
194
+ * @memberof PaymentsApiGetPayment
195
+ */
196
+ readonly expand2?: string;
197
+ }
198
+ /**
199
+ * Request parameters for listPayments operation in PaymentsApi.
200
+ * @export
201
+ * @interface PaymentsApiListPaymentsRequest
202
+ */
203
+ export interface PaymentsApiListPaymentsRequest {
204
+ /**
205
+ * Bearer Token
206
+ * @type {string}
207
+ * @memberof PaymentsApiListPayments
208
+ */
209
+ readonly authorization?: string;
210
+ /**
211
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
212
+ * @type {any}
213
+ * @memberof PaymentsApiListPayments
214
+ */
215
+ readonly pageSize?: any;
216
+ /**
217
+ * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
218
+ * @type {any}
219
+ * @memberof PaymentsApiListPayments
220
+ */
221
+ readonly pageToken?: any;
222
+ /**
223
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
224
+ * @type {any}
225
+ * @memberof PaymentsApiListPayments
226
+ */
227
+ readonly filter?: any;
228
+ /**
229
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
230
+ * @type {any}
231
+ * @memberof PaymentsApiListPayments
232
+ */
233
+ readonly search?: any;
234
+ /**
235
+ * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
236
+ * @type {any}
237
+ * @memberof PaymentsApiListPayments
238
+ */
239
+ readonly order?: any;
240
+ /**
241
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
242
+ * @type {any}
243
+ * @memberof PaymentsApiListPayments
244
+ */
245
+ readonly expand?: any;
246
+ }
247
+ /**
248
+ * PaymentsApi - object-oriented interface
249
+ * @export
250
+ * @class PaymentsApi
251
+ * @extends {BaseAPI}
252
+ */
253
+ export declare class PaymentsApi extends BaseAPI {
254
+ /**
255
+ * Creates a payment for a specified account. This function is idempotent.
256
+ * @summary Create a payment
257
+ * @param {PaymentsApiCreatePaymentRequest} requestParameters Request parameters.
258
+ * @param {*} [options] Override http request option.
259
+ * @throws {RequiredError}
260
+ * @memberof PaymentsApi
261
+ */
262
+ createPayment(requestParameters: PaymentsApiCreatePaymentRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePaymentResponseClass, any>>;
263
+ /**
264
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
265
+ * @summary Retrieve a payment
266
+ * @param {PaymentsApiGetPaymentRequest} requestParameters Request parameters.
267
+ * @param {*} [options] Override http request option.
268
+ * @throws {RequiredError}
269
+ * @memberof PaymentsApi
270
+ */
271
+ getPayment(requestParameters: PaymentsApiGetPaymentRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPaymentResponseClass, any>>;
272
+ /**
273
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
274
+ * @summary List payments
275
+ * @param {PaymentsApiListPaymentsRequest} requestParameters Request parameters.
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ * @memberof PaymentsApi
279
+ */
280
+ listPayments(requestParameters?: PaymentsApiListPaymentsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPaymentsResponseClass, any>>;
281
+ }