#jaybabu_best-practices
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/1296842200709206031
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jaybabu_error, 17 hours ago, 15 messages
Hey there, can you share some snippets of your code for your steps 2 & 3 so i can undersstand a bit more about your integration?
Also, and example payment intent ID that completed successfully following the pattern you describe would be helpful
.setPaymentMethod(!isCardPresent ? cardId.get() : null)
Where is this card coming from at intent creation time? I don't understand the flow here
oh, wait, that looks to be for the not card present case
this is how we determine card present or not. correct
for card present you attach nothing, that makes more sense
95-99% is card present
ok
- Attach card present payment method
So, here, you don't mean you attach a specific payment method ID, you mean you set the payment method type tocard_presentto get it ready for collection via terminal reader
sorry, yes. the payment method gets attached by the terminal
ok, thanks for elaborating, i think I understand better now.
When you process a payment, Stripe immediately responds to the request with an HTTP 200 status code and returns a reader with an action status of in_progress.
To verify the reader state, listen to the terminal.reader.action_succeeded webhook or poll the Reader and PaymentIntent status to receive the status of the payment.
So you're doing the polling approach. If you want to stop that, you can listen for the webhook for the completed action.
We are more wondering how you can poll the payment intent?
Sure, you can do that, like it says
There is generally no such processing or in progress status for the payment intent for cards
I only see a way of doing it for success
What do you mean?
You can poll the payment intent to check the status is succeeded
Do you have an example payment intent with failures?
Payment Intent stays in requires_payment_method. There is no indictation that payment failed
Can you share an example pi_123 ID?
yes, one second
That's the expected state after payment failure, because it still requires a payment method
You can reuse the same PI again, for example, asking the customer to try again, or try another card
pi_3QBHIWDCuRuHsY0o10GAmDsY
Yes, I get that. I am saying you have to rely on the terminal state to do that
You can't just use the payment intent
Currently, we call cancel payment intent after every failure
You can, either by listening to the payment_intent.payment_failed events (eg: https://dashboard.stripe.com/events/evt_3QBHIWDCuRuHsY0o1bGf9QB5) or by inspecting the last_payment_error attribute:
https://docs.stripe.com/api/payment_intents/object#payment_intent_object-last_payment_error
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You don't need to do that, but that's up to you
We do that to ensure no payment error happens on it or if the terminal became unavailable we need to know if the payment went through or not
Okay, this last_payment_error might be enough. Thank you
The cancel call addition has been driven by issues with the terminal apis and the device not being available