@channelpayments/node-sdk 1.124.1 → 1.128.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 (31) hide show
  1. package/dist/cjs/apis/ChannelPaymentsApi.d.ts +30 -1
  2. package/dist/cjs/apis/ChannelPaymentsApi.js +273 -0
  3. package/dist/cjs/models/ConnectorServiceTokenEntity.d.ts +62 -0
  4. package/dist/cjs/models/ConnectorServiceTokenEntity.js +64 -0
  5. package/dist/cjs/models/CreateProvisionedCardTokenDto.d.ts +53 -0
  6. package/dist/cjs/models/CreateProvisionedCardTokenDto.js +62 -0
  7. package/dist/cjs/models/PaymentMethodEntity.d.ts +7 -0
  8. package/dist/cjs/models/PaymentMethodEntity.js +3 -0
  9. package/dist/cjs/models/PaymentMethodEntityConnectorServiceTokens.d.ts +62 -0
  10. package/dist/cjs/models/PaymentMethodEntityConnectorServiceTokens.js +64 -0
  11. package/dist/cjs/models/PaymentMethodServiceEntity.d.ts +7 -0
  12. package/dist/cjs/models/PaymentMethodServiceEntity.js +3 -0
  13. package/dist/cjs/models/index.d.ts +3 -0
  14. package/dist/cjs/models/index.js +3 -0
  15. package/dist/cjs/runtime.js +1 -1
  16. package/dist/mjs/apis/ChannelPaymentsApi.d.ts +30 -1
  17. package/dist/mjs/apis/ChannelPaymentsApi.js +266 -1
  18. package/dist/mjs/models/ConnectorServiceTokenEntity.d.ts +62 -0
  19. package/dist/mjs/models/ConnectorServiceTokenEntity.js +57 -0
  20. package/dist/mjs/models/CreateProvisionedCardTokenDto.d.ts +53 -0
  21. package/dist/mjs/models/CreateProvisionedCardTokenDto.js +55 -0
  22. package/dist/mjs/models/PaymentMethodEntity.d.ts +7 -0
  23. package/dist/mjs/models/PaymentMethodEntity.js +3 -0
  24. package/dist/mjs/models/PaymentMethodEntityConnectorServiceTokens.d.ts +62 -0
  25. package/dist/mjs/models/PaymentMethodEntityConnectorServiceTokens.js +57 -0
  26. package/dist/mjs/models/PaymentMethodServiceEntity.d.ts +7 -0
  27. package/dist/mjs/models/PaymentMethodServiceEntity.js +3 -0
  28. package/dist/mjs/models/index.d.ts +3 -0
  29. package/dist/mjs/models/index.js +3 -0
  30. package/dist/mjs/runtime.js +1 -1
  31. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Channel Payments API
