#ErinaceusEAM-transactions
1 messages ยท Page 1 of 1 (latest)
Hi, could you please explain your use case it would be easier for me to give you adequate answers
I'm not sure how to better explain it. We are using the API to POST data collected on our Gateway. Hence we need to understand if there are any statuses that are not final
what are you trying to achieve?
complete our integration and be sure that the information shared via API is correctly displayed in the gateway
can you be more specific?
ok,. say there is a card transaction.
the final status of which is - Success (meaning the payment has gone through)
are there any statuses prior to that success status
for example -
- pending confirmation
- pending 3DS
- processing
or any other.
or will we only receive a final status for the transaction i.e. Success / Decline
if you're using Payment Intents which is the recommended way of doing Payments you can find the flow and different statuses in the link I just sent you
this is our flow
1)Created POST payment method https://api.stripe.com/v1/payment_methods
2)Created payment method https://api.stripe.com/v1/payment_intents
2.)We added return_url to created payment method and client return to us
3)Sent the client to stripe_js - https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_se[...]U3FQLF9MYVYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN
{ "next_action": {
"type": "use_stripe_sdk",
{ "use_stripe_sdk": {
{ "type": "three_d_secure_redirect",
{ "stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_secret=src_client_secret_yuu3HPPHr171rWuX4hEfvWbV&source_redirect_slug=test_YWNjdF8xS2Vjc1VHdG11TTJtU3FQLF9MYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN",
"source": "src_1KtEx9GtmuM2mSqPNxSR56BS"
}
},
4)Confirmed payment POST https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}}/confirm
One of your colleagues has confirmed yesterday that it is fine
when you say processing are you talking about the specific PaymentIntent status value processing? (https://stripe.com/docs/payments/intents?intent=payment)
for example -
- pending confirmation
- pending 3DS
- processing
or any other.
yes! there is a whole state machine for PaymentIntents and they go through various states as you go through the process of taking payments. The doc I linked helps explain them and you can see how they work in test mode.
great, that's what I've been looking for, Thank you for your assistance
one more question for clarity
After 3ds payment_intents can be in processing status?
I think they can be, briefly, but from your code's perspective you should never see that.
you call confirmCardPayment with our client libraries , which attempts to process the payment and present 3D Secure, and in the response the PaymentIntent will be either be succeeded (or requires_capture if using separate auth and capture)or requires_payment_method(if the attempt failed)
Got it, thanks
just to clarify, you are using our frontend libraries right?
like, if you are taking the JSON posted above and extracting out that hooks.stripe.com URL and redirecting to it manually, that is wrong and will break in subtle ways (if you do want to manually redirect for 3D Secure, it's possible and I can tell you how, but it's a somewhat common integration mistake to read the URL from inside use_stripe_sdk and want to make sure you're not doing it)
We were just sending the client to hooks.stripe.com URL
and someone here yesterday confirmed that the flow is fine after checking one of our transactions
yeah not everyone is aware of this unfortuantely
but you can't do that. For example, do a test and use the card 4000000000003220
you'll see there is no URL
the correct integration path is either
- confirm client side using the
handleCardActionlike in the guide you're using(https://stripe.com/docs/payments/accept-a-payment-synchronously?platform=web#web-handle-next-actions) - if you do want to manually redirect, you have to pass
return_urlon the PaymentIntent so we gurantee a URL is returned https://stripe.com/docs/payments/3d-secure#manual-redirect
Can I add one of our lead devs to this thread?
of course
great
Hi
Can we have a call?
@stark haven
We added return_url to payment_intents.
So we can avoid JS lib?
we can talk here
yep, then you're using my second option :
if you do want to manually redirect, you have to pass return_url on the PaymentIntent so we gurantee a URL is returned https://stripe.com/docs/payments/3d-secure#manual-redirect
so that's certainly a supported option if you want to do it that way!
1)Created POST payment method https://api.stripe.com/v1/payment_methods
2)Created payment intent https://api.stripe.com/v1/payment_intents
2.)We added return_url to created payment intent and client return to us
3)Sent the client to stripe_js - https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_se[...]U3FQLF9MYVYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN
{ "next_action": {
"type": "use_stripe_sdk",
{ "use_stripe_sdk": {
{ "type": "three_d_secure_redirect",
{ "stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_1KtEx9GtmuM2mSqPNxSR56BS?client_secret=src_client_secret_yuu3HPPHr171rWuX4hEfvWbV&source_redirect_slug=test_YWNjdF8xS2Vjc1VHdG11TTJtU3FQLF9MYVBtak5nYXg0VEJyT0ZKbHlGcW9HME5VdGtadk9s0100kYgPNUaN",
"source": "src_1KtEx9GtmuM2mSqPNxSR56BS"
}
},
4)Client returbs and we make - Confirmed payment POST https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}}/confirm
yep, I've seen that same set of steps three times now ๐
So, all ok?
We added return_url to created payment method and client return to us
hmm, but you're not doing it right then, since if you pass return_url you would not getuse_stripe_sdkreturned.
I get
"next_action": {
"redirect_to_url": {
"return_url": "https://www.google.com/",
"url": "https://hooks.stripe.com/redirect/authenticate/src_1KtUqfGtmuM2mSqPy8xGXeXr?client_secret=src_client_secret_yQHBIQheEFcXXuaZMehQUhkv&source_redirect_slug=test_YWNjdF8xS2Vjc1VHdG11TTJtU3FQLF9MYWdEZ2lEOHdqaUxwNURMNVVlQ1pIcEZmSnBuUUNM010089NCZsMC"
},
"type": "redirect_to_url"
},
ok, then that is good!
Please tell me after 3ds payment_intents can be in processing status?
When I make this - Confirmed payment POST https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}}/confirm
Is it possible to get processing status?
I answered that to your colleague up above so perhaps that helps!
in general card payments don't go into the processing state as far as I'm aware, it's only for asynchronous payment methods like bank debits.
Thank you.
@stark haven
Please tell me what webhook events we need only for card transactions.
Only for https://api.stripe.com/v1/payment_intents
payment_intent.payment_failed
payment_intent.succeeded
Is it possible to set the webhook URL dynamically?
Hi! I'm taking over karllekko. What do you mean by "dynamically"? When you create a webhook endpoint you need to set its URL, and you can edit it if needed. And if you need multiple URLs you can create multiple webhooks endpoints.
@steady pine
Set webhook url via API, not in the dashboard.
@steady pine
We set url in the dashboard, but we don't get the webhook.
Yes you can create a webhook endpoint with the API, and update its URL if needed.
https://stripe.com/docs/api/webhook_endpoints/create
We set url in the dashboard, but we don't get the webhook.
Can you share your webhook endpoint ID (we_xxx)?
Can you share your account ID (acct_xxx)? It's at the top of this page: https://dashboard.stripe.com/settings/account
@wanton fable
Please help.
OK, I found your account ID: acct_1KecsUGtmuM2mSqP
And I can see you created multiple webhook endpoints in test mode.
And when we send you events, we get the 502 answer from your server.
Can you double check that the URL you used is correct, that your server is running, and it's returning 200 response to Stripe?
acct_1KecsUGtmuM2mSqP
Yes I found that ๐
So can you double check that the URL you used is correct, that your server is running, and that's its returning 200 response to Stripe?
All ok
Thank you
I want to clerify
what event i have to use for card transactions?
"charge.succeeded", "charge.failed", "payment_intent.payment_failed", "payment_intent.succeeded"
@steady pine
If you are creating payment_intent, then you should listen for payment_intent.payment_failed and payment_intent.succeeded
We need to respond just 200 yes?
Yes
I see that I have a lot of webhooks
Is it ok?
Like 11 of them.
I get them everytime I pass the transaction.
2022/04/29 15:56:47 transaction error: {"class":"external","code":"request_failed","message":"[f28e0059-7b2a-4b77-af74-f1c833493a75] request POST https://api.stripe.com/v1/webhook_endpoints failed with code=400 body={\n "error": {\n "message": "You already reached the limit of 16 test webhook endpoints.",\n "type": "invalid_request_error"\n }\n}\n","stack_trace":null}
I got it
The error you pasted is pretty clear:
You already reached the limit of 16 test webhook endpoints.