#I am receiving error: Could not find payment session

34 messages · Page 1 of 1 (latest)

crisp silo
#

this is my code : ```
await cartService
.withTransaction(manager)
.setPaymentSessions(cartId?.id);
console.log("FIRST");
await cartService
.withTransaction(manager)
.setPaymentSession(cartId?.id, "manual");
}

how do I fix this ?
warm hearth
#

What is the total of your cart?

warm hearth
#

And is it available in your region ?

crisp silo
#

sometimes cart isn't adding to product

#

sometimes it adds, other times it just doesn't

crisp silo
#

I checked from postman it is working but it is taking a while around 6s and on the storefront its taking 3s but it is not adding the item to the cart

crisp silo
#

any idea adrien?

#

I dont have any issue else where

#

I also wrapped the function in the photo shown above, in a try catch block

warm hearth
#

It either add or update it, are you sure that when it does not add it it is not because it already exists and update it?

#

And which version are you using? 3s seems to be a lot

crisp silo
#

1.7.2

#

basically as a user im adding product A to cart

#

then re-adding product A again

warm hearth
#

I ll have to jump on a call, but it looks weird, are you customising something that might interfer?

crisp silo
#

is this how it should be ?

#

im not using anything at all other than that

#

im using basic functions that don't require any promises

warm hearth
#

When you re add it, it updates the first one since there is an existing and, the if the item has should_merge true then it is normal

crisp silo
#

and they are running fine too

warm hearth
#

Are you using the existing end point? If it takes more time than the existing one it means that something you are doing is blocking

crisp silo
#

no a custom endpoint, but for adding the line item

#

i am using the cartService core method

#

addOrUpdateLineItems

warm hearth
#

Yes which acts normally as explained earlier it update the item if it already exists etc etc.
But the response time, it should not be that high

crisp silo
#

this is a remote call not on local

#

tested on remote

warm hearth
#

Yeah but still the same answer 😂

crisp silo
#

it worked nvm

#

anyways

#

I am receiving this warning on add to cart -> WARN: withTransaction called without custom implementation

#

what could this mean ?

warm hearth
#

It is just a warn, some default implementation of services that are just mocked of plugins do not implement the withTransaction. You can pass without problem

crisp silo
#

oh ok