@channelpayments/node-sdk 1.182.0 → 1.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/apis/ChannelPaymentsApi.d.ts +9 -1
- package/dist/cjs/apis/ChannelPaymentsApi.js +70 -0
- package/dist/cjs/models/FeeDetailsEntity.d.ts +53 -0
- package/dist/cjs/models/FeeDetailsEntity.js +66 -0
- package/dist/cjs/models/MerchantFeeDetailsEntity.d.ts +39 -0
- package/dist/cjs/models/MerchantFeeDetailsEntity.js +53 -0
- package/dist/cjs/models/PaymentMethodFeeDetailsEntity.d.ts +54 -0
- package/dist/cjs/models/PaymentMethodFeeDetailsEntity.js +65 -0
- package/dist/cjs/models/TransactionEntity.d.ts +0 -6
- package/dist/cjs/models/TransactionEntity.js +0 -2
- package/dist/cjs/models/index.d.ts +3 -0
- package/dist/cjs/models/index.js +3 -0
- package/dist/cjs/runtime.js +1 -1
- package/dist/mjs/apis/ChannelPaymentsApi.d.ts +9 -1
- package/dist/mjs/apis/ChannelPaymentsApi.js +69 -1
- package/dist/mjs/models/FeeDetailsEntity.d.ts +53 -0
- package/dist/mjs/models/FeeDetailsEntity.js +59 -0
- package/dist/mjs/models/MerchantFeeDetailsEntity.d.ts +39 -0
- package/dist/mjs/models/MerchantFeeDetailsEntity.js +47 -0
- package/dist/mjs/models/PaymentMethodFeeDetailsEntity.d.ts +54 -0
- package/dist/mjs/models/PaymentMethodFeeDetailsEntity.js +58 -0
- package/dist/mjs/models/TransactionEntity.d.ts +0 -6
- package/dist/mjs/models/TransactionEntity.js +0 -2
- package/dist/mjs/models/index.d.ts +3 -0
- package/dist/mjs/models/index.js +3 -0
- package/dist/mjs/runtime.js +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
import * as runtime from '../runtime';
|
|
8
|
-
import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, ChangeNotificationEntity, ChangeNotificationsSearchEntity, CheckoutSessionEntity, ConnectorServiceTokenEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateProvisionedCardTokenDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, ReturnNotificationEntity, ReturnNotificationsSearchEntity, TagDto, TransactionEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
|
|
8
|
+
import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, ChangeNotificationEntity, ChangeNotificationsSearchEntity, CheckoutSessionEntity, ConnectorServiceTokenEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateProvisionedCardTokenDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, MerchantFeeDetailsEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, ReturnNotificationEntity, ReturnNotificationsSearchEntity, TagDto, TransactionEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
|
|
9
|
+
export interface GetFeeDetailsRequest {
|
|
10
|
+
amount: string;
|
|
11
|
+
}
|
|
9
12
|
export interface SearchBuyersRequest {
|
|
10
13
|
merchantId: string;
|
|
11
14
|
buyerId?: string;
|
|
@@ -168,6 +171,11 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
168
171
|
* Find connector service tokens.
|
|
169
172
|
*/
|
|
170
173
|
getConnectorServiceTokens(paymentMethodId: string): Promise<Array<ConnectorServiceTokenEntity>>;
|
|
174
|
+
/**
|
|
175
|
+
* Get fee details by amount
|
|
176
|
+
* Get fee details
|
|
177
|
+
*/
|
|
178
|
+
getFeeDetails(requestParameters: GetFeeDetailsRequest): Promise<MerchantFeeDetailsEntity>;
|
|
171
179
|
/**
|
|
172
180
|
* Retrieve the merchant associated with the user making the request.
|
|
173
181
|
* Find merchant
|
|
@@ -1045,6 +1045,76 @@ class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
1045
1045
|
return yield response.value();
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Get fee details by amount
|
|
1050
|
+
* Get fee details
|
|
1051
|
+
*/
|
|
1052
|
+
getFeeDetails(requestParameters) {
|
|
1053
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1054
|
+
if (requestParameters.amount === null || requestParameters.amount === undefined) {
|
|
1055
|
+
throw new runtime.RequiredError('amount', 'Required parameter \'amount\' was null or undefined when calling getFeeDetails.');
|
|
1056
|
+
}
|
|
1057
|
+
const queryParameters = {};
|
|
1058
|
+
if (requestParameters.amount !== undefined) {
|
|
1059
|
+
queryParameters['amount'] = requestParameters.amount;
|
|
1060
|
+
}
|
|
1061
|
+
const headerParameters = {};
|
|
1062
|
+
const rawResponse = yield this.request({
|
|
1063
|
+
path: `/transactions/fee-details`,
|
|
1064
|
+
method: 'GET',
|
|
1065
|
+
headers: headerParameters,
|
|
1066
|
+
query: queryParameters,
|
|
1067
|
+
});
|
|
1068
|
+
let response;
|
|
1069
|
+
if (rawResponse.status === 200) {
|
|
1070
|
+
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.MerchantFeeDetailsEntityFromJSON)(jsonValue));
|
|
1071
|
+
}
|
|
1072
|
+
if (rawResponse.status === 400) {
|
|
1073
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1074
|
+
const error = yield errorResponse.value();
|
|
1075
|
+
throw error;
|
|
1076
|
+
}
|
|
1077
|
+
if (rawResponse.status === 401) {
|
|
1078
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1079
|
+
const error = yield errorResponse.value();
|
|
1080
|
+
throw error;
|
|
1081
|
+
}
|
|
1082
|
+
if (rawResponse.status === 403) {
|
|
1083
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1084
|
+
const error = yield errorResponse.value();
|
|
1085
|
+
throw error;
|
|
1086
|
+
}
|
|
1087
|
+
if (rawResponse.status === 404) {
|
|
1088
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1089
|
+
const error = yield errorResponse.value();
|
|
1090
|
+
throw error;
|
|
1091
|
+
}
|
|
1092
|
+
if (rawResponse.status === 500) {
|
|
1093
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1094
|
+
const error = yield errorResponse.value();
|
|
1095
|
+
throw error;
|
|
1096
|
+
}
|
|
1097
|
+
if (rawResponse.status === 502) {
|
|
1098
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1099
|
+
const error = yield errorResponse.value();
|
|
1100
|
+
throw error;
|
|
1101
|
+
}
|
|
1102
|
+
if (rawResponse.status === 503) {
|
|
1103
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1104
|
+
const error = yield errorResponse.value();
|
|
1105
|
+
throw error;
|
|
1106
|
+
}
|
|
1107
|
+
if (rawResponse.status === 504) {
|
|
1108
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => (0, models_1.ErrorEntityFromJSON)(jsonValue));
|
|
1109
|
+
const error = yield errorResponse.value();
|
|
1110
|
+
throw error;
|
|
1111
|
+
}
|
|
1112
|
+
if (!response) {
|
|
1113
|
+
response = new runtime.TextApiResponse(rawResponse);
|
|
1114
|
+
}
|
|
1115
|
+
return yield response.value();
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1048
1118
|
/**
|
|
1049
1119
|
* Retrieve the merchant associated with the user making the request.
|
|
1050
1120
|
* Find merchant
|
|
@@ -0,0 +1,53 @@
|
|
|
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 FeeDetailsEntity
|
|
11
|
+
*/
|
|
12
|
+
export interface FeeDetailsEntity {
|
|
13
|
+
/**
|
|
14
|
+
* The type of the transaction fee.
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof FeeDetailsEntity
|
|
17
|
+
*/
|
|
18
|
+
type: FeeDetailsEntityTypeEnum;
|
|
19
|
+
/**
|
|
20
|
+
* The type of charge for the transaction fee.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof FeeDetailsEntity
|
|
23
|
+
*/
|
|
24
|
+
chargeType: FeeDetailsEntityChargeTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* The amount of the transaction fee.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof FeeDetailsEntity
|
|
29
|
+
*/
|
|
30
|
+
amount: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const FeeDetailsEntityTypeEnum: {
|
|
36
|
+
readonly ConvenienceFee: "CONVENIENCE_FEE";
|
|
37
|
+
};
|
|
38
|
+
export type FeeDetailsEntityTypeEnum = typeof FeeDetailsEntityTypeEnum[keyof typeof FeeDetailsEntityTypeEnum];
|
|
39
|
+
/**
|
|
40
|
+
* @export
|
|
41
|
+
*/
|
|
42
|
+
export declare const FeeDetailsEntityChargeTypeEnum: {
|
|
43
|
+
readonly IncludedInAmount: "INCLUDED_IN_AMOUNT";
|
|
44
|
+
readonly ChargedSeparately: "CHARGED_SEPARATELY";
|
|
45
|
+
};
|
|
46
|
+
export type FeeDetailsEntityChargeTypeEnum = typeof FeeDetailsEntityChargeTypeEnum[keyof typeof FeeDetailsEntityChargeTypeEnum];
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the FeeDetailsEntity interface.
|
|
49
|
+
*/
|
|
50
|
+
export declare function instanceOfFeeDetailsEntity(value: object): boolean;
|
|
51
|
+
export declare function FeeDetailsEntityFromJSON(json: any): FeeDetailsEntity;
|
|
52
|
+
export declare function FeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeeDetailsEntity;
|
|
53
|
+
export declare function FeeDetailsEntityToJSON(value?: FeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,66 @@
|
|
|
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.FeeDetailsEntityChargeTypeEnum = exports.FeeDetailsEntityTypeEnum = void 0;
|
|
12
|
+
exports.instanceOfFeeDetailsEntity = instanceOfFeeDetailsEntity;
|
|
13
|
+
exports.FeeDetailsEntityFromJSON = FeeDetailsEntityFromJSON;
|
|
14
|
+
exports.FeeDetailsEntityFromJSONTyped = FeeDetailsEntityFromJSONTyped;
|
|
15
|
+
exports.FeeDetailsEntityToJSON = FeeDetailsEntityToJSON;
|
|
16
|
+
const runtime_1 = require("../runtime");
|
|
17
|
+
/**
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
exports.FeeDetailsEntityTypeEnum = {
|
|
21
|
+
ConvenienceFee: 'CONVENIENCE_FEE'
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.FeeDetailsEntityChargeTypeEnum = {
|
|
27
|
+
IncludedInAmount: 'INCLUDED_IN_AMOUNT',
|
|
28
|
+
ChargedSeparately: 'CHARGED_SEPARATELY'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the FeeDetailsEntity interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfFeeDetailsEntity(value) {
|
|
34
|
+
let isInstance = true;
|
|
35
|
+
isInstance = isInstance && "type" in value;
|
|
36
|
+
isInstance = isInstance && "chargeType" in value;
|
|
37
|
+
isInstance = isInstance && "amount" in value;
|
|
38
|
+
return isInstance;
|
|
39
|
+
}
|
|
40
|
+
function FeeDetailsEntityFromJSON(json) {
|
|
41
|
+
return FeeDetailsEntityFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function FeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
44
|
+
if ((json === undefined) || (json === null)) {
|
|
45
|
+
return json;
|
|
46
|
+
}
|
|
47
|
+
const typed = {
|
|
48
|
+
'type': json['type'],
|
|
49
|
+
'chargeType': json['chargeType'],
|
|
50
|
+
'amount': json['amount'],
|
|
51
|
+
};
|
|
52
|
+
return (0, runtime_1.removeNullUndefined)(typed);
|
|
53
|
+
}
|
|
54
|
+
function FeeDetailsEntityToJSON(value) {
|
|
55
|
+
if (value === undefined) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
if (value === null) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
'type': value.type,
|
|
63
|
+
'chargeType': value.chargeType,
|
|
64
|
+
'amount': value.amount,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel Payments API
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
import type { PaymentMethodFeeDetailsEntity } from './PaymentMethodFeeDetailsEntity';
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface MerchantFeeDetailsEntity
|
|
12
|
+
*/
|
|
13
|
+
export interface MerchantFeeDetailsEntity {
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the merchant.
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberof MerchantFeeDetailsEntity
|
|
18
|
+
*/
|
|
19
|
+
merchantId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The merchant specified total of the transaction.
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof MerchantFeeDetailsEntity
|
|
24
|
+
*/
|
|
25
|
+
subtotal: string;
|
|
26
|
+
/**
|
|
27
|
+
* The details of the payment method fees.
|
|
28
|
+
* @type {Array<PaymentMethodFeeDetailsEntity>}
|
|
29
|
+
* @memberof MerchantFeeDetailsEntity
|
|
30
|
+
*/
|
|
31
|
+
feeDetails: Array<PaymentMethodFeeDetailsEntity>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the MerchantFeeDetailsEntity interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfMerchantFeeDetailsEntity(value: object): boolean;
|
|
37
|
+
export declare function MerchantFeeDetailsEntityFromJSON(json: any): MerchantFeeDetailsEntity;
|
|
38
|
+
export declare function MerchantFeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): MerchantFeeDetailsEntity;
|
|
39
|
+
export declare function MerchantFeeDetailsEntityToJSON(value?: MerchantFeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
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.instanceOfMerchantFeeDetailsEntity = instanceOfMerchantFeeDetailsEntity;
|
|
12
|
+
exports.MerchantFeeDetailsEntityFromJSON = MerchantFeeDetailsEntityFromJSON;
|
|
13
|
+
exports.MerchantFeeDetailsEntityFromJSONTyped = MerchantFeeDetailsEntityFromJSONTyped;
|
|
14
|
+
exports.MerchantFeeDetailsEntityToJSON = MerchantFeeDetailsEntityToJSON;
|
|
15
|
+
const runtime_1 = require("../runtime");
|
|
16
|
+
const PaymentMethodFeeDetailsEntity_1 = require("./PaymentMethodFeeDetailsEntity");
|
|
17
|
+
/**
|
|
18
|
+
* Check if a given object implements the MerchantFeeDetailsEntity interface.
|
|
19
|
+
*/
|
|
20
|
+
function instanceOfMerchantFeeDetailsEntity(value) {
|
|
21
|
+
let isInstance = true;
|
|
22
|
+
isInstance = isInstance && "merchantId" in value;
|
|
23
|
+
isInstance = isInstance && "subtotal" in value;
|
|
24
|
+
isInstance = isInstance && "feeDetails" in value;
|
|
25
|
+
return isInstance;
|
|
26
|
+
}
|
|
27
|
+
function MerchantFeeDetailsEntityFromJSON(json) {
|
|
28
|
+
return MerchantFeeDetailsEntityFromJSONTyped(json, false);
|
|
29
|
+
}
|
|
30
|
+
function MerchantFeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
31
|
+
if ((json === undefined) || (json === null)) {
|
|
32
|
+
return json;
|
|
33
|
+
}
|
|
34
|
+
const typed = {
|
|
35
|
+
'merchantId': json['merchantId'],
|
|
36
|
+
'subtotal': json['subtotal'],
|
|
37
|
+
'feeDetails': (json['feeDetails'].map(PaymentMethodFeeDetailsEntity_1.PaymentMethodFeeDetailsEntityFromJSON)),
|
|
38
|
+
};
|
|
39
|
+
return (0, runtime_1.removeNullUndefined)(typed);
|
|
40
|
+
}
|
|
41
|
+
function MerchantFeeDetailsEntityToJSON(value) {
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
if (value === null) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'merchantId': value.merchantId,
|
|
50
|
+
'subtotal': value.subtotal,
|
|
51
|
+
'feeDetails': (value.feeDetails.map(PaymentMethodFeeDetailsEntity_1.PaymentMethodFeeDetailsEntityToJSON)),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel Payments API
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
import type { FeeDetailsEntity } from './FeeDetailsEntity';
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface PaymentMethodFeeDetailsEntity
|
|
12
|
+
*/
|
|
13
|
+
export interface PaymentMethodFeeDetailsEntity {
|
|
14
|
+
/**
|
|
15
|
+
* The payment method used for the transaction fee calculation.
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
18
|
+
*/
|
|
19
|
+
method: PaymentMethodFeeDetailsEntityMethodEnum;
|
|
20
|
+
/**
|
|
21
|
+
* The details of the transaction fees.
|
|
22
|
+
* @type {Array<FeeDetailsEntity>}
|
|
23
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
24
|
+
*/
|
|
25
|
+
fees: Array<FeeDetailsEntity>;
|
|
26
|
+
/**
|
|
27
|
+
* The total amount of fees applied.
|
|
28
|
+
* @type {number}
|
|
29
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
30
|
+
*/
|
|
31
|
+
feesTotal: number;
|
|
32
|
+
/**
|
|
33
|
+
* The adjusted total after applying the fees.
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
36
|
+
*/
|
|
37
|
+
adjustedTotal: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @export
|
|
41
|
+
*/
|
|
42
|
+
export declare const PaymentMethodFeeDetailsEntityMethodEnum: {
|
|
43
|
+
readonly Ach: "ACH";
|
|
44
|
+
readonly Bank: "BANK";
|
|
45
|
+
readonly Card: "CARD";
|
|
46
|
+
};
|
|
47
|
+
export type PaymentMethodFeeDetailsEntityMethodEnum = typeof PaymentMethodFeeDetailsEntityMethodEnum[keyof typeof PaymentMethodFeeDetailsEntityMethodEnum];
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the PaymentMethodFeeDetailsEntity interface.
|
|
50
|
+
*/
|
|
51
|
+
export declare function instanceOfPaymentMethodFeeDetailsEntity(value: object): boolean;
|
|
52
|
+
export declare function PaymentMethodFeeDetailsEntityFromJSON(json: any): PaymentMethodFeeDetailsEntity;
|
|
53
|
+
export declare function PaymentMethodFeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentMethodFeeDetailsEntity;
|
|
54
|
+
export declare function PaymentMethodFeeDetailsEntityToJSON(value?: PaymentMethodFeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,65 @@
|
|
|
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.PaymentMethodFeeDetailsEntityMethodEnum = void 0;
|
|
12
|
+
exports.instanceOfPaymentMethodFeeDetailsEntity = instanceOfPaymentMethodFeeDetailsEntity;
|
|
13
|
+
exports.PaymentMethodFeeDetailsEntityFromJSON = PaymentMethodFeeDetailsEntityFromJSON;
|
|
14
|
+
exports.PaymentMethodFeeDetailsEntityFromJSONTyped = PaymentMethodFeeDetailsEntityFromJSONTyped;
|
|
15
|
+
exports.PaymentMethodFeeDetailsEntityToJSON = PaymentMethodFeeDetailsEntityToJSON;
|
|
16
|
+
const runtime_1 = require("../runtime");
|
|
17
|
+
const FeeDetailsEntity_1 = require("./FeeDetailsEntity");
|
|
18
|
+
/**
|
|
19
|
+
* @export
|
|
20
|
+
*/
|
|
21
|
+
exports.PaymentMethodFeeDetailsEntityMethodEnum = {
|
|
22
|
+
Ach: 'ACH',
|
|
23
|
+
Bank: 'BANK',
|
|
24
|
+
Card: 'CARD'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given object implements the PaymentMethodFeeDetailsEntity interface.
|
|
28
|
+
*/
|
|
29
|
+
function instanceOfPaymentMethodFeeDetailsEntity(value) {
|
|
30
|
+
let isInstance = true;
|
|
31
|
+
isInstance = isInstance && "method" in value;
|
|
32
|
+
isInstance = isInstance && "fees" in value;
|
|
33
|
+
isInstance = isInstance && "feesTotal" in value;
|
|
34
|
+
isInstance = isInstance && "adjustedTotal" in value;
|
|
35
|
+
return isInstance;
|
|
36
|
+
}
|
|
37
|
+
function PaymentMethodFeeDetailsEntityFromJSON(json) {
|
|
38
|
+
return PaymentMethodFeeDetailsEntityFromJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
function PaymentMethodFeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
41
|
+
if ((json === undefined) || (json === null)) {
|
|
42
|
+
return json;
|
|
43
|
+
}
|
|
44
|
+
const typed = {
|
|
45
|
+
'method': json['method'],
|
|
46
|
+
'fees': (json['fees'].map(FeeDetailsEntity_1.FeeDetailsEntityFromJSON)),
|
|
47
|
+
'feesTotal': json['feesTotal'],
|
|
48
|
+
'adjustedTotal': json['adjustedTotal'],
|
|
49
|
+
};
|
|
50
|
+
return (0, runtime_1.removeNullUndefined)(typed);
|
|
51
|
+
}
|
|
52
|
+
function PaymentMethodFeeDetailsEntityToJSON(value) {
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
if (value === null) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
'method': value.method,
|
|
61
|
+
'fees': (value.fees.map(FeeDetailsEntity_1.FeeDetailsEntityToJSON)),
|
|
62
|
+
'feesTotal': value.feesTotal,
|
|
63
|
+
'adjustedTotal': value.adjustedTotal,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -125,7 +125,6 @@ function TransactionEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
125
125
|
'settledAt': !(0, runtime_1.exists)(json, 'settledAt') ? undefined : (new Date(json['settledAt'])),
|
|
126
126
|
'returnedAt': !(0, runtime_1.exists)(json, 'returnedAt') ? undefined : (new Date(json['returnedAt'])),
|
|
127
127
|
'tags': !(0, runtime_1.exists)(json, 'tags') ? undefined : (json['tags'].map(TagEntity_1.TagEntityFromJSON)),
|
|
128
|
-
'declineReason': !(0, runtime_1.exists)(json, 'declineReason') ? undefined : json['declineReason'],
|
|
129
128
|
};
|
|
130
129
|
return (0, runtime_1.removeNullUndefined)(typed);
|
|
131
130
|
}
|
|
@@ -176,6 +175,5 @@ function TransactionEntityToJSON(value) {
|
|
|
176
175
|
'settledAt': value.settledAt === undefined ? undefined : (value.settledAt.toISOString()),
|
|
177
176
|
'returnedAt': value.returnedAt === undefined ? undefined : (value.returnedAt.toISOString()),
|
|
178
177
|
'tags': value.tags === undefined ? undefined : (value.tags.map(TagEntity_1.TagEntityToJSON)),
|
|
179
|
-
'declineReason': value.declineReason,
|
|
180
178
|
};
|
|
181
179
|
}
|
|
@@ -48,6 +48,7 @@ export * from './ErrorEntity';
|
|
|
48
48
|
export * from './FeatureEntity';
|
|
49
49
|
export * from './FeatureTargetEntity';
|
|
50
50
|
export * from './FeaturesEntity';
|
|
51
|
+
export * from './FeeDetailsEntity';
|
|
51
52
|
export * from './LogoUploadEntity';
|
|
52
53
|
export * from './MerchantAccountEntity';
|
|
53
54
|
export * from './MerchantAccountServiceEntity';
|
|
@@ -59,6 +60,7 @@ export * from './MerchantConnectorCredentialsServiceEntity';
|
|
|
59
60
|
export * from './MerchantConnectorServiceEntity';
|
|
60
61
|
export * from './MerchantCredentialsEntity';
|
|
61
62
|
export * from './MerchantEntity';
|
|
63
|
+
export * from './MerchantFeeDetailsEntity';
|
|
62
64
|
export * from './MerchantServiceEntity';
|
|
63
65
|
export * from './MerchantSettingsDto';
|
|
64
66
|
export * from './MerchantSettingsEntity';
|
|
@@ -69,6 +71,7 @@ export * from './MerchantThemeLogoEntity';
|
|
|
69
71
|
export * from './PaymentMethodBaseEntity';
|
|
70
72
|
export * from './PaymentMethodDto';
|
|
71
73
|
export * from './PaymentMethodEntity';
|
|
74
|
+
export * from './PaymentMethodFeeDetailsEntity';
|
|
72
75
|
export * from './PaymentMethodServiceEntity';
|
|
73
76
|
export * from './PaymentMethodsSearchEntity';
|
|
74
77
|
export * from './ReturnNotificationEntity';
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -66,6 +66,7 @@ __exportStar(require("./ErrorEntity"), exports);
|
|
|
66
66
|
__exportStar(require("./FeatureEntity"), exports);
|
|
67
67
|
__exportStar(require("./FeatureTargetEntity"), exports);
|
|
68
68
|
__exportStar(require("./FeaturesEntity"), exports);
|
|
69
|
+
__exportStar(require("./FeeDetailsEntity"), exports);
|
|
69
70
|
__exportStar(require("./LogoUploadEntity"), exports);
|
|
70
71
|
__exportStar(require("./MerchantAccountEntity"), exports);
|
|
71
72
|
__exportStar(require("./MerchantAccountServiceEntity"), exports);
|
|
@@ -77,6 +78,7 @@ __exportStar(require("./MerchantConnectorCredentialsServiceEntity"), exports);
|
|
|
77
78
|
__exportStar(require("./MerchantConnectorServiceEntity"), exports);
|
|
78
79
|
__exportStar(require("./MerchantCredentialsEntity"), exports);
|
|
79
80
|
__exportStar(require("./MerchantEntity"), exports);
|
|
81
|
+
__exportStar(require("./MerchantFeeDetailsEntity"), exports);
|
|
80
82
|
__exportStar(require("./MerchantServiceEntity"), exports);
|
|
81
83
|
__exportStar(require("./MerchantSettingsDto"), exports);
|
|
82
84
|
__exportStar(require("./MerchantSettingsEntity"), exports);
|
|
@@ -87,6 +89,7 @@ __exportStar(require("./MerchantThemeLogoEntity"), exports);
|
|
|
87
89
|
__exportStar(require("./PaymentMethodBaseEntity"), exports);
|
|
88
90
|
__exportStar(require("./PaymentMethodDto"), exports);
|
|
89
91
|
__exportStar(require("./PaymentMethodEntity"), exports);
|
|
92
|
+
__exportStar(require("./PaymentMethodFeeDetailsEntity"), exports);
|
|
90
93
|
__exportStar(require("./PaymentMethodServiceEntity"), exports);
|
|
91
94
|
__exportStar(require("./PaymentMethodsSearchEntity"), exports);
|
|
92
95
|
__exportStar(require("./ReturnNotificationEntity"), exports);
|
package/dist/cjs/runtime.js
CHANGED
|
@@ -114,7 +114,7 @@ class BaseAPI {
|
|
|
114
114
|
createFetchParams(context) {
|
|
115
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
116
|
Object.keys(context.headers).forEach(key => context.headers[key] === undefined ? delete context.headers[key] : {});
|
|
117
|
-
context.headers['user-agent'] = "@channelpayments/node-sdk/v1.
|
|
117
|
+
context.headers['user-agent'] = "@channelpayments/node-sdk/v1.183.0";
|
|
118
118
|
const token = this.generateAuthToken();
|
|
119
119
|
context.headers['Authorization'] = `Bearer ${token}`;
|
|
120
120
|
let url = this.url + context.path;
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
import * as runtime from '../runtime';
|
|
8
|
-
import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, ChangeNotificationEntity, ChangeNotificationsSearchEntity, CheckoutSessionEntity, ConnectorServiceTokenEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateProvisionedCardTokenDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, ReturnNotificationEntity, ReturnNotificationsSearchEntity, TagDto, TransactionEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
|
|
8
|
+
import type { BuyersEntity, BuyersSearchEntity, CaptureTransactionDto, ChangeNotificationEntity, ChangeNotificationsSearchEntity, CheckoutSessionEntity, ConnectorServiceTokenEntity, CreateBuyerDto, CreateCheckoutSessionDto, CreatePaymentMethodDto, CreateProvisionedCardTokenDto, CreateTransactionRefundDto, CreateTransactionRequestDto, MerchantEntity, MerchantFeeDetailsEntity, PaymentMethodEntity, PaymentMethodsSearchEntity, ReturnNotificationEntity, ReturnNotificationsSearchEntity, TagDto, TransactionEntity, TransactionRefundEntity, TransactionRefundsSearchEntity, TransactionsSearchEntity, UpdateBuyerDto } from '../models';
|
|
9
|
+
export interface GetFeeDetailsRequest {
|
|
10
|
+
amount: string;
|
|
11
|
+
}
|
|
9
12
|
export interface SearchBuyersRequest {
|
|
10
13
|
merchantId: string;
|
|
11
14
|
buyerId?: string;
|
|
@@ -168,6 +171,11 @@ export declare class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
168
171
|
* Find connector service tokens.
|
|
169
172
|
*/
|
|
170
173
|
getConnectorServiceTokens(paymentMethodId: string): Promise<Array<ConnectorServiceTokenEntity>>;
|
|
174
|
+
/**
|
|
175
|
+
* Get fee details by amount
|
|
176
|
+
* Get fee details
|
|
177
|
+
*/
|
|
178
|
+
getFeeDetails(requestParameters: GetFeeDetailsRequest): Promise<MerchantFeeDetailsEntity>;
|
|
171
179
|
/**
|
|
172
180
|
* Retrieve the merchant associated with the user making the request.
|
|
173
181
|
* Find merchant
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
import * as runtime from '../runtime';
|
|
10
|
-
import { BuyersEntityFromJSON, BuyersSearchEntityFromJSON, CaptureTransactionDtoToJSON, ChangeNotificationEntityFromJSON, ChangeNotificationsSearchEntityFromJSON, CheckoutSessionEntityFromJSON, ConnectorServiceTokenEntityFromJSON, CreateBuyerDtoToJSON, CreateCheckoutSessionDtoToJSON, CreatePaymentMethodDtoToJSON, CreateProvisionedCardTokenDtoToJSON, CreateTransactionRefundDtoToJSON, CreateTransactionRequestDtoToJSON, ErrorEntityFromJSON, MerchantEntityFromJSON, PaymentMethodEntityFromJSON, PaymentMethodsSearchEntityFromJSON, ReturnNotificationEntityFromJSON, ReturnNotificationsSearchEntityFromJSON, TransactionEntityFromJSON, TransactionRefundEntityFromJSON, TransactionRefundsSearchEntityFromJSON, TransactionsSearchEntityFromJSON, UpdateBuyerDtoToJSON, } from '../models';
|
|
10
|
+
import { BuyersEntityFromJSON, BuyersSearchEntityFromJSON, CaptureTransactionDtoToJSON, ChangeNotificationEntityFromJSON, ChangeNotificationsSearchEntityFromJSON, CheckoutSessionEntityFromJSON, ConnectorServiceTokenEntityFromJSON, CreateBuyerDtoToJSON, CreateCheckoutSessionDtoToJSON, CreatePaymentMethodDtoToJSON, CreateProvisionedCardTokenDtoToJSON, CreateTransactionRefundDtoToJSON, CreateTransactionRequestDtoToJSON, ErrorEntityFromJSON, MerchantEntityFromJSON, MerchantFeeDetailsEntityFromJSON, PaymentMethodEntityFromJSON, PaymentMethodsSearchEntityFromJSON, ReturnNotificationEntityFromJSON, ReturnNotificationsSearchEntityFromJSON, TransactionEntityFromJSON, TransactionRefundEntityFromJSON, TransactionRefundsSearchEntityFromJSON, TransactionsSearchEntityFromJSON, UpdateBuyerDtoToJSON, } from '../models';
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
@@ -972,6 +972,74 @@ export class ChannelPaymentsApi extends runtime.BaseAPI {
|
|
|
972
972
|
}
|
|
973
973
|
return await response.value();
|
|
974
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* Get fee details by amount
|
|
977
|
+
* Get fee details
|
|
978
|
+
*/
|
|
979
|
+
async getFeeDetails(requestParameters) {
|
|
980
|
+
if (requestParameters.amount === null || requestParameters.amount === undefined) {
|
|
981
|
+
throw new runtime.RequiredError('amount', 'Required parameter \'amount\' was null or undefined when calling getFeeDetails.');
|
|
982
|
+
}
|
|
983
|
+
const queryParameters = {};
|
|
984
|
+
if (requestParameters.amount !== undefined) {
|
|
985
|
+
queryParameters['amount'] = requestParameters.amount;
|
|
986
|
+
}
|
|
987
|
+
const headerParameters = {};
|
|
988
|
+
const rawResponse = await this.request({
|
|
989
|
+
path: `/transactions/fee-details`,
|
|
990
|
+
method: 'GET',
|
|
991
|
+
headers: headerParameters,
|
|
992
|
+
query: queryParameters,
|
|
993
|
+
});
|
|
994
|
+
let response;
|
|
995
|
+
if (rawResponse.status === 200) {
|
|
996
|
+
response = new runtime.JSONApiResponse(rawResponse, (jsonValue) => MerchantFeeDetailsEntityFromJSON(jsonValue));
|
|
997
|
+
}
|
|
998
|
+
if (rawResponse.status === 400) {
|
|
999
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1000
|
+
const error = await errorResponse.value();
|
|
1001
|
+
throw error;
|
|
1002
|
+
}
|
|
1003
|
+
if (rawResponse.status === 401) {
|
|
1004
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1005
|
+
const error = await errorResponse.value();
|
|
1006
|
+
throw error;
|
|
1007
|
+
}
|
|
1008
|
+
if (rawResponse.status === 403) {
|
|
1009
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1010
|
+
const error = await errorResponse.value();
|
|
1011
|
+
throw error;
|
|
1012
|
+
}
|
|
1013
|
+
if (rawResponse.status === 404) {
|
|
1014
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1015
|
+
const error = await errorResponse.value();
|
|
1016
|
+
throw error;
|
|
1017
|
+
}
|
|
1018
|
+
if (rawResponse.status === 500) {
|
|
1019
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1020
|
+
const error = await errorResponse.value();
|
|
1021
|
+
throw error;
|
|
1022
|
+
}
|
|
1023
|
+
if (rawResponse.status === 502) {
|
|
1024
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1025
|
+
const error = await errorResponse.value();
|
|
1026
|
+
throw error;
|
|
1027
|
+
}
|
|
1028
|
+
if (rawResponse.status === 503) {
|
|
1029
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1030
|
+
const error = await errorResponse.value();
|
|
1031
|
+
throw error;
|
|
1032
|
+
}
|
|
1033
|
+
if (rawResponse.status === 504) {
|
|
1034
|
+
const errorResponse = new runtime.JSONApiResponse(rawResponse, (jsonValue) => ErrorEntityFromJSON(jsonValue));
|
|
1035
|
+
const error = await errorResponse.value();
|
|
1036
|
+
throw error;
|
|
1037
|
+
}
|
|
1038
|
+
if (!response) {
|
|
1039
|
+
response = new runtime.TextApiResponse(rawResponse);
|
|
1040
|
+
}
|
|
1041
|
+
return await response.value();
|
|
1042
|
+
}
|
|
975
1043
|
/**
|
|
976
1044
|
* Retrieve the merchant associated with the user making the request.
|
|
977
1045
|
* Find merchant
|
|
@@ -0,0 +1,53 @@
|
|
|
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 FeeDetailsEntity
|
|
11
|
+
*/
|
|
12
|
+
export interface FeeDetailsEntity {
|
|
13
|
+
/**
|
|
14
|
+
* The type of the transaction fee.
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof FeeDetailsEntity
|
|
17
|
+
*/
|
|
18
|
+
type: FeeDetailsEntityTypeEnum;
|
|
19
|
+
/**
|
|
20
|
+
* The type of charge for the transaction fee.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof FeeDetailsEntity
|
|
23
|
+
*/
|
|
24
|
+
chargeType: FeeDetailsEntityChargeTypeEnum;
|
|
25
|
+
/**
|
|
26
|
+
* The amount of the transaction fee.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof FeeDetailsEntity
|
|
29
|
+
*/
|
|
30
|
+
amount: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const FeeDetailsEntityTypeEnum: {
|
|
36
|
+
readonly ConvenienceFee: "CONVENIENCE_FEE";
|
|
37
|
+
};
|
|
38
|
+
export type FeeDetailsEntityTypeEnum = typeof FeeDetailsEntityTypeEnum[keyof typeof FeeDetailsEntityTypeEnum];
|
|
39
|
+
/**
|
|
40
|
+
* @export
|
|
41
|
+
*/
|
|
42
|
+
export declare const FeeDetailsEntityChargeTypeEnum: {
|
|
43
|
+
readonly IncludedInAmount: "INCLUDED_IN_AMOUNT";
|
|
44
|
+
readonly ChargedSeparately: "CHARGED_SEPARATELY";
|
|
45
|
+
};
|
|
46
|
+
export type FeeDetailsEntityChargeTypeEnum = typeof FeeDetailsEntityChargeTypeEnum[keyof typeof FeeDetailsEntityChargeTypeEnum];
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the FeeDetailsEntity interface.
|
|
49
|
+
*/
|
|
50
|
+
export declare function instanceOfFeeDetailsEntity(value: object): boolean;
|
|
51
|
+
export declare function FeeDetailsEntityFromJSON(json: any): FeeDetailsEntity;
|
|
52
|
+
export declare function FeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeeDetailsEntity;
|
|
53
|
+
export declare function FeeDetailsEntityToJSON(value?: FeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Channel Payments API
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { removeNullUndefined } from '../runtime';
|
|
10
|
+
/**
|
|
11
|
+
* @export
|
|
12
|
+
*/
|
|
13
|
+
export const FeeDetailsEntityTypeEnum = {
|
|
14
|
+
ConvenienceFee: 'CONVENIENCE_FEE'
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export const FeeDetailsEntityChargeTypeEnum = {
|
|
20
|
+
IncludedInAmount: 'INCLUDED_IN_AMOUNT',
|
|
21
|
+
ChargedSeparately: 'CHARGED_SEPARATELY'
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the FeeDetailsEntity interface.
|
|
25
|
+
*/
|
|
26
|
+
export function instanceOfFeeDetailsEntity(value) {
|
|
27
|
+
let isInstance = true;
|
|
28
|
+
isInstance = isInstance && "type" in value;
|
|
29
|
+
isInstance = isInstance && "chargeType" in value;
|
|
30
|
+
isInstance = isInstance && "amount" in value;
|
|
31
|
+
return isInstance;
|
|
32
|
+
}
|
|
33
|
+
export function FeeDetailsEntityFromJSON(json) {
|
|
34
|
+
return FeeDetailsEntityFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function FeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if ((json === undefined) || (json === null)) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
const typed = {
|
|
41
|
+
'type': json['type'],
|
|
42
|
+
'chargeType': json['chargeType'],
|
|
43
|
+
'amount': json['amount'],
|
|
44
|
+
};
|
|
45
|
+
return removeNullUndefined(typed);
|
|
46
|
+
}
|
|
47
|
+
export function FeeDetailsEntityToJSON(value) {
|
|
48
|
+
if (value === undefined) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
if (value === null) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
'type': value.type,
|
|
56
|
+
'chargeType': value.chargeType,
|
|
57
|
+
'amount': value.amount,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel Payments API
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
import type { PaymentMethodFeeDetailsEntity } from './PaymentMethodFeeDetailsEntity';
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface MerchantFeeDetailsEntity
|
|
12
|
+
*/
|
|
13
|
+
export interface MerchantFeeDetailsEntity {
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the merchant.
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberof MerchantFeeDetailsEntity
|
|
18
|
+
*/
|
|
19
|
+
merchantId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The merchant specified total of the transaction.
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof MerchantFeeDetailsEntity
|
|
24
|
+
*/
|
|
25
|
+
subtotal: string;
|
|
26
|
+
/**
|
|
27
|
+
* The details of the payment method fees.
|
|
28
|
+
* @type {Array<PaymentMethodFeeDetailsEntity>}
|
|
29
|
+
* @memberof MerchantFeeDetailsEntity
|
|
30
|
+
*/
|
|
31
|
+
feeDetails: Array<PaymentMethodFeeDetailsEntity>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the MerchantFeeDetailsEntity interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfMerchantFeeDetailsEntity(value: object): boolean;
|
|
37
|
+
export declare function MerchantFeeDetailsEntityFromJSON(json: any): MerchantFeeDetailsEntity;
|
|
38
|
+
export declare function MerchantFeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): MerchantFeeDetailsEntity;
|
|
39
|
+
export declare function MerchantFeeDetailsEntityToJSON(value?: MerchantFeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Channel Payments API
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { removeNullUndefined } from '../runtime';
|
|
10
|
+
import { PaymentMethodFeeDetailsEntityFromJSON, PaymentMethodFeeDetailsEntityToJSON, } from './PaymentMethodFeeDetailsEntity';
|
|
11
|
+
/**
|
|
12
|
+
* Check if a given object implements the MerchantFeeDetailsEntity interface.
|
|
13
|
+
*/
|
|
14
|
+
export function instanceOfMerchantFeeDetailsEntity(value) {
|
|
15
|
+
let isInstance = true;
|
|
16
|
+
isInstance = isInstance && "merchantId" in value;
|
|
17
|
+
isInstance = isInstance && "subtotal" in value;
|
|
18
|
+
isInstance = isInstance && "feeDetails" in value;
|
|
19
|
+
return isInstance;
|
|
20
|
+
}
|
|
21
|
+
export function MerchantFeeDetailsEntityFromJSON(json) {
|
|
22
|
+
return MerchantFeeDetailsEntityFromJSONTyped(json, false);
|
|
23
|
+
}
|
|
24
|
+
export function MerchantFeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
25
|
+
if ((json === undefined) || (json === null)) {
|
|
26
|
+
return json;
|
|
27
|
+
}
|
|
28
|
+
const typed = {
|
|
29
|
+
'merchantId': json['merchantId'],
|
|
30
|
+
'subtotal': json['subtotal'],
|
|
31
|
+
'feeDetails': (json['feeDetails'].map(PaymentMethodFeeDetailsEntityFromJSON)),
|
|
32
|
+
};
|
|
33
|
+
return removeNullUndefined(typed);
|
|
34
|
+
}
|
|
35
|
+
export function MerchantFeeDetailsEntityToJSON(value) {
|
|
36
|
+
if (value === undefined) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
if (value === null) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'merchantId': value.merchantId,
|
|
44
|
+
'subtotal': value.subtotal,
|
|
45
|
+
'feeDetails': (value.feeDetails.map(PaymentMethodFeeDetailsEntityToJSON)),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel Payments API
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
import type { FeeDetailsEntity } from './FeeDetailsEntity';
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @interface PaymentMethodFeeDetailsEntity
|
|
12
|
+
*/
|
|
13
|
+
export interface PaymentMethodFeeDetailsEntity {
|
|
14
|
+
/**
|
|
15
|
+
* The payment method used for the transaction fee calculation.
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
18
|
+
*/
|
|
19
|
+
method: PaymentMethodFeeDetailsEntityMethodEnum;
|
|
20
|
+
/**
|
|
21
|
+
* The details of the transaction fees.
|
|
22
|
+
* @type {Array<FeeDetailsEntity>}
|
|
23
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
24
|
+
*/
|
|
25
|
+
fees: Array<FeeDetailsEntity>;
|
|
26
|
+
/**
|
|
27
|
+
* The total amount of fees applied.
|
|
28
|
+
* @type {number}
|
|
29
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
30
|
+
*/
|
|
31
|
+
feesTotal: number;
|
|
32
|
+
/**
|
|
33
|
+
* The adjusted total after applying the fees.
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof PaymentMethodFeeDetailsEntity
|
|
36
|
+
*/
|
|
37
|
+
adjustedTotal: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @export
|
|
41
|
+
*/
|
|
42
|
+
export declare const PaymentMethodFeeDetailsEntityMethodEnum: {
|
|
43
|
+
readonly Ach: "ACH";
|
|
44
|
+
readonly Bank: "BANK";
|
|
45
|
+
readonly Card: "CARD";
|
|
46
|
+
};
|
|
47
|
+
export type PaymentMethodFeeDetailsEntityMethodEnum = typeof PaymentMethodFeeDetailsEntityMethodEnum[keyof typeof PaymentMethodFeeDetailsEntityMethodEnum];
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the PaymentMethodFeeDetailsEntity interface.
|
|
50
|
+
*/
|
|
51
|
+
export declare function instanceOfPaymentMethodFeeDetailsEntity(value: object): boolean;
|
|
52
|
+
export declare function PaymentMethodFeeDetailsEntityFromJSON(json: any): PaymentMethodFeeDetailsEntity;
|
|
53
|
+
export declare function PaymentMethodFeeDetailsEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaymentMethodFeeDetailsEntity;
|
|
54
|
+
export declare function PaymentMethodFeeDetailsEntityToJSON(value?: PaymentMethodFeeDetailsEntity | null): any;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Channel Payments API
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This class is auto generated. Do not edit the class manually.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { removeNullUndefined } from '../runtime';
|
|
10
|
+
import { FeeDetailsEntityFromJSON, FeeDetailsEntityToJSON, } from './FeeDetailsEntity';
|
|
11
|
+
/**
|
|
12
|
+
* @export
|
|
13
|
+
*/
|
|
14
|
+
export const PaymentMethodFeeDetailsEntityMethodEnum = {
|
|
15
|
+
Ach: 'ACH',
|
|
16
|
+
Bank: 'BANK',
|
|
17
|
+
Card: 'CARD'
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the PaymentMethodFeeDetailsEntity interface.
|
|
21
|
+
*/
|
|
22
|
+
export function instanceOfPaymentMethodFeeDetailsEntity(value) {
|
|
23
|
+
let isInstance = true;
|
|
24
|
+
isInstance = isInstance && "method" in value;
|
|
25
|
+
isInstance = isInstance && "fees" in value;
|
|
26
|
+
isInstance = isInstance && "feesTotal" in value;
|
|
27
|
+
isInstance = isInstance && "adjustedTotal" in value;
|
|
28
|
+
return isInstance;
|
|
29
|
+
}
|
|
30
|
+
export function PaymentMethodFeeDetailsEntityFromJSON(json) {
|
|
31
|
+
return PaymentMethodFeeDetailsEntityFromJSONTyped(json, false);
|
|
32
|
+
}
|
|
33
|
+
export function PaymentMethodFeeDetailsEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
|
+
if ((json === undefined) || (json === null)) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
const typed = {
|
|
38
|
+
'method': json['method'],
|
|
39
|
+
'fees': (json['fees'].map(FeeDetailsEntityFromJSON)),
|
|
40
|
+
'feesTotal': json['feesTotal'],
|
|
41
|
+
'adjustedTotal': json['adjustedTotal'],
|
|
42
|
+
};
|
|
43
|
+
return removeNullUndefined(typed);
|
|
44
|
+
}
|
|
45
|
+
export function PaymentMethodFeeDetailsEntityToJSON(value) {
|
|
46
|
+
if (value === undefined) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
if (value === null) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'method': value.method,
|
|
54
|
+
'fees': (value.fees.map(FeeDetailsEntityToJSON)),
|
|
55
|
+
'feesTotal': value.feesTotal,
|
|
56
|
+
'adjustedTotal': value.adjustedTotal,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -118,7 +118,6 @@ export function TransactionEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
118
118
|
'settledAt': !exists(json, 'settledAt') ? undefined : (new Date(json['settledAt'])),
|
|
119
119
|
'returnedAt': !exists(json, 'returnedAt') ? undefined : (new Date(json['returnedAt'])),
|
|
120
120
|
'tags': !exists(json, 'tags') ? undefined : (json['tags'].map(TagEntityFromJSON)),
|
|
121
|
-
'declineReason': !exists(json, 'declineReason') ? undefined : json['declineReason'],
|
|
122
121
|
};
|
|
123
122
|
return removeNullUndefined(typed);
|
|
124
123
|
}
|
|
@@ -169,6 +168,5 @@ export function TransactionEntityToJSON(value) {
|
|
|
169
168
|
'settledAt': value.settledAt === undefined ? undefined : (value.settledAt.toISOString()),
|
|
170
169
|
'returnedAt': value.returnedAt === undefined ? undefined : (value.returnedAt.toISOString()),
|
|
171
170
|
'tags': value.tags === undefined ? undefined : (value.tags.map(TagEntityToJSON)),
|
|
172
|
-
'declineReason': value.declineReason,
|
|
173
171
|
};
|
|
174
172
|
}
|
|
@@ -48,6 +48,7 @@ export * from './ErrorEntity';
|
|
|
48
48
|
export * from './FeatureEntity';
|
|
49
49
|
export * from './FeatureTargetEntity';
|
|
50
50
|
export * from './FeaturesEntity';
|
|
51
|
+
export * from './FeeDetailsEntity';
|
|
51
52
|
export * from './LogoUploadEntity';
|
|
52
53
|
export * from './MerchantAccountEntity';
|
|
53
54
|
export * from './MerchantAccountServiceEntity';
|
|
@@ -59,6 +60,7 @@ export * from './MerchantConnectorCredentialsServiceEntity';
|
|
|
59
60
|
export * from './MerchantConnectorServiceEntity';
|
|
60
61
|
export * from './MerchantCredentialsEntity';
|
|
61
62
|
export * from './MerchantEntity';
|
|
63
|
+
export * from './MerchantFeeDetailsEntity';
|
|
62
64
|
export * from './MerchantServiceEntity';
|
|
63
65
|
export * from './MerchantSettingsDto';
|
|
64
66
|
export * from './MerchantSettingsEntity';
|
|
@@ -69,6 +71,7 @@ export * from './MerchantThemeLogoEntity';
|
|
|
69
71
|
export * from './PaymentMethodBaseEntity';
|
|
70
72
|
export * from './PaymentMethodDto';
|
|
71
73
|
export * from './PaymentMethodEntity';
|
|
74
|
+
export * from './PaymentMethodFeeDetailsEntity';
|
|
72
75
|
export * from './PaymentMethodServiceEntity';
|
|
73
76
|
export * from './PaymentMethodsSearchEntity';
|
|
74
77
|
export * from './ReturnNotificationEntity';
|
package/dist/mjs/models/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export * from './ErrorEntity';
|
|
|
50
50
|
export * from './FeatureEntity';
|
|
51
51
|
export * from './FeatureTargetEntity';
|
|
52
52
|
export * from './FeaturesEntity';
|
|
53
|
+
export * from './FeeDetailsEntity';
|
|
53
54
|
export * from './LogoUploadEntity';
|
|
54
55
|
export * from './MerchantAccountEntity';
|
|
55
56
|
export * from './MerchantAccountServiceEntity';
|
|
@@ -61,6 +62,7 @@ export * from './MerchantConnectorCredentialsServiceEntity';
|
|
|
61
62
|
export * from './MerchantConnectorServiceEntity';
|
|
62
63
|
export * from './MerchantCredentialsEntity';
|
|
63
64
|
export * from './MerchantEntity';
|
|
65
|
+
export * from './MerchantFeeDetailsEntity';
|
|
64
66
|
export * from './MerchantServiceEntity';
|
|
65
67
|
export * from './MerchantSettingsDto';
|
|
66
68
|
export * from './MerchantSettingsEntity';
|
|
@@ -71,6 +73,7 @@ export * from './MerchantThemeLogoEntity';
|
|
|
71
73
|
export * from './PaymentMethodBaseEntity';
|
|
72
74
|
export * from './PaymentMethodDto';
|
|
73
75
|
export * from './PaymentMethodEntity';
|
|
76
|
+
export * from './PaymentMethodFeeDetailsEntity';
|
|
74
77
|
export * from './PaymentMethodServiceEntity';
|
|
75
78
|
export * from './PaymentMethodsSearchEntity';
|
|
76
79
|
export * from './ReturnNotificationEntity';
|
package/dist/mjs/runtime.js
CHANGED
|
@@ -64,7 +64,7 @@ export class BaseAPI {
|
|
|
64
64
|
}
|
|
65
65
|
async createFetchParams(context) {
|
|
66
66
|
Object.keys(context.headers).forEach(key => context.headers[key] === undefined ? delete context.headers[key] : {});
|
|
67
|
-
context.headers['user-agent'] = "@channelpayments/node-sdk/v1.
|
|
67
|
+
context.headers['user-agent'] = "@channelpayments/node-sdk/v1.183.0";
|
|
68
68
|
const token = this.generateAuthToken();
|
|
69
69
|
context.headers['Authorization'] = `Bearer ${token}`;
|
|
70
70
|
let url = this.url + context.path;
|