#ErinaceusEAM-transactions

1 messages ยท Page 1 of 1 (latest)

stable stag
#

Hi, could you please explain your use case it would be easier for me to give you adequate answers

wanton fable
#

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

stable stag
#

what are you trying to achieve?

wanton fable
#

complete our integration and be sure that the information shared via API is correctly displayed in the gateway

stable stag
#

can you be more specific?

wanton fable
#

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

stable stag
#

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

wanton fable
#

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

stark haven
#

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.

wanton fable
#

great, that's what I've been looking for, Thank you for your assistance

wanton fable
#

one more question for clarity

#

After 3ds payment_intents can be in processing status?

stark haven
#

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)

wanton fable
#

Got it, thanks

stark haven
#

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)

wanton fable
#

and someone here yesterday confirmed that the flow is fine after checking one of our transactions

stark haven
#

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

wanton fable
#

Can I add one of our lead devs to this thread?

stark haven
#

of course

wanton fable
#

great

olive path
#

Hi

#

Can we have a call?

#

@stark haven
We added return_url to payment_intents.
So we can avoid JS lib?

stark haven
stark haven
olive path
#

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

stark haven
#

yep, I've seen that same set of steps three times now ๐Ÿ™‚

olive path
#

So, all ok?

stark haven
#

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 get use_stripe_sdk returned.

stark haven
#

ok, then that is good!

olive path
#

Please tell me after 3ds payment_intents can be in processing status?

stark haven
#

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.

olive path
#

Thank you.

stark haven
olive path
#

payment_intent.payment_failed
payment_intent.succeeded

#

Is it possible to set the webhook URL dynamically?

steady pine
#

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.

olive path
#

@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.

steady pine
#

We set url in the dashboard, but we don't get the webhook.
Can you share your webhook endpoint ID (we_xxx)?

steady pine
olive path
#

@wanton fable
Please help.

steady pine
#

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?

wanton fable
#

acct_1KecsUGtmuM2mSqP

steady pine
#

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?

olive path
#

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

steady pine
#

If you are creating payment_intent, then you should listen for payment_intent.payment_failed and payment_intent.succeeded

olive path
#

We need to respond just 200 yes?

steady pine
#

Yes

olive path
#

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

steady pine
#

The error you pasted is pretty clear:

You already reached the limit of 16 test webhook endpoints.