#canopus_paymentintent-charges

1 messages ยท Page 1 of 1 (latest)

thorn irisBOT
#

๐Ÿ‘‹ 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.

dim turtle
#

canopus_paymentintent-charges

keen cradle
#

really? when I did my validation in test mode, I don't belive I encountered this behavior

dim turtle
#

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

thorn irisBOT
keen cradle
#

which of the documented test cases should produce this behavior?

river haven
#

Hi @keen cradle I'm taking over this thread.

keen cradle
#

so at T+3 the charge object is created? if you add a BACS payment method and immediately process the charge

river haven
keen cradle
#

is this only for the first payment of the payment method and on subsequent payment_intents the charge should be created immediately?

river haven
#

Let me take a look

river haven
#

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?

keen cradle
#

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?

river haven
#

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

keen cradle
#

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?

river haven
#

I can't guarantee that. Can you tell me why you need to access the charge object upon paymentIntent creation?

keen cradle
#

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?

keen cradle
#

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

river haven
#

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 .

keen cradle
#

yea, we do attach the metadata to the payment intent, but today we don't use webhooks

keen cradle
keen cradle
#

what is the difference between the py_ prefixed ids and ch_ prefix for charge ids?

river haven
#

The are both charge objects, and you can use Charges API for both py_ and ch_ IDs.

keen cradle
#

but why do both exist? does every charge object have both?

river haven
#

No, a charge object ID starts with either py_ or ch_ , but not both.

keen cradle
#

thank you for all your help, much appreciated. ๐ŸŽ‰
also, I'd like to say that stripe has excellent developer support.