3
+ *
4
+ * NOTE: This class is auto generated. Do not edit the class manually.
5
+ *
6
+ */
7
+ /**
8
+ * The connector service tokens.
9
+ * @export
10
+ * @interface PaymentMethodEntityConnectorServiceTokens
11
+ */
12
+ export interface PaymentMethodEntityConnectorServiceTokens {
13
+ /**
14
+ * The id of the payment method associated with the connector service token.
15
+ * @type {string}
16
+ * @memberof PaymentMethodEntityConnectorServiceTokens
17
+ */
18
+ paymentMethodId: string;
19
+ /**
20
+ * The id of the connector service token.
21
+ * @type {string}
22
+ * @memberof PaymentMethodEntityConnectorServiceTokens
23
+ */
24
+ connectorServiceTokenId: string;
25
+ /**
26
+ * The token of the connector service token.
27
+ * @type {string}
28
+ * @memberof PaymentMethodEntityConnectorServiceTokens
29
+ */
30
+ token: string;
31
+ /**
32
+ * The connector of the connector service token.
33
+ * @type {object}
34
+ * @memberof PaymentMethodEntityConnectorServiceTokens
35
+ */
36
+ connector: object;
37
+ /**
38
+ * The date and time the token was created.
39
+ * @type {Date}
40
+ * @memberof PaymentMethodEntityConnectorServiceTokens
41
+ */
42
+ createdAt: Date;
43
+ /**
44
+ * The date and time the token was last updated.
45
+ * @type {Date}
46
+ * @memberof PaymentMethodEntityConnectorServiceTokens
47
+ */
48
+ updatedAt: Date;
49
+ /**
50
+ * The approval url for the token.
51
+ * @type {string}
52
+ * @memberof PaymentMethodEntityConnectorServiceTokens
53
+ */
54
+ approvalUrl?: string;
55
+ }
56
+ /**
57
+ * Check if a given object implements the PaymentMethodEntityConnectorServiceTokens interface.
58
+ */
59
+ export declare function instanceOfPaymentMethodEntityConnectorServiceTokens(value: object): boolean;
60
+ export declare function PaymentMethodEntityConnectorServiceTokensFromJSON(json: any): PaymentMethodEntityConnectorServiceTokens;
61
+ export declare function PaymentMethodEntityConnectorServiceTokensFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentMethodEntityConnectorServiceTokens;
62
+ export declare function PaymentMethodEntityConnectorServiceTokensToJSON(value?: PaymentMethodEntityConnectorServiceTokens | null): any;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Channel Payments API
6
+ *
7
+ * NOTE: This class is auto generated. Do not edit the class manually.
8
+ *
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.PaymentMethodEntityConnectorServiceTokensToJSON = exports.PaymentMethodEntityConnectorServiceTokensFromJSONTyped = exports.PaymentMethodEntityConnectorServiceTokensFromJSON = exports.instanceOfPaymentMethodEntityConnectorServiceTokens = void 0;
12
+ const runtime_1 = require("../runtime");
13
+ /**
14
+ * Check if a given object implements the PaymentMethodEntityConnectorServiceTokens interface.
15
+ */
16
+ function instanceOfPaymentMethodEntityConnectorServiceTokens(value) {
17
+ let isInstance = true;
18
+ isInstance = isInstance && "paymentMethodId" in value;
19
+ isInstance = isInstance && "connectorServiceTokenId" in value;
20
+ isInstance = isInstance && "token" in value;
21
+ isInstance = isInstance && "connector" in value;
22
+ isInstance = isInstance && "createdAt" in value;
23
+ isInstance = isInstance && "updatedAt" in value;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfPaymentMethodEntityConnectorServiceTokens = instanceOfPaymentMethodEntityConnectorServiceTokens;
27
+ function PaymentMethodEntityConnectorServiceTokensFromJSON(json) {
28
+ return PaymentMethodEntityConnectorServiceTokensFromJSONTyped(json, false);
29
+ }
30
+ exports.PaymentMethodEntityConnectorServiceTokensFromJSON = PaymentMethodEntityConnectorServiceTokensFromJSON;
31
+ function PaymentMethodEntityConnectorServiceTokensFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ const typed = {
36
+ 'paymentMethodId': json['paymentMethodId'],
37
+ 'connectorServiceTokenId': json['connectorServiceTokenId'],
38
+ 'token': json['token'],
39
+ 'connector': json['connector'],
40
+ 'createdAt': (new Date(json['createdAt'])),
41
+ 'updatedAt': (new Date(json['updatedAt'])),
42
+ 'approvalUrl': !(0, runtime_1.exists)(json, 'approvalUrl') ? undefined : json['approvalUrl'],
43
+ };
44
+ return (0, runtime_1.removeNullUndefined)(typed);
45
+ }
46
+ exports.PaymentMethodEntityConnectorServiceTokensFromJSONTyped = PaymentMethodEntityConnectorServiceTokensFromJSONTyped;
47
+ function PaymentMethodEntityConnectorServiceTokensToJSON(value) {
48
+ if (value === undefined) {
49
+ return undefined;
50
+ }
51
+ if (value === null) {
52
+ return null;
53
+ }
54
+ return {
55
+ 'paymentMethodId': value.paymentMethodId,
56
+ 'connectorServiceTokenId': value.connectorServiceTokenId,
57
+ 'token': value.token,
58
+ 'connector': value.connector,
59
+ 'createdAt': (value.createdAt.toISOString()),
60
+ 'updatedAt': (value.updatedAt.toISOString()),
61
+ 'approvalUrl': value.approvalUrl,
62
+ };
63
+ }
64
+ exports.PaymentMethodEntityConnectorServiceTokensToJSON = PaymentMethodEntityConnectorServiceTokensToJSON;
@@ -7,6 +7,7 @@
7
7
  import type { PaymentMethodEntityAccountDetails } from './PaymentMethodEntityAccountDetails';
