File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ export const paymentRouter = router({
3030 recurrence : input . recurrence ?? undefined ,
3131 ...( feePercentage && feeAddress
3232 ? {
33- feePercentage : feePercentage ,
34- feeAddress : feeAddress ,
33+ feePercentage,
34+ feeAddress,
3535 }
3636 : { } ) ,
3737 } ) ;
@@ -57,19 +57,26 @@ export const paymentRouter = router({
5757 } ) ;
5858 }
5959
60+ const feePercentage = process . env . FEE_PERCENTAGE_FOR_PAYMENT ;
61+ const feeAddress = process . env . FEE_ADDRESS_FOR_PAYMENT ;
62+
6063 const response = await apiClient . post ( "v2/payouts/batch" , {
6164 requests : input . payouts
6265 ? input . payouts . map ( ( payout ) => ( {
6366 amount : payout . amount . toString ( ) ,
6467 payee : payout . payee ,
6568 invoiceCurrency : payout . invoiceCurrency ,
6669 paymentCurrency : payout . paymentCurrency ,
67- feePercentage : process . env . FEE_PERCENTAGE_FOR_PAYMENT ,
68- feeAddress : process . env . FEE_ADDRESS_FOR_PAYMENT ,
6970 } ) )
7071 : undefined ,
7172 requestIds : input . requestIds ,
7273 payer : input . payer ,
74+ ...( feePercentage && feeAddress
75+ ? {
76+ feePercentage,
77+ feeAddress,
78+ }
79+ : { } ) ,
7380 } ) ;
7481
7582 return response . data ;
You can’t perform that action at this time.
0 commit comments