File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,12 @@ export default async (modBody: AppModuleBody<'create_transaction'>) => {
138138 bankSlipUrl,
139139 invoiceUrl,
140140 } ,
141- } = await asaasAxios . post ( '/v3/lean/payments' , asaasPayment ) ;
141+ } = await asaasAxios . post (
142+ paymentMethod . code === 'account_deposit'
143+ ? '/v3/lean/payments'
144+ : '/v3/payments/' ,
145+ asaasPayment ,
146+ ) ;
142147 transaction . intermediator = {
143148 payment_method : {
144149 code : asaasPayment . billingType || params . payment_method . code ,
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ export const getPaypalAxios = async () => {
5050 } ,
5151 ) ;
5252 if ( data ?. access_token ) {
53- _tokenExpiresAt = data . expires_in
54- ? Date . now ( ) + ( data . expires_in * 1000 )
53+ _tokenExpiresAt = data . expires_in > 0
54+ ? Date . now ( ) + ( Math . min ( data . expires_in , 9 * 60 * 60 ) * 1000 )
5555 : Date . now ( ) + ( 9 * 60 * 60 * 1000 ) ;
5656 docRef . set ( {
5757 data,
You can’t perform that action at this time.
0 commit comments