#meghna_error
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1255972318132572281
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there ๐ are the requests you're making, that are encountering that error, generating request IDs that you can share with me?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
I don't have the requestID. I don't see it in Developer Logs
FYI, I only get this error sometimes. It's sporadic. sometimes it works fine
Hm, can you share how you're making the requests then?
PaymentIntent paymentIntent = PaymentIntent.create(paramMap); Charge omedaCharge = Charge.retrieve(paymentIntent.getLatestCharge());
Transfer transfer = Transfer.retrieve(omedaCharge.getTransfer());
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount(connectedAccountId).build();
Charge destinationPayment = Charge.retrieve(transfer.getDestinationPayment(), requestOptions);
ChargeUpdateParams params = ChargeUpdateParams.builder().
putMetadata("Customer Name", customerName).
putMetadata("Omeda Stripe CustomerId", omedaCharge.getCustomer()).build();
Charge charge = destinationPayment.update(params, requestOptions);
This is java code
I get this error when retrieving transfer object. Can this be because transfer has not initiated when code tries to find it?
Hard to say yet. Can you share the ID of a Payment Intent or Charge that you were working with when the error occurred?
Thank you, taking a closer look.
Ah, I think I see what's going on, and agree with your suspicion that the Transfer may not have existed when you tried to retrieve it.
You're on a newer API version where the default capture_method is automatic_async. With that we perform the capture asynchronously, so we can respond to your request faster, but one of the risks with that is that certain downstream objects may not be available right away. We talk through this in more detail here:
https://docs.stripe.com/payments/payment-intents/asynchronous-capture#opt-in-async-capture
That seems like it would align with you only seeing this sometimes, as it effectively creates a race condition between our backend and when you make the next request.
I would either suggest adding error handling that checks whether the Transfer ID is populated, and waits if not, before you try to retrieve the Transfer. Or, see if switching back to automatic for your capture_method helps avoid the occurrence of that error:
https://docs.stripe.com/api/payment_intents/create#create_payment_intent-capture_method