8
8
  import type { PaymentMethodEntityBuyer } from './PaymentMethodEntityBuyer';
9
9
  import type { PaymentMethodEntityCardDetails } from './PaymentMethodEntityCardDetails';
10
+ import type { PaymentMethodEntityConnectorServiceTokens } from './PaymentMethodEntityConnectorServiceTokens';
10
11
  /**
11
12
  *
12
13
  * @export
@@ -49,6 +50,12 @@ export interface PaymentMethodServiceEntity {
49
50
  * @memberof PaymentMethodServiceEntity
50
51
  */
51
52
  externalPaymentMethodId?: string;
53
+ /**
54
+ *
55
+ * @type {PaymentMethodEntityConnectorServiceTokens}
56
+ * @memberof PaymentMethodServiceEntity
57
+ */
58
+ connectorServiceTokens?: PaymentMethodEntityConnectorServiceTokens;
52
59
  /**
53
60
  * The currency to use with this payment method.
54
61
  * @type {string}
@@ -13,6 +13,7 @@ const runtime_1 = require("../runtime");
13
13
  const PaymentMethodEntityAccountDetails_1 = require("./PaymentMethodEntityAccountDetails");
14
14
  const PaymentMethodEntityBuyer_1 = require("./PaymentMethodEntityBuyer");
15
15
  const PaymentMethodEntityCardDetails_1 = require("./PaymentMethodEntityCardDetails");
16
+ const PaymentMethodEntityConnectorServiceTokens_1 = require("./PaymentMethodEntityConnectorServiceTokens");
16
17
  /**
17
18
  * @export
18
19
  */
