@cobo/cobo-waas2 1.26.0 → 1.28.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/README.md +96 -4
- package/dist/ApiClient.js +1 -1
- package/dist/api/AddressBooksApi.js +2 -2
- package/dist/api/AutoSweepApi.js +4 -4
- package/dist/api/DevelopersWebhooksApi.js +2 -2
- package/dist/api/OAuthApi.js +4 -4
- package/dist/api/PaymentApi.js +1847 -294
- package/dist/api/StakingsApi.js +44 -2
- package/dist/api/SwapsApi.js +2 -2
- package/dist/api/TransactionsApi.js +6 -6
- package/dist/api/WalletsApi.js +14 -14
- package/dist/index.js +420 -7
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/AllocationRecord.js +193 -0
- package/dist/model/AllocationRequest.js +167 -0
- package/dist/model/BabylonCreateStakingExpansion.js +157 -0
- package/dist/model/BabylonStakeExtra.js +26 -0
- package/dist/model/BabylonStakingRegistration.js +1 -1
- package/dist/model/BalanceUpdateInfoEventData.js +8 -3
- package/dist/model/BankAccountStatus.js +66 -0
- package/dist/model/BatchAllocation.js +190 -0
- package/dist/model/BatchAllocationDetail.js +188 -0
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/ComplianceDispositionUpdateEventData.js +8 -3
- package/dist/model/ComplianceKytScreeningsUpdateEventData.js +8 -3
- package/dist/model/ContractCallDestination.js +72 -10
- package/dist/model/ContractCallDestinationType.js +10 -0
- package/dist/model/CosmosContractCallDestination.js +0 -13
- package/dist/model/Counterparty.js +195 -0
- package/dist/model/CounterpartyDetail.js +228 -0
- package/dist/model/CounterpartyType.js +61 -0
- package/dist/model/CounterpartyWalletAddressDetail.js +192 -0
- package/dist/model/CreateBatchAllocationRequest.js +142 -0
- package/dist/model/CreateCounterpartyRequest.js +193 -0
- package/dist/model/CreateCounterpartyWalletAddressRequest.js +140 -0
- package/dist/model/CreateCustodialWalletParams.js +1 -1
- package/dist/model/CreateDestinationBankAccount.js +257 -0
- package/dist/model/CreateDestinationBankAccountRequest.js +272 -0
- package/dist/model/CreateDestinationRequest.js +235 -0
- package/dist/model/CreateDestinationWalletAddressRequest.js +140 -0
- package/dist/model/CreateExchangeWalletParams.js +2 -2
- package/dist/model/CreateKeyShareHolder.js +1 -1
- package/dist/model/CreateMerchantRequest.js +1 -1
- package/dist/model/CreateMpcWalletParams.js +2 -2
- package/dist/model/CreatePaymentOrderRequest.js +115 -68
- package/dist/model/CreatePayoutRequest.js +192 -0
- package/dist/model/CreateRefundRequest.js +3 -3
- package/dist/model/CreateSafeWalletParams.js +1 -1
- package/dist/model/CreateSettlement.js +14 -1
- package/dist/model/CreateSettlementRequestRequest.js +1 -1
- package/dist/model/CreateSmartContractWalletParams.js +1 -1
- package/dist/model/CreateStakeActivityExtra.js +12 -0
- package/dist/model/{ReceivedAmountPerAddress.js → CreateWalletAddress.js} +31 -32
- package/dist/model/CreateWalletParams.js +1 -1
- package/dist/model/DeleteCounterparty200Response.js +110 -0
- package/dist/model/DeleteCounterpartyWalletAddress200Response.js +110 -0
- package/dist/model/DeleteDestination200Response.js +110 -0
- package/dist/model/DeleteDestinationBankAccount200Response.js +110 -0
- package/dist/model/DeleteDestinationWalletAddress200Response.js +110 -0
- package/dist/model/Destination.js +208 -0
- package/dist/model/DestinationBankAccount.js +301 -0
- package/dist/model/DestinationBankAccountDetail.js +394 -0
- package/dist/model/DestinationDetail.js +272 -0
- package/dist/model/DestinationType.js +61 -0
- package/dist/model/DestinationWalletAddressDetail.js +205 -0
- package/dist/model/EnableDestinationWhitelistRequest.js +106 -0
- package/dist/model/EvmContractCallDestination.js +2 -2
- package/dist/model/ExchangeRate.js +140 -0
- package/dist/model/GetExchangeRate200Response.js +2 -2
- package/dist/model/IntermediaryBankInfo.js +140 -0
- package/dist/model/Link.js +4 -4
- package/dist/model/LinkDisplayInfo.js +15 -2
- package/dist/model/ListAllocations200Response.js +123 -0
- package/dist/model/ListBatchAllocations200Response.js +123 -0
- package/dist/model/ListCounterparties200Response.js +123 -0
- package/dist/model/ListCounterpartyWalletAddress200Response.js +123 -0
- package/dist/model/ListDestinationBankAccounts200Response.js +123 -0
- package/dist/model/ListDestinationWalletAddresses200Response.js +123 -0
- package/dist/model/ListDestinations200Response.js +123 -0
- package/dist/model/ListPayoutItems200Response.js +123 -0
- package/dist/model/ListPayouts200Response.js +123 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/MerchantBalance.js +28 -2
- package/dist/model/Order.js +135 -102
- package/dist/model/OrderLinkBusinessInfo.js +151 -87
- package/dist/model/OrderLinkBusinessInfoCustomExchangeRatesInner.js +4 -4
- package/dist/model/OrderLinkBusinessInfoPayableAmountsInner.js +125 -0
- package/dist/model/PaymentAddressUpdateEventData.js +8 -3
- package/dist/model/PaymentAllocationAmount.js +125 -0
- package/dist/model/PaymentOrderEventData.js +198 -145
- package/dist/model/PaymentPayout.js +250 -0
- package/dist/model/PaymentPayoutDetail.js +248 -0
- package/dist/model/PaymentPayoutEvent.js +433 -0
- package/dist/model/PaymentPayoutItem.js +298 -0
- package/dist/model/PaymentPayoutItemDetail.js +298 -0
- package/dist/model/PaymentPayoutItemStatus.js +76 -0
- package/dist/model/PaymentPayoutParam.js +165 -0
- package/dist/model/PaymentPayoutStatus.js +81 -0
- package/dist/model/PaymentRefundEventData.js +8 -3
- package/dist/model/PaymentSettlementEvent.js +8 -3
- package/dist/model/PaymentSourceType.js +61 -0
- package/dist/model/PaymentTransaction.js +32 -0
- package/dist/model/PaymentTransactionEventData.js +10 -5
- package/dist/model/PspBalance.js +28 -2
- package/dist/model/QueryDestinationWhitelistEnabled200Response.js +106 -0
- package/dist/model/RefundLinkBusinessInfo.js +6 -6
- package/dist/model/SettlementDetail.js +13 -0
- package/dist/model/Stakings.js +33 -6
- package/dist/model/SuspendedTokenEventData.js +8 -3
- package/dist/model/SwapActivity.js +1 -1
- package/dist/model/SwapActivityDetail.js +2 -2
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListingEventData.js +8 -3
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/Transaction.js +1 -1
- package/dist/model/TransactionCosmosContractDestination.js +0 -13
- package/dist/model/TransactionDestination.js +38 -10
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionDetail.js +2 -2
- package/dist/model/TransactionDetails.js +2 -2
- package/dist/model/TransactionTronContractDestination.js +150 -0
- package/dist/model/TransactionWebhookEventData.js +10 -5
- package/dist/model/TronContractCallDestination.js +150 -0
- package/dist/model/UpdateCounterpartyByIdRequest.js +160 -0
- package/dist/model/UpdateDestinationBankAccount.js +257 -0
- package/dist/model/UpdateDestinationByIdRequest.js +173 -0
- package/dist/model/UpdateMerchantByIdRequest.js +1 -1
- package/dist/model/WalletAddress.js +151 -0
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WebhookEventData.js +107 -43
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +10 -0
- package/docs/AddressBooksApi.md +1 -1
- package/docs/AddressesEventData.md +3 -1
- package/docs/AllocationRecord.md +15 -0
- package/docs/AllocationRequest.md +13 -0
- package/docs/AutoSweepApi.md +2 -2
- package/docs/BabylonCreateStakingExpansion.md +12 -0
- package/docs/BabylonStakeExtra.md +2 -0
- package/docs/BalanceUpdateInfoEventData.md +3 -1
- package/docs/BankAccountStatus.md +14 -0
- package/docs/BatchAllocation.md +14 -0
- package/docs/BatchAllocationDetail.md +14 -0
- package/docs/ChainsEventData.md +3 -1
- package/docs/ComplianceDispositionUpdateEventData.md +3 -1
- package/docs/ComplianceKytScreeningsUpdateEventData.md +3 -1
- package/docs/ContractCallDestination.md +3 -2
- package/docs/ContractCallDestinationType.md +4 -0
- package/docs/CosmosContractCallDestination.md +0 -1
- package/docs/Counterparty.md +16 -0
- package/docs/CounterpartyDetail.md +17 -0
- package/docs/CounterpartyType.md +12 -0
- package/docs/CounterpartyWalletAddressDetail.md +15 -0
- package/docs/CreateBatchAllocationRequest.md +10 -0
- package/docs/CreateCounterpartyRequest.md +14 -0
- package/docs/CreateCounterpartyWalletAddressRequest.md +11 -0
- package/docs/CreateCustodialWalletParams.md +1 -1
- package/docs/CreateDestinationBankAccount.md +19 -0
- package/docs/CreateDestinationBankAccountRequest.md +20 -0
- package/docs/CreateDestinationRequest.md +16 -0
- package/docs/CreateDestinationWalletAddressRequest.md +11 -0
- package/docs/CreateExchangeWalletParams.md +1 -1
- package/docs/CreateKeyShareHolder.md +1 -1
- package/docs/CreateMerchantRequest.md +1 -1
- package/docs/CreateMpcWalletParams.md +1 -1
- package/docs/CreatePaymentOrderRequest.md +15 -11
- package/docs/CreatePayoutRequest.md +14 -0
- package/docs/CreateRefundRequest.md +3 -3
- package/docs/CreateSafeWalletParams.md +1 -1
- package/docs/CreateSettlement.md +2 -1
- package/docs/CreateSettlementRequestRequest.md +1 -1
- package/docs/CreateSmartContractWalletParams.md +1 -1
- package/docs/CreateStakeActivityExtra.md +2 -0
- package/docs/CreateWalletAddress.md +10 -0
- package/docs/CreateWalletParams.md +1 -1
- package/docs/DeleteCounterparty200Response.md +9 -0
- package/docs/DeleteCounterpartyWalletAddress200Response.md +9 -0
- package/docs/DeleteDestination200Response.md +9 -0
- package/docs/DeleteDestinationBankAccount200Response.md +9 -0
- package/docs/DeleteDestinationWalletAddress200Response.md +9 -0
- package/docs/Destination.md +17 -0
- package/docs/DestinationBankAccount.md +23 -0
- package/docs/DestinationBankAccountDetail.md +30 -0
- package/docs/DestinationDetail.md +19 -0
- package/docs/DestinationType.md +12 -0
- package/docs/DestinationWalletAddressDetail.md +16 -0
- package/docs/DevelopersWebhooksApi.md +1 -1
- package/docs/EnableDestinationWhitelistRequest.md +9 -0
- package/docs/EvmContractCallDestination.md +1 -1
- package/docs/ExchangeRate.md +11 -0
- package/docs/GetExchangeRate200Response.md +1 -1
- package/docs/IntermediaryBankInfo.md +11 -0
- package/docs/Link.md +2 -2
- package/docs/LinkDisplayInfo.md +3 -2
- package/docs/ListAllocations200Response.md +10 -0
- package/docs/ListBatchAllocations200Response.md +10 -0
- package/docs/ListCounterparties200Response.md +10 -0
- package/docs/ListCounterpartyWalletAddress200Response.md +10 -0
- package/docs/ListDestinationBankAccounts200Response.md +10 -0
- package/docs/ListDestinationWalletAddresses200Response.md +10 -0
- package/docs/ListDestinations200Response.md +10 -0
- package/docs/ListPayoutItems200Response.md +10 -0
- package/docs/ListPayouts200Response.md +10 -0
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/MerchantBalance.md +4 -2
- package/docs/OAuthApi.md +2 -2
- package/docs/Order.md +16 -13
- package/docs/OrderLinkBusinessInfo.md +11 -7
- package/docs/OrderLinkBusinessInfoCustomExchangeRatesInner.md +2 -2
- package/docs/OrderLinkBusinessInfoPayableAmountsInner.md +10 -0
- package/docs/PaymentAddressUpdateEventData.md +3 -1
- package/docs/PaymentAllocationAmount.md +10 -0
- package/docs/PaymentApi.md +2153 -395
- package/docs/PaymentOrderEventData.md +19 -14
- package/docs/PaymentPayout.md +19 -0
- package/docs/PaymentPayoutDetail.md +19 -0
- package/docs/PaymentPayoutEvent.md +65 -0
- package/docs/PaymentPayoutItem.md +22 -0
- package/docs/PaymentPayoutItemDetail.md +22 -0
- package/docs/PaymentPayoutItemStatus.md +18 -0
- package/docs/PaymentPayoutParam.md +13 -0
- package/docs/PaymentPayoutStatus.md +20 -0
- package/docs/PaymentRefundEventData.md +3 -1
- package/docs/PaymentSettlementEvent.md +3 -1
- package/docs/PaymentSourceType.md +12 -0
- package/docs/PaymentTransaction.md +2 -0
- package/docs/PaymentTransactionEventData.md +4 -2
- package/docs/PspBalance.md +4 -2
- package/docs/QueryDestinationWhitelistEnabled200Response.md +9 -0
- package/docs/RefundLinkBusinessInfo.md +4 -4
- package/docs/SettlementDetail.md +1 -0
- package/docs/Stakings.md +2 -1
- package/docs/StakingsApi.md +54 -1
- package/docs/SuspendedTokenEventData.md +3 -1
- package/docs/SwapActivity.md +1 -1
- package/docs/SwapActivityDetail.md +1 -1
- package/docs/SwapsApi.md +1 -1
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListingEventData.md +3 -1
- package/docs/TokensEventData.md +3 -1
- package/docs/Transaction.md +1 -1
- package/docs/TransactionCosmosContractDestination.md +0 -1
- package/docs/TransactionDestination.md +2 -2
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionDetail.md +1 -1
- package/docs/TransactionDetails.md +1 -1
- package/docs/TransactionTronContractDestination.md +12 -0
- package/docs/TransactionWebhookEventData.md +4 -2
- package/docs/TransactionsApi.md +3 -3
- package/docs/TronContractCallDestination.md +12 -0
- package/docs/UpdateCounterpartyByIdRequest.md +13 -0
- package/docs/UpdateDestinationBankAccount.md +19 -0
- package/docs/UpdateDestinationByIdRequest.md +14 -0
- package/docs/UpdateMerchantByIdRequest.md +1 -1
- package/docs/WalletAddress.md +12 -0
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletsApi.md +7 -7
- package/docs/WebhookEventData.md +22 -14
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +4 -0
- package/package.json +1 -1
- package/docs/ReceivedAmountPerAddress.md +0 -10
|
@@ -197,7 +197,7 @@ CreateExchangeWalletParams.prototype['wallet_type'] = undefined;
|
|
|
197
197
|
CreateExchangeWalletParams.prototype['wallet_subtype'] = undefined;
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
|
-
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Web3 Wallets.
|
|
200
|
+
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Custodial Wallets (Web3 Wallets).
|
|
201
201
|
* @member {Boolean} enable_auto_sweep
|
|
202
202
|
*/
|
|
203
203
|
CreateExchangeWalletParams.prototype['enable_auto_sweep'] = undefined;
|
|
@@ -264,7 +264,7 @@ _CreateCustodialWalletParams["default"].prototype['wallet_type'] = undefined;
|
|
|
264
264
|
*/
|
|
265
265
|
_CreateCustodialWalletParams["default"].prototype['wallet_subtype'] = undefined;
|
|
266
266
|
/**
|
|
267
|
-
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Web3 Wallets.
|
|
267
|
+
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Custodial Wallets (Web3 Wallets).
|
|
268
268
|
* @member {Boolean} enable_auto_sweep
|
|
269
269
|
*/
|
|
270
270
|
_CreateCustodialWalletParams["default"].prototype['enable_auto_sweep'] = undefined;
|
|
@@ -106,7 +106,7 @@ CreateKeyShareHolder.prototype['name'] = undefined;
|
|
|
106
106
|
CreateKeyShareHolder.prototype['type'] = undefined;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Key share holder's TSS Node ID.
|
|
109
|
+
* Key share holder's TSS Node ID. For detailed information about signer types and their setup, see the [**Signer Type** table](https://manuals.cobo.com/en/portal/mpc-wallets/ocw/holder-group-main-group). Mobile signers can view their TSS Node ID in the [Cobo Guard app](https://manuals.cobo.com/en/guard/manage).
|
|
110
110
|
* @member {String} tss_node_id
|
|
111
111
|
*/
|
|
112
112
|
CreateKeyShareHolder.prototype['tss_node_id'] = undefined;
|
|
@@ -133,7 +133,7 @@ CreateMerchantRequest.prototype['name'] = undefined;
|
|
|
133
133
|
CreateMerchantRequest.prototype['wallet_id'] = undefined;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
* The developer fee rate applied to this merchant. Must be a valid float between 0 and 1 (inclusive), with up to 4 decimal places. For more information on developer fee rate, please refer to [Funds allocation and balances](https://www.cobo.com/
|
|
136
|
+
* The developer fee rate applied to this merchant. Must be a valid float between 0 and 1 (inclusive), with up to 4 decimal places. For more information on developer fee rate, please refer to [Funds allocation and balances](https://www.cobo.com/payments/en/guides/amounts-and-balances).
|
|
137
137
|
* @member {String} developer_fee_rate
|
|
138
138
|
*/
|
|
139
139
|
CreateMerchantRequest.prototype['developer_fee_rate'] = undefined;
|
|
@@ -147,7 +147,7 @@ CreateMpcWalletParams.prototype['wallet_type'] = undefined;
|
|
|
147
147
|
CreateMpcWalletParams.prototype['wallet_subtype'] = undefined;
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Web3 Wallets.
|
|
150
|
+
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Custodial Wallets (Web3 Wallets).
|
|
151
151
|
* @member {Boolean} enable_auto_sweep
|
|
152
152
|
*/
|
|
153
153
|
CreateMpcWalletParams.prototype['enable_auto_sweep'] = undefined;
|
|
@@ -173,7 +173,7 @@ _CreateCustodialWalletParams["default"].prototype['wallet_type'] = undefined;
|
|
|
173
173
|
*/
|
|
174
174
|
_CreateCustodialWalletParams["default"].prototype['wallet_subtype'] = undefined;
|
|
175
175
|
/**
|
|
176
|
-
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Web3 Wallets.
|
|
176
|
+
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Custodial Wallets (Web3 Wallets).
|
|
177
177
|
* @member {Boolean} enable_auto_sweep
|
|
178
178
|
*/
|
|
179
179
|
_CreateCustodialWalletParams["default"].prototype['enable_auto_sweep'] = undefined;
|
|
@@ -32,15 +32,13 @@ var CreatePaymentOrderRequest = /*#__PURE__*/function () {
|
|
|
32
32
|
/**
|
|
33
33
|
* Constructs a new <code>CreatePaymentOrderRequest</code>.
|
|
34
34
|
* @alias module:model/CreatePaymentOrderRequest
|
|
35
|
-
* @param merchant_id {String} The merchant ID.
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param fee_amount {String} The developer fee for the order. - **When to set:** If you are a merchant serving payers directly, set this field to `0`. Developer fees are only relevant for platforms like payment service providers (PSPs) that charge fees to their downstream merchants. For details, see [Funds allocation and balances](https://www.cobo.com/developers/v2/payments/amounts-and-balances). - **Denomination:** The denomination of `fee_amount` depends on the presence of `currency`: - If `currency` is set, the amount is denominated in that currency (e.g., \"USD\"). - If `currency` is not set, the amount is denominated in the cryptocurrency specified by `token_id` (e.g., \"ETH_USDT\"). - **Calculation:** The developer fee is added to the base order amount (`order_amount`) to determine the final amount charged to the customer. For example: - Base amount (`order_amount`): \"100.00\" - Developer fee (`fee_amount`): \"2.00\" - **Total charged:** \"102.00\" - **Formatting:** The value can contain up to two decimal places.
|
|
39
|
-
* @param psp_order_code {String} A unique reference code assigned by you as a developer to identify this order in your system. This code must be unique across all orders in your system. The code should have a maximum length of 128 characters.
|
|
35
|
+
* @param merchant_id {String} The merchant ID.
|
|
36
|
+
* @param psp_order_code {String} A unique reference code assigned by the developer to identify this order in their system.
|
|
37
|
+
* @param fee_amount {String} The developer fee for the order in fiat currency. It is added to the base amount (`order_amount`) to determine the final charge. For example, if order_amount is \"100.00\" and fee_amount is \"2.00\", the customer will be charged \"102.00\" in total, with \"100.00\" being settled to the merchant and \"2.00\" settled to the developer. Values must be greater than 0 and contain two decimal places.
|
|
40
38
|
*/
|
|
41
|
-
function CreatePaymentOrderRequest(merchant_id,
|
|
39
|
+
function CreatePaymentOrderRequest(merchant_id, psp_order_code, fee_amount) {
|
|
42
40
|
_classCallCheck(this, CreatePaymentOrderRequest);
|
|
43
|
-
CreatePaymentOrderRequest.initialize(this, merchant_id,
|
|
41
|
+
CreatePaymentOrderRequest.initialize(this, merchant_id, psp_order_code, fee_amount);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
/**
|
|
@@ -50,12 +48,10 @@ var CreatePaymentOrderRequest = /*#__PURE__*/function () {
|
|
|
50
48
|
*/
|
|
51
49
|
return _createClass(CreatePaymentOrderRequest, null, [{
|
|
52
50
|
key: "initialize",
|
|
53
|
-
value: function initialize(obj, merchant_id,
|
|
51
|
+
value: function initialize(obj, merchant_id, psp_order_code, fee_amount) {
|
|
54
52
|
obj['merchant_id'] = merchant_id;
|
|
55
|
-
obj['token_id'] = token_id;
|
|
56
|
-
obj['order_amount'] = order_amount;
|
|
57
|
-
obj['fee_amount'] = fee_amount;
|
|
58
53
|
obj['psp_order_code'] = psp_order_code;
|
|
54
|
+
obj['fee_amount'] = fee_amount;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
/**
|
|
@@ -73,36 +69,48 @@ var CreatePaymentOrderRequest = /*#__PURE__*/function () {
|
|
|
73
69
|
if (data.hasOwnProperty('merchant_id')) {
|
|
74
70
|
obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
|
|
75
71
|
}
|
|
76
|
-
if (data.hasOwnProperty('
|
|
77
|
-
obj['
|
|
72
|
+
if (data.hasOwnProperty('merchant_order_code')) {
|
|
73
|
+
obj['merchant_order_code'] = _ApiClient["default"].convertToType(data['merchant_order_code'], 'String');
|
|
78
74
|
}
|
|
79
|
-
if (data.hasOwnProperty('
|
|
80
|
-
obj['
|
|
75
|
+
if (data.hasOwnProperty('psp_order_code')) {
|
|
76
|
+
obj['psp_order_code'] = _ApiClient["default"].convertToType(data['psp_order_code'], 'String');
|
|
81
77
|
}
|
|
82
|
-
if (data.hasOwnProperty('
|
|
83
|
-
obj['
|
|
78
|
+
if (data.hasOwnProperty('pricing_currency')) {
|
|
79
|
+
obj['pricing_currency'] = _ApiClient["default"].convertToType(data['pricing_currency'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('pricing_amount')) {
|
|
82
|
+
obj['pricing_amount'] = _ApiClient["default"].convertToType(data['pricing_amount'], 'String');
|
|
84
83
|
}
|
|
85
84
|
if (data.hasOwnProperty('fee_amount')) {
|
|
86
85
|
obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
|
|
87
86
|
}
|
|
88
|
-
if (data.hasOwnProperty('
|
|
89
|
-
obj['
|
|
87
|
+
if (data.hasOwnProperty('payable_currency')) {
|
|
88
|
+
obj['payable_currency'] = _ApiClient["default"].convertToType(data['payable_currency'], 'String');
|
|
90
89
|
}
|
|
91
|
-
if (data.hasOwnProperty('
|
|
92
|
-
obj['
|
|
90
|
+
if (data.hasOwnProperty('payable_amount')) {
|
|
91
|
+
obj['payable_amount'] = _ApiClient["default"].convertToType(data['payable_amount'], 'String');
|
|
93
92
|
}
|
|
94
93
|
if (data.hasOwnProperty('expired_in')) {
|
|
95
94
|
obj['expired_in'] = _ApiClient["default"].convertToType(data['expired_in'], 'Number');
|
|
96
95
|
}
|
|
96
|
+
if (data.hasOwnProperty('amount_tolerance')) {
|
|
97
|
+
obj['amount_tolerance'] = _ApiClient["default"].convertToType(data['amount_tolerance'], 'String');
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('currency')) {
|
|
100
|
+
obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('order_amount')) {
|
|
103
|
+
obj['order_amount'] = _ApiClient["default"].convertToType(data['order_amount'], 'String');
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('token_id')) {
|
|
106
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
107
|
+
}
|
|
97
108
|
if (data.hasOwnProperty('use_dedicated_address')) {
|
|
98
109
|
obj['use_dedicated_address'] = _ApiClient["default"].convertToType(data['use_dedicated_address'], 'Boolean');
|
|
99
110
|
}
|
|
100
111
|
if (data.hasOwnProperty('custom_exchange_rate')) {
|
|
101
112
|
obj['custom_exchange_rate'] = _ApiClient["default"].convertToType(data['custom_exchange_rate'], 'String');
|
|
102
113
|
}
|
|
103
|
-
if (data.hasOwnProperty('amount_tolerance')) {
|
|
104
|
-
obj['amount_tolerance'] = _ApiClient["default"].convertToType(data['amount_tolerance'], 'String');
|
|
105
|
-
}
|
|
106
114
|
}
|
|
107
115
|
return obj;
|
|
108
116
|
}
|
|
@@ -135,108 +143,147 @@ var CreatePaymentOrderRequest = /*#__PURE__*/function () {
|
|
|
135
143
|
throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
|
|
136
144
|
}
|
|
137
145
|
// ensure the json data is a string
|
|
138
|
-
if (data['
|
|
139
|
-
throw new Error("Expected the field `
|
|
146
|
+
if (data['merchant_order_code'] && !(typeof data['merchant_order_code'] === 'string' || data['merchant_order_code'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `merchant_order_code` to be a primitive type in the JSON string but got " + data['merchant_order_code']);
|
|
140
148
|
}
|
|
141
149
|
// ensure the json data is a string
|
|
142
|
-
if (data['
|
|
143
|
-
throw new Error("Expected the field `
|
|
150
|
+
if (data['psp_order_code'] && !(typeof data['psp_order_code'] === 'string' || data['psp_order_code'] instanceof String)) {
|
|
151
|
+
throw new Error("Expected the field `psp_order_code` to be a primitive type in the JSON string but got " + data['psp_order_code']);
|
|
144
152
|
}
|
|
145
153
|
// ensure the json data is a string
|
|
146
|
-
if (data['
|
|
147
|
-
throw new Error("Expected the field `
|
|
154
|
+
if (data['pricing_currency'] && !(typeof data['pricing_currency'] === 'string' || data['pricing_currency'] instanceof String)) {
|
|
155
|
+
throw new Error("Expected the field `pricing_currency` to be a primitive type in the JSON string but got " + data['pricing_currency']);
|
|
148
156
|
}
|
|
149
157
|
// ensure the json data is a string
|
|
150
|
-
if (data['
|
|
151
|
-
throw new Error("Expected the field `
|
|
158
|
+
if (data['pricing_amount'] && !(typeof data['pricing_amount'] === 'string' || data['pricing_amount'] instanceof String)) {
|
|
159
|
+
throw new Error("Expected the field `pricing_amount` to be a primitive type in the JSON string but got " + data['pricing_amount']);
|
|
152
160
|
}
|
|
153
161
|
// ensure the json data is a string
|
|
154
|
-
if (data['
|
|
155
|
-
throw new Error("Expected the field `
|
|
162
|
+
if (data['fee_amount'] && !(typeof data['fee_amount'] === 'string' || data['fee_amount'] instanceof String)) {
|
|
163
|
+
throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
|
|
156
164
|
}
|
|
157
165
|
// ensure the json data is a string
|
|
158
|
-
if (data['
|
|
159
|
-
throw new Error("Expected the field `
|
|
166
|
+
if (data['payable_currency'] && !(typeof data['payable_currency'] === 'string' || data['payable_currency'] instanceof String)) {
|
|
167
|
+
throw new Error("Expected the field `payable_currency` to be a primitive type in the JSON string but got " + data['payable_currency']);
|
|
160
168
|
}
|
|
161
169
|
// ensure the json data is a string
|
|
162
|
-
if (data['
|
|
163
|
-
throw new Error("Expected the field `
|
|
170
|
+
if (data['payable_amount'] && !(typeof data['payable_amount'] === 'string' || data['payable_amount'] instanceof String)) {
|
|
171
|
+
throw new Error("Expected the field `payable_amount` to be a primitive type in the JSON string but got " + data['payable_amount']);
|
|
164
172
|
}
|
|
165
173
|
// ensure the json data is a string
|
|
166
174
|
if (data['amount_tolerance'] && !(typeof data['amount_tolerance'] === 'string' || data['amount_tolerance'] instanceof String)) {
|
|
167
175
|
throw new Error("Expected the field `amount_tolerance` to be a primitive type in the JSON string but got " + data['amount_tolerance']);
|
|
168
176
|
}
|
|
177
|
+
// ensure the json data is a string
|
|
178
|
+
if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
|
|
179
|
+
throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
|
|
180
|
+
}
|
|
181
|
+
// ensure the json data is a string
|
|
182
|
+
if (data['order_amount'] && !(typeof data['order_amount'] === 'string' || data['order_amount'] instanceof String)) {
|
|
183
|
+
throw new Error("Expected the field `order_amount` to be a primitive type in the JSON string but got " + data['order_amount']);
|
|
184
|
+
}
|
|
185
|
+
// ensure the json data is a string
|
|
186
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
187
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
188
|
+
}
|
|
189
|
+
// ensure the json data is a string
|
|
190
|
+
if (data['custom_exchange_rate'] && !(typeof data['custom_exchange_rate'] === 'string' || data['custom_exchange_rate'] instanceof String)) {
|
|
191
|
+
throw new Error("Expected the field `custom_exchange_rate` to be a primitive type in the JSON string but got " + data['custom_exchange_rate']);
|
|
192
|
+
}
|
|
169
193
|
return true;
|
|
170
194
|
}
|
|
171
195
|
}]);
|
|
172
196
|
}();
|
|
173
|
-
CreatePaymentOrderRequest.RequiredProperties = ["merchant_id", "
|
|
197
|
+
CreatePaymentOrderRequest.RequiredProperties = ["merchant_id", "psp_order_code", "fee_amount"];
|
|
174
198
|
|
|
175
199
|
/**
|
|
176
|
-
* The merchant ID.
|
|
200
|
+
* The merchant ID.
|
|
177
201
|
* @member {String} merchant_id
|
|
178
202
|
*/
|
|
179
203
|
CreatePaymentOrderRequest.prototype['merchant_id'] = undefined;
|
|
180
204
|
|
|
181
205
|
/**
|
|
182
|
-
*
|
|
183
|
-
* @member {String}
|
|
206
|
+
* A unique reference code assigned by the merchant to identify this order in their system.
|
|
207
|
+
* @member {String} merchant_order_code
|
|
184
208
|
*/
|
|
185
|
-
CreatePaymentOrderRequest.prototype['
|
|
209
|
+
CreatePaymentOrderRequest.prototype['merchant_order_code'] = undefined;
|
|
186
210
|
|
|
187
211
|
/**
|
|
188
|
-
*
|
|
189
|
-
* @member {String}
|
|
190
|
-
* @default ''
|
|
212
|
+
* A unique reference code assigned by the developer to identify this order in their system.
|
|
213
|
+
* @member {String} psp_order_code
|
|
191
214
|
*/
|
|
192
|
-
CreatePaymentOrderRequest.prototype['
|
|
215
|
+
CreatePaymentOrderRequest.prototype['psp_order_code'] = undefined;
|
|
193
216
|
|
|
194
217
|
/**
|
|
195
|
-
*
|
|
196
|
-
* @member {String}
|
|
218
|
+
* The ID of the cryptocurrency used for payment. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
|
|
219
|
+
* @member {String} pricing_currency
|
|
197
220
|
*/
|
|
198
|
-
CreatePaymentOrderRequest.prototype['
|
|
221
|
+
CreatePaymentOrderRequest.prototype['pricing_currency'] = undefined;
|
|
199
222
|
|
|
200
223
|
/**
|
|
201
|
-
*
|
|
224
|
+
* The base amount of the order in fiat currency, excluding the developer fee (specified in `fee_amount`). Values must be greater than `0` and contain two decimal places.
|
|
225
|
+
* @member {String} pricing_amount
|
|
226
|
+
*/
|
|
227
|
+
CreatePaymentOrderRequest.prototype['pricing_amount'] = undefined;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The developer fee for the order in fiat currency. It is added to the base amount (`order_amount`) to determine the final charge. For example, if order_amount is \"100.00\" and fee_amount is \"2.00\", the customer will be charged \"102.00\" in total, with \"100.00\" being settled to the merchant and \"2.00\" settled to the developer. Values must be greater than 0 and contain two decimal places.
|
|
202
231
|
* @member {String} fee_amount
|
|
203
232
|
*/
|
|
204
233
|
CreatePaymentOrderRequest.prototype['fee_amount'] = undefined;
|
|
205
234
|
|
|
206
235
|
/**
|
|
207
|
-
*
|
|
208
|
-
* @member {String}
|
|
236
|
+
* The ID of the cryptocurrency used for payment. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
|
|
237
|
+
* @member {String} payable_currency
|
|
209
238
|
*/
|
|
210
|
-
CreatePaymentOrderRequest.prototype['
|
|
239
|
+
CreatePaymentOrderRequest.prototype['payable_currency'] = undefined;
|
|
211
240
|
|
|
212
241
|
/**
|
|
213
|
-
*
|
|
214
|
-
* @member {String}
|
|
242
|
+
* The actual payable amount of the order in the cryptocurrency.
|
|
243
|
+
* @member {String} payable_amount
|
|
215
244
|
*/
|
|
216
|
-
CreatePaymentOrderRequest.prototype['
|
|
245
|
+
CreatePaymentOrderRequest.prototype['payable_amount'] = undefined;
|
|
217
246
|
|
|
218
247
|
/**
|
|
219
|
-
* The
|
|
248
|
+
* The pay-in order will expire after approximately a certain number of seconds: - The order status becomes final and cannot be changed - The `received_token_amount` field will no longer be updated - Funds received after expiration will be categorized as late payments and can only be settled from the developer balance. - A late payment will trigger a `transactionLate` webhook event.
|
|
220
249
|
* @member {Number} expired_in
|
|
221
|
-
* @default 1800
|
|
222
250
|
*/
|
|
223
|
-
CreatePaymentOrderRequest.prototype['expired_in'] =
|
|
251
|
+
CreatePaymentOrderRequest.prototype['expired_in'] = undefined;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Allowed amount deviation, precision to 1 decimal place.
|
|
255
|
+
* @member {String} amount_tolerance
|
|
256
|
+
*/
|
|
257
|
+
CreatePaymentOrderRequest.prototype['amount_tolerance'] = undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* The fiat currency of the order.
|
|
261
|
+
* @member {String} currency
|
|
262
|
+
* @default ''
|
|
263
|
+
*/
|
|
264
|
+
CreatePaymentOrderRequest.prototype['currency'] = '';
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The base amount of the order in fiat currency, excluding the developer fee (specified in `fee_amount`). Values must be greater than `0` and contain two decimal places.
|
|
268
|
+
* @member {String} order_amount
|
|
269
|
+
*/
|
|
270
|
+
CreatePaymentOrderRequest.prototype['order_amount'] = undefined;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The ID of the cryptocurrency used for payment. Supported values: - USDC: `ETH_USDC`, `ARBITRUM_USDC`, `SOL_USDC`, `BASE_USDC`, `MATIC_USDC`, `BSC_USDC` - USDT: `TRON_USDT`, `ETH_USDT`, `ARBITRUM_USDT`, `SOL_USDT`, `BASE_USDT`, `MATIC_USDT`, `BSC_USDT`
|
|
274
|
+
* @member {String} token_id
|
|
275
|
+
*/
|
|
276
|
+
CreatePaymentOrderRequest.prototype['token_id'] = undefined;
|
|
224
277
|
|
|
225
278
|
/**
|
|
226
|
-
*
|
|
279
|
+
* Indicates whether to allocate a dedicated address for this order. If false, a shared address from the address pool will be used.
|
|
227
280
|
* @member {Boolean} use_dedicated_address
|
|
228
281
|
*/
|
|
229
282
|
CreatePaymentOrderRequest.prototype['use_dedicated_address'] = undefined;
|
|
230
283
|
|
|
231
284
|
/**
|
|
232
|
-
*
|
|
285
|
+
* A custom exchange rate specified by the merchant. - Only effective when `currency` is `\"USD\"`. - Expressed as the amount of USD per 1 unit of the specified cryptocurrency. - If not provided, the system will use the default internal rate. Example: If the cryptocurrency is USDT and `custom_exchange_rate` = `\"0.99\"`, it means 1 USDT = 0.99 USD.
|
|
233
286
|
* @member {String} custom_exchange_rate
|
|
234
287
|
*/
|
|
235
288
|
CreatePaymentOrderRequest.prototype['custom_exchange_rate'] = undefined;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* The maximum allowed deviation from the payable amount in the case of underpayment, specified as a positive value with up to one decimal place. If you provide more than one decimal place, an error will occur. When the actual received amount is within this deviation (inclusive) of the payable amount, the order status will be set to `Completed` rather than `Underpaid`.
|
|
239
|
-
* @member {String} amount_tolerance
|
|
240
|
-
*/
|
|
241
|
-
CreatePaymentOrderRequest.prototype['amount_tolerance'] = undefined;
|
|
242
289
|
var _default = exports["default"] = CreatePaymentOrderRequest;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _PaymentPayoutParam = _interopRequireDefault(require("./PaymentPayoutParam"));
|
|
9
|
+
var _PayoutChannel = _interopRequireDefault(require("./PayoutChannel"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
20
|
+
* Cobo Wallet as a Service 2.0
|
|
21
|
+
*
|
|
22
|
+
* Contact: help@cobo.com
|
|
23
|
+
*
|
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
+
* https://openapi-generator.tech
|
|
26
|
+
* Do not edit the class manually.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The CreatePayoutRequest model module.
|
|
31
|
+
* @module model/CreatePayoutRequest
|
|
32
|
+
*/
|
|
33
|
+
var CreatePayoutRequest = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>CreatePayoutRequest</code>.
|
|
36
|
+
* @alias module:model/CreatePayoutRequest
|
|
37
|
+
* @param request_id {String} The request ID that is used to track a settlement request. The request ID is provided by you and must be unique.
|
|
38
|
+
* @param payout_channel {module:model/PayoutChannel}
|
|
39
|
+
* @param payout_params {Array.<module:model/PaymentPayoutParam>}
|
|
40
|
+
*/
|
|
41
|
+
function CreatePayoutRequest(request_id, payout_channel, payout_params) {
|
|
42
|
+
_classCallCheck(this, CreatePayoutRequest);
|
|
43
|
+
CreatePayoutRequest.initialize(this, request_id, payout_channel, payout_params);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the fields of this object.
|
|
48
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
49
|
+
* Only for internal use.
|
|
50
|
+
*/
|
|
51
|
+
return _createClass(CreatePayoutRequest, null, [{
|
|
52
|
+
key: "initialize",
|
|
53
|
+
value: function initialize(obj, request_id, payout_channel, payout_params) {
|
|
54
|
+
obj['request_id'] = request_id;
|
|
55
|
+
obj['payout_channel'] = payout_channel;
|
|
56
|
+
obj['payout_params'] = payout_params;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>CreatePayoutRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/CreatePayoutRequest} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/CreatePayoutRequest} The populated <code>CreatePayoutRequest</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new CreatePayoutRequest();
|
|
71
|
+
if (data.hasOwnProperty('request_id')) {
|
|
72
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('payout_channel')) {
|
|
75
|
+
obj['payout_channel'] = _PayoutChannel["default"].constructFromObject(data['payout_channel']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('payout_params')) {
|
|
78
|
+
obj['payout_params'] = _ApiClient["default"].convertToType(data['payout_params'], [_PaymentPayoutParam["default"]]);
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('bank_account_id')) {
|
|
81
|
+
obj['bank_account_id'] = _ApiClient["default"].convertToType(data['bank_account_id'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('currency')) {
|
|
84
|
+
obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('remark')) {
|
|
87
|
+
obj['remark'] = _ApiClient["default"].convertToType(data['remark'], 'String');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Validates the JSON data with respect to <code>CreatePayoutRequest</code>.
|
|
95
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
96
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreatePayoutRequest</code>.
|
|
97
|
+
*/
|
|
98
|
+
}, {
|
|
99
|
+
key: "validateJSON",
|
|
100
|
+
value: function validateJSON(data) {
|
|
101
|
+
// check to make sure all required properties are present in the JSON string
|
|
102
|
+
var _iterator = _createForOfIteratorHelper(CreatePayoutRequest.RequiredProperties),
|
|
103
|
+
_step;
|
|
104
|
+
try {
|
|
105
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
106
|
+
var property = _step.value;
|
|
107
|
+
if (!data.hasOwnProperty(property)) {
|
|
108
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// ensure the json data is a string
|
|
112
|
+
} catch (err) {
|
|
113
|
+
_iterator.e(err);
|
|
114
|
+
} finally {
|
|
115
|
+
_iterator.f();
|
|
116
|
+
}
|
|
117
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
118
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
119
|
+
}
|
|
120
|
+
if (data['payout_params']) {
|
|
121
|
+
// data not null
|
|
122
|
+
// ensure the json data is an array
|
|
123
|
+
if (!Array.isArray(data['payout_params'])) {
|
|
124
|
+
throw new Error("Expected the field `payout_params` to be an array in the JSON data but got " + data['payout_params']);
|
|
125
|
+
}
|
|
126
|
+
// validate the optional field `payout_params` (array)
|
|
127
|
+
var _iterator2 = _createForOfIteratorHelper(data['payout_params']),
|
|
128
|
+
_step2;
|
|
129
|
+
try {
|
|
130
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
131
|
+
var item = _step2.value;
|
|
132
|
+
_PaymentPayoutParam["default"].validateJSON(item);
|
|
133
|
+
}
|
|
134
|
+
} catch (err) {
|
|
135
|
+
_iterator2.e(err);
|
|
136
|
+
} finally {
|
|
137
|
+
_iterator2.f();
|
|
138
|
+
}
|
|
139
|
+
;
|
|
140
|
+
}
|
|
141
|
+
// ensure the json data is a string
|
|
142
|
+
if (data['bank_account_id'] && !(typeof data['bank_account_id'] === 'string' || data['bank_account_id'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `bank_account_id` to be a primitive type in the JSON string but got " + data['bank_account_id']);
|
|
144
|
+
}
|
|
145
|
+
// ensure the json data is a string
|
|
146
|
+
if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
|
|
148
|
+
}
|
|
149
|
+
// ensure the json data is a string
|
|
150
|
+
if (data['remark'] && !(typeof data['remark'] === 'string' || data['remark'] instanceof String)) {
|
|
151
|
+
throw new Error("Expected the field `remark` to be a primitive type in the JSON string but got " + data['remark']);
|
|
152
|
+
}
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}]);
|
|
156
|
+
}();
|
|
157
|
+
CreatePayoutRequest.RequiredProperties = ["request_id", "payout_channel", "payout_params"];
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The request ID that is used to track a settlement request. The request ID is provided by you and must be unique.
|
|
161
|
+
* @member {String} request_id
|
|
162
|
+
*/
|
|
163
|
+
CreatePayoutRequest.prototype['request_id'] = undefined;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @member {module:model/PayoutChannel} payout_channel
|
|
167
|
+
*/
|
|
168
|
+
CreatePayoutRequest.prototype['payout_channel'] = undefined;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @member {Array.<module:model/PaymentPayoutParam>} payout_params
|
|
172
|
+
*/
|
|
173
|
+
CreatePayoutRequest.prototype['payout_params'] = undefined;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* | Only used in OffRamp payout channel. The ID of the bank account where the settled funds will be deposited.
|
|
177
|
+
* @member {String} bank_account_id
|
|
178
|
+
*/
|
|
179
|
+
CreatePayoutRequest.prototype['bank_account_id'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The fiat currency for the create payouts.
|
|
183
|
+
* @member {String} currency
|
|
184
|
+
*/
|
|
185
|
+
CreatePayoutRequest.prototype['currency'] = undefined;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The remark for the create payouts.
|
|
189
|
+
* @member {String} remark
|
|
190
|
+
*/
|
|
191
|
+
CreatePayoutRequest.prototype['remark'] = undefined;
|
|
192
|
+
var _default = exports["default"] = CreatePayoutRequest;
|
|
@@ -206,19 +206,19 @@ CreateRefundRequest.prototype['refund_type'] = undefined;
|
|
|
206
206
|
CreateRefundRequest.prototype['order_id'] = undefined;
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
|
-
* Whether to charge developer fee to the merchant. This field is only valid when `refund_type` is `Merchant`. For more information, please refer to [Funds allocation and balances](https://www.cobo.com/
|
|
209
|
+
* Whether to charge developer fee to the merchant. This field is only valid when `refund_type` is `Merchant`. For more information, please refer to [Funds allocation and balances](https://www.cobo.com/payments/en/guides/amounts-and-balances). - `true`: The fee amount (specified in `merchant_fee_amount`) will be deducted from the merchant's balance and added to the developer's balance - `false`: The merchant is not charged any developer fee When enabled, ensure both `merchant_fee_amount` and `merchant_fee_token_id` are properly specified.
|
|
210
210
|
* @member {Boolean} charge_merchant_fee
|
|
211
211
|
*/
|
|
212
212
|
CreateRefundRequest.prototype['charge_merchant_fee'] = undefined;
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
|
-
* The developer fee amount to charge the merchant, denominated in the cryptocurrency specified by `merchant_fee_token_id`. This field is only valid when `refund_type` is `Merchant`. For more information, please refer to [Funds allocation and balances](https://www.cobo.com/
|
|
215
|
+
* The developer fee amount to charge the merchant, denominated in the cryptocurrency specified by `merchant_fee_token_id`. This field is only valid when `refund_type` is `Merchant`. For more information, please refer to [Funds allocation and balances](https://www.cobo.com/payments/en/guides/amounts-and-balances). This field is required when `charge_merchant_fee` is `true`. Must be: - A positive integer with up to two decimal places. - Less than the refund amount
|
|
216
216
|
* @member {String} merchant_fee_amount
|
|
217
217
|
*/
|
|
218
218
|
CreateRefundRequest.prototype['merchant_fee_amount'] = undefined;
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
|
-
* The ID of the cryptocurrency used for the
|
|
221
|
+
* The ID of the cryptocurrency used for the transaction fee. This is only applicable if `charge_merchant_fee` is set to true.
|
|
222
222
|
* @member {String} merchant_fee_token_id
|
|
223
223
|
*/
|
|
224
224
|
CreateRefundRequest.prototype['merchant_fee_token_id'] = undefined;
|
|
@@ -184,7 +184,7 @@ CreateSafeWalletParams.prototype['wallet_type'] = undefined;
|
|
|
184
184
|
CreateSafeWalletParams.prototype['wallet_subtype'] = undefined;
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
|
-
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Web3 Wallets.
|
|
187
|
+
* Enable the auto-sweep feature for the wallet. This parameter only applies to MPC Wallets and Custodial Wallets (Web3 Wallets).
|
|
188
188
|
* @member {Boolean} enable_auto_sweep
|
|
189
189
|
*/
|
|
190
190
|
CreateSafeWalletParams.prototype['enable_auto_sweep'] = undefined;
|