#canopus_paymentintent-charges
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1278500630922657905
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
canopus_paymentintent-charges
@keen cradle that's expected. The PaymentIntent has status: 'processing' and if we're doing "mandate notification ahead of the debit" the Charge itself isn't created yet. It will be created days later/async. See https://docs.stripe.com/payments/payment-methods/bacs-debit#timing
really? when I did my validation in test mode, I don't belive I encountered this behavior
it should work the same way in Test mode but the "mandate notification" is part of it because there are rules around when you can debit immediately versus having to notify first
which of the documented test cases should produce this behavior?
Hi @keen cradle I'm taking over this thread.
so at T+3 the charge object is created? if you add a BACS payment method and immediately process the charge
https://docs.stripe.com/payments/bacs-debit/accept-a-payment?payment-ui=stripe-hosted#testing
You can use test account number 90012345 to test a PaymentIntent transitioning from processing to succeeded 3 minutes later.
is this only for the first payment of the payment method and on subsequent payment_intents the charge should be created immediately?
here is an example of a bacs payment where the charge is returned in the initial response, whats the difference with this case:
https://dashboard.stripe.com/acct_1Nj6GXLnJjenxupO/logs/req_UEB1xMF6UKT35N
Let me take a look
For pi_3PjdCCLnJjenxupO0Xc5Q5lA, the charges weren't created immediately because this was the first time that its associated payment method was ever used, and it couldn't be debited immediately because of the "Mandate notification" that koopajah explained earlier.
But for req_UEB1xMF6UKT35N, the assocaited payment method was successfully used in earlier paymentIntents and it can be debited immediately.
Can I suggest you to access the charges list when the paymentIntent transitions to succeeded status?
what about if a payment method was added and then 3-4 days later the first payment was made, would the charge be created immediately because the required mandate notification window would have past?
I can't guarantee that the charges will be created immediately in that case, but I'm certain they are available when paymentIntent is succeeded
ok, so for BACS we should expect the charge to be generally created at a later time
is it guaranteed that the charge is created immediately and returned in the response for a second payment using the payment method? or is there a potential race condition?
I can't guarantee that. Can you tell me why you need to access the charge object upon paymentIntent creation?
in our application we link our internal payment items to the charge id or refund id. and periodically check the status using that Id
and up till adding BACS we have consistently had a charge created when the payment_intent is created
is there a case where a charge object will never be created?
we do set a metadata attribute on the charges, "order_id" which is the unique identify for payment items for our application.
as a quick hotfix, I'm thinking to use Charge.search() api to find the charge if we don't yet have a charge_id (query: metadata['order_id']:'{order_id}'), and once we find the transaction, store the charge_id for future lookups
That's a good solution! If you attach the metadata to the paymentIntent object, You can also listen to charge.pending event, retrieve the metadata through charge -> paymentIntent and reconcile .
yea, we do attach the metadata to the payment intent, but today we don't use webhooks
I appreciate the vote of confidence ๐
what is the difference between the py_ prefixed ids and ch_ prefix for charge ids?
The are both charge objects, and you can use Charges API for both py_ and ch_ IDs.
but why do both exist? does every charge object have both?
No, a charge object ID starts with either py_ or ch_ , but not both.
thank you for all your help, much appreciated. ๐
also, I'd like to say that stripe has excellent developer support.