@@ -66,6 +67,7 @@ function PaymentMethodServiceEntityFromJSONTyped(json, ignoreDiscriminator) {
66
67
  'status': json['status'],
67
68
  'method': json['method'],
68
69
  'externalPaymentMethodId': !(0, runtime_1.exists)(json, 'externalPaymentMethodId') ? undefined : json['externalPaymentMethodId'],
70
+ 'connectorServiceTokens': !(0, runtime_1.exists)(json, 'connectorServiceTokens') ? undefined : (0, PaymentMethodEntityConnectorServiceTokens_1.PaymentMethodEntityConnectorServiceTokensFromJSON)(json['connectorServiceTokens']),
69
71
  'currency': !(0, runtime_1.exists)(json, 'currency') ? undefined : json['currency'],
70
72
  'countryCode': !(0, runtime_1.exists)(json, 'countryCode') ? undefined : json['countryCode'],
71
73
  'cardDetails': !(0, runtime_1.exists)(json, 'cardDetails') ? undefined : (0, PaymentMethodEntityCardDetails_1.PaymentMethodEntityCardDetailsFromJSON)(json['cardDetails']),
@@ -96,6 +98,7 @@ function PaymentMethodServiceEntityToJSON(value) {
96
98
  'status': value.status,
97
99
  'method': value.method,
98
100
  'externalPaymentMethodId': value.externalPaymentMethodId,
101
+ 'connectorServiceTokens': (0, PaymentMethodEntityConnectorServiceTokens_1.PaymentMethodEntityConnectorServiceTokensToJSON)(value.connectorServiceTokens),
99
102
  'currency': value.currency,
100
103
  'countryCode': value.countryCode,
101
104
  'cardDetails': (0, PaymentMethodEntityCardDetails_1.PaymentMethodEntityCardDetailsToJSON)(value.cardDetails),
@@ -14,6 +14,7 @@ export * from './CaptureTransactionDto';
14
14
  export * from './CardDetailsServiceEntity';
15
15
  export * from './CheckoutSessionEntity';
16
16
  export * from './CheckoutSessionItemEntity';
17
+ export * from './ConnectorServiceTokenEntity';
17
18
  export * from './CreateBuyerAddressDto';
18
19
  export * from './CreateBuyerDto';
19
20
  export * from './CreateBuyerDtoAddress';
@@ -43,6 +44,7 @@ export * from './CreateMerchantCredentialsDto';
43
44
  export * from './CreateMerchantDto';
44
45
  export * from './CreateMerchantDtoAddress';
45
46
  export * from './CreatePaymentMethodDto';
47
+ export * from './CreateProvisionedCardTokenDto';
46
48
  export * from './CreateStoredCardPaymentMethod';
47
49
  export * from './CreateTransactionNoteDto';
48
50
  export * from './CreateTransactionRefundDto';
@@ -69,6 +71,7 @@ export * from './PaymentMethodEntity';
69
71
  export * from './PaymentMethodEntityAccountDetails';
70
72
  export * from './PaymentMethodEntityBuyer';
71
73
  export * from './PaymentMethodEntityCardDetails';
74
+ export * from './PaymentMethodEntityConnectorServiceTokens';
72
75
  export * from './PaymentMethodServiceEntity';
73
76
  export * from './PaymentMethodsSearchEntity';
74
77
  export * from './ReturnedTransactionEntity';
@@ -32,6 +32,7 @@ __exportStar(require("./CaptureTransactionDto"), exports);
32
32
  __exportStar(require("./CardDetailsServiceEntity"), exports);
33
33
  __exportStar(require("./CheckoutSessionEntity"), exports);
34
34
  __exportStar(require("./CheckoutSessionItemEntity"), exports);
35
+ __exportStar(require("./ConnectorServiceTokenEntity"), exports);
35
36
  __exportStar(require("./CreateBuyerAddressDto"), exports);
36
37
  __exportStar(require("./CreateBuyerDto"), exports);
37
38
  __exportStar(require("./CreateBuyerDtoAddress"), exports);
@@ -61,6 +62,7 @@ __exportStar(require("./CreateMerchantCredentialsDto"), exports);
61
62
  __exportStar(require("./CreateMerchantDto"), exports);
62
63
  __exportStar(require("./CreateMerchantDtoAddress"), exports);
63
64
  __exportStar(require("./CreatePaymentMethodDto"), exports);
65
+ __exportStar(require("./CreateProvisionedCardTokenDto"), exports);
64
66
  __exportStar(require("./CreateStoredCardPaymentMethod"), exports);
65
67
  __exportStar(require("./CreateTransactionNoteDto"), exports);
66
68
  __exportStar(require("./CreateTransactionRefundDto"), exports);
@@ -87,6 +89,7 @@ __exportStar(require("./PaymentMethodEntity"), exports);
87
89
  __exportStar(require("./PaymentMethodEntityAccountDetails"), exports);
88
90
  __exportStar(require("./PaymentMethodEntityBuyer"), exports);
89
91
  __exportStar(require("./PaymentMethodEntityCardDetails"), exports);
92
+ __exportStar(require("./PaymentMethodEntityConnectorServiceTokens"), exports);
90
93
  __exportStar(require("./PaymentMethodServiceEntity"), exports);
91
94
  __exportStar(require("./PaymentMethodsSearchEntity"), exports);
92
95
  __exportStar(require("./ReturnedTransactionEntity"), exports);
@@ -100,7 +100,7 @@ class BaseAPI {
100
100
  createFetchParams(context) {
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
102
  Object.keys(context.headers).forEach(key => context.headers[key] === undefined ? delete context.headers[key] : {});
103
- context.headers['user-agent'] = "@channelpayments/node-sdk/v1.124.1";
103
+ context.headers['user-agent'] = "@channelpayments/node-sdk/v1.128.0";
104
104
  const token = this.generateAuthToken();
105
105
  context.headers['Authorization'] = `Bearer ${token}`;
106
106
  let url = this.url + context.path;
@@ -5,10 +5,13 @@
5
5
  *
6
6
  */
7
7
  import * as runtime from '../runtime';
8
- import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, CheckoutSessionEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateTransactionNoteDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, TagDto, TransactionEntity, TransactionNoteEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionReturnsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
8
+ import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, CheckoutSessionEntity, ConnectorServiceTokenEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateProvisionedCardTokenDto, CreateTransactionNoteDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, TagDto, TransactionEntity, TransactionNoteEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionReturnsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
9
9
  export interface DeleteBuyerRequest {
10
10
  buyerId: string;
11
11
  }
12
+ export interface DeleteConnectorServiceTokenRequest {
13
+ connectorServiceTokenId: any;
14
+ }
12
15
  export interface DeletePaymentMethodRequest {
13
16
  paymentMethodId: any;
14
17
  }
@@ -21,6 +24,12 @@ export interface GetBuyerRequest {
21
24
  export interface GetCheckoutSessionRequest {
22
25
  sessionId: string;
23
26
  }
27
+ export interface GetConnectorServiceTokenRequest {
28
+ connectorServiceTokenId: any;
29
+ }
30
+ export interface GetConnectorServiceTokensRequest {
31
+ paymentMethodId: any;
32
+ }
24
33
  export interface GetPaymentMethodRequest {
25
34
  paymentMethodId: any;
26
35
  }
@@ -145,6 +154,11 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
145
154
  * Remove buyer.
146
155
  */
147
156
  deleteBuyer(requestParameters: DeleteBuyerRequest): Promise<BuyersEntity>;
157
+ /**
158
+ * Delete connector service token by connectorServiceTokenId.
159
+ * Delete connector service token.
160
+ */
161
+ deleteConnectorServiceToken(requestParameters: DeleteConnectorServiceTokenRequest): Promise<ConnectorServiceTokenEntity>;
148
162
  /**
149
163
  * Delete payment method by paymentMethodId.
150
164
  * Delete payment method.
@@ -170,6 +184,16 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
170
184
  * Find child merchants
171
185
  */
172
186
  getChildMerchants(): Promise<Array<MerchantEntity>>;
187
+ /**
188
+ * Find connector service token by connectorServiceTokenId.
189
+ * Find connector service token.
190
+ */
191
+ getConnectorServiceToken(requestParameters: GetConnectorServiceTokenRequest): Promise<ConnectorServiceTokenEntity>;
192
+ /**
193
+ * Find connector service tokens by paymentMethodId.
194
+ * Find connector service tokens.
195
+ */
196
+ getConnectorServiceTokens(requestParameters: GetConnectorServiceTokensRequest): Promise<Array<ConnectorServiceTokenEntity>>;
173
197
  /**
174
198
  * Retrieve the merchant associated with the user making the request.
175
199
  * Find merchant
@@ -190,6 +214,11 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
190
214
  * Find transaction
191
215
  */
192
216
  getTransaction(requestParameters: GetTransactionRequest): Promise<TransactionEntity>;
217
+ /**
218
+ * Provision a stored payment method.
219
+ * Provision stored payment method.
220
+ */
221
+ provisionCardPaymentMethod(requestParameters: CreateProvisionedCardTokenDto): Promise<ConnectorServiceTokenEntity>;
193
222
  /**
194
223
  * Attempts to refund a captured transaction
195
224
  * Refund a transaction
@@ -7,7 +7,7 @@
7
7
  *
8
8
  */
9
9
  import * as runtime from '../runtime';
10
- import { BuyersEntityFromJSON, BuyersSearchEntityFromJSON, CaptureTransactionDtoToJSON, CheckoutSessionEntityFromJSON, CreateBuyerDtoToJSON, CreateCheckoutSessionDtoToJSON, CreatePaymentMethodDtoToJSON, CreateTransactionNoteDtoToJSON, CreateTransactionRefundDtoToJSON, CreateTransactionRequestDtoToJSON, ErrorEntityFromJSON, MerchantEntityFromJSON, PaymentMethodEntityFromJSON, PaymentMethodsSearchEntityFromJSON, TransactionEntityFromJSON, TransactionNoteEntityFromJSON, TransactionRefundEntityFromJSON, TransactionRefundsSearchEntityFromJSON, TransactionReturnsSearchEntityFromJSON, TransactionsSearchEntityFromJSON, UpdateBuyerDtoToJSON, } from '../models';
10
+ import { BuyersEntityFromJSON, BuyersSearchEntityFromJSON, CaptureTransactionDtoToJSON, CheckoutSessionEntityFromJSON, ConnectorServiceTokenEntityFromJSON, CreateBuyerDtoToJSON, CreateCheckoutSessionDtoToJSON, CreatePaymentMethodDtoToJSON, CreateProvisionedCardTokenDtoToJSON, CreateTransactionNoteDtoToJSON, CreateTransactionRefundDtoToJSON, CreateTransactionRequestDtoToJSON, ErrorEntityFromJSON, MerchantEntityFromJSON, PaymentMethodEntityFromJSON, PaymentMethodsSearchEntityFromJSON, TransactionEntityFromJSON, TransactionNoteEntityFromJSON, TransactionRefundEntityFromJSON, TransactionRefundsSearchEntityFromJSON, TransactionReturnsSearchEntityFromJSON, TransactionsSearchEntityFromJSON, UpdateBuyerDtoToJSON, } from '../models';
11
11
  /**
12
12
  *
13
13
  */
@@ -436,6 +436,71 @@ export class ChannelPaymentsApi extends runtime.BaseAPI {
436
436
  }
437
437
  return await response.value();
438
438
  }
439
+ /**
440
+ * Delete connector service token by connectorServiceTokenId.
441
+ * Delete connector service token.
442
+ */
443
+ async deleteConnectorServiceToken(requestParameters) {
444
+ if (requestParameters.connectorServiceTokenId === null || requestParameters.connectorServiceTokenId === undefined) {
445
+ throw new runtime.RequiredError('connectorServiceTokenId', 'Required parameter \'connectorServiceTokenId\' was null or undefined when calling deleteConnectorServiceToken.');
446
+ }
447
+ const queryParameters = {};
448
+ const headerParameters = {};
449
+ const rawResponse = await this.request({
450
+ path: `/payment-methods/service-token/{connectorServiceTokenId}`.replace(`{${"connectorServiceTokenId"}}`, encodeURIComponent(String(requestParameters.connectorServiceTokenId))),
451
+ method: 'DELETE',
452
+ headers: headerParameters,
453
+ query: queryParameters,
454
+ });
455
+ let response;
456
+ if (rawResponse.status === 200) {
457
+ response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ConnectorServiceTokenEntityFromJSON(jsonValue));
458
+ }
459
+ if (rawResponse.status === 400) {
460
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
461
+ const error = await errorResponse.value();
462
+ throw error;
463
+ }
464
+ if (rawResponse.status === 401) {
465
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
466
+ const error = await errorResponse.value();
467
+ throw error;
468
+ }
469
+ if (rawResponse.status === 403) {
470
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
471
+ const error = await errorResponse.value();
472
+ throw error;
473
+ }
474
+ if (rawResponse.status === 404) {
475
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
476
+ const error = await errorResponse.value();
477
+ throw error;
478
+ }
479
+ if (rawResponse.status === 500) {
480
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
481
+ const error = await errorResponse.value();
482
+ throw error;
483
+ }
484
+ if (rawResponse.status === 502) {
485
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
486
+ const error = await errorResponse.value();
487
+ throw error;
488
+ }
489
+ if (rawResponse.status === 503) {
490
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
491
+ const error = await errorResponse.value();
492
+ throw error;
493
+ }
494
+ if (rawResponse.status === 504) {
495
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
496
+ const error = await errorResponse.value();
497
+ throw error;
498
+ }
499
+ if (!response) {
500
+ response = new runtime.TextApiResponse(rawResponse);
501
+ }
502
+ return await response.value();
503
+ }
439
504
  /**
440
505
  * Delete payment method by paymentMethodId.
441
506
  * Delete payment method.
@@ -758,6 +823,136 @@ export class ChannelPaymentsApi extends runtime.BaseAPI {
758
823
  }
759
824
  return await response.value();
760
825
  }
826
+ /**
827
+ * Find connector service token by connectorServiceTokenId.
828
+ * Find connector service token.
829
+ */
830
+ async getConnectorServiceToken(requestParameters) {
831
+ if (requestParameters.connectorServiceTokenId === null || requestParameters.connectorServiceTokenId === undefined) {
832
+ throw new runtime.RequiredError('connectorServiceTokenId', 'Required parameter \'connectorServiceTokenId\' was null or undefined when calling getConnectorServiceToken.');
833
+ }
834
+ const queryParameters = {};
835
+ const headerParameters = {};
836
+ const rawResponse = await this.request({
837
+ path: `/payment-methods/service-token/{connectorServiceTokenId}`.replace(`{${"connectorServiceTokenId"}}`, encodeURIComponent(String(requestParameters.connectorServiceTokenId))),
838
+ method: 'GET',
839
+ headers: headerParameters,
840
+ query: queryParameters,
841
+ });
842
+ let response;
843
+ if (rawResponse.status === 200) {
844
+ response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ConnectorServiceTokenEntityFromJSON(jsonValue));
845
+ }
846
+ if (rawResponse.status === 400) {
847
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
848
+ const error = await errorResponse.value();
849
+ throw error;
850
+ }
851
+ if (rawResponse.status === 401) {
852
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
853
+ const error = await errorResponse.value();
854
+ throw error;
855
+ }
856
+ if (rawResponse.status === 403) {
857
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
858
+ const error = await errorResponse.value();
859
+ throw error;
860
+ }
861
+ if (rawResponse.status === 404) {
862
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
863
+ const error = await errorResponse.value();
864
+ throw error;
865
+ }
866
+ if (rawResponse.status === 500) {
867
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
868
+ const error = await errorResponse.value();
869
+ throw error;
870
+ }
871
+ if (rawResponse.status === 502) {
872
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
873
+ const error = await errorResponse.value();
874
+ throw error;
875
+ }
876
+ if (rawResponse.status === 503) {
877
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
878
+ const error = await errorResponse.value();
879
+ throw error;
880
+ }
881
+ if (rawResponse.status === 504) {
882
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
883
+ const error = await errorResponse.value();
884
+ throw error;
885
+ }
886
+ if (!response) {
887
+ response = new runtime.TextApiResponse(rawResponse);
888
+ }
889
+ return await response.value();
890
+ }
891
+ /**
892
+ * Find connector service tokens by paymentMethodId.
893
+ * Find connector service tokens.
894
+ */
895
+ async getConnectorServiceTokens(requestParameters) {
896
+ if (requestParameters.paymentMethodId === null || requestParameters.paymentMethodId === undefined) {
897
+ throw new runtime.RequiredError('paymentMethodId', 'Required parameter \'paymentMethodId\' was null or undefined when calling getConnectorServiceTokens.');
898
+ }
899
+ const queryParameters = {};
900
+ const headerParameters = {};
901
+ const rawResponse = await this.request({
902
+ path: `/payment-methods/service-tokens/{paymentMethodId}`.replace(`{${"paymentMethodId"}}`, encodeURIComponent(String(requestParameters.paymentMethodId))),
903
+ method: 'GET',
904
+ headers: headerParameters,
905
+ query: queryParameters,
906
+ });
907
+ let response;
908
+ if (rawResponse.status === 200) {
909
+ response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => jsonValue.map(ConnectorServiceTokenEntityFromJSON));
910
+ }
911
+ if (rawResponse.status === 400) {
912
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
913
+ const error = await errorResponse.value();
914
+ throw error;
915
+ }
916
+ if (rawResponse.status === 401) {
917
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
918
+ const error = await errorResponse.value();
919
+ throw error;
920
+ }
921
+ if (rawResponse.status === 403) {
922
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
923
+ const error = await errorResponse.value();
924
+ throw error;
925
+ }
926
+ if (rawResponse.status === 404) {
927
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
928
+ const error = await errorResponse.value();
929
+ throw error;
930
+ }
931
+ if (rawResponse.status === 500) {
932
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
933
+ const error = await errorResponse.value();
934
+ throw error;
935
+ }
936
+ if (rawResponse.status === 502) {
937
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
938
+ const error = await errorResponse.value();
939
+ throw error;
940
+ }
941
+ if (rawResponse.status === 503) {
942
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
943
+ const error = await errorResponse.value();
944
+ throw error;
945
+ }
946
+ if (rawResponse.status === 504) {
947
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
948
+ const error = await errorResponse.value();
949
+ throw error;
950
+ }
951
+ if (!response) {
952
+ response = new runtime.TextApiResponse(rawResponse);
953
+ }
954
+ return await response.value();
955
+ }
761
956
  /**
762
957
  * Retrieve the merchant associated with the user making the request.
763
958
  * Find merchant
@@ -1015,6 +1210,76 @@ export class ChannelPaymentsApi extends runtime.BaseAPI {
1015
1210
  }
1016
1211
  return await response.value();
1017
1212
  }
1213
+ /**
1214
+ * Provision a stored payment method.
1215
+ * Provision stored payment method.
1216
+ */
1217
+ async provisionCardPaymentMethod(requestParameters) {
1218
+ if (requestParameters.paymentMethodId === null || requestParameters.paymentMethodId === undefined) {
1219
+ throw new runtime.RequiredError('paymentMethodId', 'Required parameter \'paymentMethodId\' was null or undefined when calling provisionCardPaymentMethod.');
1220
+ }
1221
+ if (requestParameters.connector === null || requestParameters.connector === undefined) {
1222
+ throw new runtime.RequiredError('connector', 'Required parameter \'connector\' was null or undefined when calling provisionCardPaymentMethod.');
1223
+ }
1224
+ const queryParameters = {};
1225
+ const headerParameters = {};
1226
+ headerParameters['Content-Type'] = 'application/json';
1227
+ const rawResponse = await this.request({
1228
+ path: `/payment-methods/provision-card`,
1229
+ method: 'POST',
1230
+ headers: headerParameters,
1231
+ query: queryParameters,
1232
+ body: CreateProvisionedCardTokenDtoToJSON(requestParameters),
1233
+ });
1234
+ let response;
1235
+ if (rawResponse.status === 201) {
1236
+ response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ConnectorServiceTokenEntityFromJSON(jsonValue));
1237
+ }
1238
+ if (rawResponse.status === 400) {
1239
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1240
+ const error = await errorResponse.value();
1241
+ throw error;
1242
+ }
1243
+ if (rawResponse.status === 401) {
1244
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1245
+ const error = await errorResponse.value();
1246
+ throw error;
1247
+ }
1248
+ if (rawResponse.status === 403) {
1249
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1250
+ const error = await errorResponse.value();
1251
+ throw error;
1252
+ }
1253
+ if (rawResponse.status === 404) {
1254
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1255
+ const error = await errorResponse.value();
1256
+ throw error;
1257
+ }
1258
+ if (rawResponse.status === 500) {
1259
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1260
+ const error = await errorResponse.value();
1261
+ throw error;
1262
+ }
1263
+ if (rawResponse.status === 502) {
1264
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1265
+ const error = await errorResponse.value();
1266
+ throw error;
1267
+ }
1268
+ if (rawResponse.status === 503) {
1269
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1270
+ const error = await errorResponse.value();
1271
+ throw error;
1272
+ }
1273
+ if (rawResponse.status === 504) {
1274
+ const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
1275
+ const error = await errorResponse.value();
1276
+ throw error;
1277
+ }
1278
+ if (!response) {
1279
+ response = new runtime.TextApiResponse(rawResponse);
1280
+ }
1281
+ return await response.value();
1282
+ }
1018
1283
  /**
1019
1284
  * Attempts to refund a captured transaction
1020
1285
  * Refund a transaction
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Channel Payments API
3
+ *
4
+ * NOTE: This class is auto generated. Do not edit the class manually.
5
+ *
6
+ */
7
+ /**
8
+ *
9
+ * @export
10
+ * @interface ConnectorServiceTokenEntity
11
+ */
12
+ export interface ConnectorServiceTokenEntity {
13
+ /**
14
+ * The id of the payment method associated with the connector service token.
15
+ * @type {string}
16
+ * @memberof ConnectorServiceTokenEntity
17
+ */
18
+ paymentMethodId: string;
19
+ /**
20
+ * The id of the connector service token.
21
+ * @type {string}
22
+ * @memberof ConnectorServiceTokenEntity
23
+ */
24
+ connectorServiceTokenId: string;
25
+ /**
26
+ * The token of the connector service token.
27
+ * @type {string}
28
+ * @memberof ConnectorServiceTokenEntity
29
+ */
30
+ token: string;
31
+ /**
32
+ * The connector of the connector service token.
33
+ * @type {object}
34
+ * @memberof ConnectorServiceTokenEntity
35
+ */
36
+ connector: object;
37
+ /**
38
+ * The date and time the token was created.
39
+ * @type {Date}
40
+ * @memberof ConnectorServiceTokenEntity
41
+ */
42
+ createdAt: Date;
43
+ /**
44
+ * The date and time the token was last updated.
45
+ * @type {Date}
46
+ * @memberof ConnectorServiceTokenEntity
47
+ */
48
+ updatedAt: Date;
49
+ /**
50
+ * The approval url for the token.
51
+ * @type {string}
52
+ * @memberof ConnectorServiceTokenEntity
53
+ */
54
+ approvalUrl?: string;
55
+ }
56
+ /**
57
+ * Check if a given object implements the ConnectorServiceTokenEntity interface.
58
+ */
59
+ export declare function instanceOfConnectorServiceTokenEntity(value: object): boolean;
60
+ export declare function ConnectorServiceTokenEntityFromJSON(json: any): ConnectorServiceTokenEntity;
61
+ export declare function ConnectorServiceTokenEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConnectorServiceTokenEntity;
62
+ export declare function ConnectorServiceTokenEntityToJSON(value?: ConnectorServiceTokenEntity | null): any;