@spritz-finance/api-client 0.4.10 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,6 +30,7 @@ import {
30
30
  BankAccountType,
31
31
  BankAccountSubType,
32
32
  DebitCardNetwork,
33
+ AmountMode,
33
34
  } from '@spritz-finance/api-client'
34
35
 
35
36
  // Initialize the client with your integration key
@@ -730,14 +731,24 @@ A payment request refers to the intent to initiate a payment to a specific accou
730
731
 
731
732
  To initiate a payment request for a specific account, you can use the following functionality. The required inputs for creating a payment request include the ID of the account to be paid, the amount of the fiat payment in USD, and the network on which the blockchain transaction will settle.
732
733
 
734
+ #### Amount Mode
735
+
736
+ When creating a payment request, you can specify how the amount should be calculated using the `amountMode` parameter:
737
+
738
+ - **`TOTAL_AMOUNT`**: The payer covers the entire amount including fees. The specified amount is the total that will be deducted from the payer's wallet.
739
+ - **`AMOUNT_RECEIVED`** (default): The payment that arrives in the bank account excludes fees. The specified amount is what the recipient will receive, and fees are added on top.
740
+
741
+ This allows you to control whether fees are included in or added to the specified amount.
742
+
733
743
  ```typescript
734
- import {PaymentNetwork} from '@spritz-finance/api-client';
744
+ import {PaymentNetwork, AmountMode} from '@spritz-finance/api-client';
735
745
 
736
746
  const paymentRequest = await client.paymentRequest.create({
737
747
  amount: 100,
738
748
  accountId: account.id,
739
749
  network: PaymentNetwork.Ethereum,
740
- deliveryMethod: 'INSTANT'
750
+ deliveryMethod: 'INSTANT',
751
+ amountMode: AmountMode.TOTAL_AMOUNT // Optional, defaults to AMOUNT_RECEIVED
741
752
  });
742
753
 
743
754
  // Example response