#tyler.yang - follow-up

1 messages ยท Page 1 of 1 (latest)

spare stag
#

hey there, just cathcing up here

#

you're saying some payments generate webhook events you receive, while others do not?

#

Do you have example events that you do receive i can look at?

#

and a payment example you don't receive an event for?

#

You've solved your issue of being able to tell which payments originated form web vs app, then?

#

If you need help with webhook delivery, we'll need to get a bit more detail from you @halcyon badge

halcyon badge
#

yeah sure

#

this is the one that missing application pi_3K6oXtJYxzz9q9i90VQItAwd which did NOT trigger the webhook
this is the webhook we_1JXdlxJYxzz9q9i9kkxIhn9C

#

this is the one PI that can trigger our webhook pi_3K6oFvFUtwYrZPVC1UALRxqo

#

which contains application

halcyon badge
#

yesterday I was told that this is because the webhook uses our Contect account

spare stag
#

sorry now youre saying "missing application" vs "contains application" -- are you getting all the events you expect, but some have different attributes/data than you need?

halcyon badge
#

we tested Apple Pay in both Web and App, PI originated from WEB, contains Application
PI originated from APP, does NOT contain Application

#

This is the request that contains application req_BVskbqUXs3zcdG

#

This is the request that missing application req_e385AJPL9OCA0M

#

"application": "XXXXXX", is the only difference between above two requests

spare stag
#

Great, thanks for that - let me take a look

#

Yep, this makes sense. One of those requests is made as your own account (req_e385AJPL9OCA0M) while the other is made as a connect request as a direct charge on a separate account (acct_18NGoVFUtwYrZPVC )

#

so yes you receive one of the payment related event on your own account webhook endpoint, and the other would happen via your connect endpoint with application and the stripe account values available

#

this is expected behaviour based on the way you are making these requests

halcyon badge
#

but we were sending those two requests in the exactly same way?

#

both via the same endpoint

#

same payload structure

#

just wondering how did they end up using different account in our case

fallow basin
#

๐Ÿ‘‹ I'm just hopping in to take over for @spare stag

halcyon badge
#

hi @fallow basin

fallow basin
#

Something has to be different in your code for those requests - they're using different API keys and also the one that contains application is setting the Stripe-Account header.

halcyon badge
#

hmmmmm

#

are you able to help me find out which account was used for request req_e385AJPL9OCA0M?

fallow basin
#

For req_e385AJPL9OCA0M it was created with the api keys from account acct_187vnhJYxzz9q9i9 (which is your platform account). For req_BVskbqUXs3zcdG it was still created using the acct_187vnhJYxzz9q9i9 API keys, but with the addition of the Stripe-Account header to specify the connect account acct_18NGoVFUtwYrZPVC

halcyon badge
#

right, so req_e385AJPL9OCA0M was missing that header

fallow basin
#

Yup

halcyon badge
#

are you able to share some lights on the possible cause of this?

#

from what I can tell, all requests should be using the same account

errant basin
#

Hello! You mean why was that last request you mentioned missing the Stripe-Account header?

halcyon badge
#

yeah

#

bit strange that similar request end up using different account

errant basin
#

Because your Node code didn't set it. Maybe the code is trying to set it to an empty value or something?

halcyon badge
#

just want to make sure I'm looking at the right place, you meant this stripe.paymentIntents.create({ stripeAccount: xxxxx}) ?

errant basin
#

Are you trying to pass stripeAccount in alongside other values like amount or is it in a separate object?

halcyon badge
#

those values are in separated object, sorry about confusion, const paymentIntent = await stripe.paymentIntents.create( { payment detail data here }, { stripeAccount: xxxxxxxx, });

errant basin
#

Ah, yeah, that looks correct. Can you log out the value of stripeAccount just before that code runs and make sure it's the account ID you're expecting it to be?

halcyon badge
#

yeah, trying to see whether I can grab it. Will update you later. Thanks @errant basin

#

GOT IT!

#

now I can see the application is correct for new payment intent

#

but, also bad news ๐Ÿ˜ฎโ€๐Ÿ’จ

#

payment intent cannot be completed ๐Ÿ˜ฆ

errant basin
#

Are you getting an error?

halcyon badge
#

we are getting error like this Payment failed: Optional(Error Domain=com.stripe.lib Code=50 "There was an unexpected error -- try again in a few seconds" UserInfo={com.stripe.lib:ErrorParameterKey=intent, com.stripe.lib:StripeErrorCodeKey=resource_missing, com.stripe.lib:StripeErrorTypeKey=invalid_request_error, com.stripe.lib:ErrorMessageKey=No such payment_intent: 'pi_3K76PjFUtwYrZPVC2h3CKLHA', NSLocalizedDescription=There was an unexpected error -- try again in a few seconds})

#

this is the error I got from the App

errant basin
#

Can you give me a request ID for that?

halcyon badge
#

let me try

#

here is the request ID req_6sgDZZpDr6SSCX

errant basin
#

Are you sure that's the correct request ID? That request appears to have succeeded with no issues.

halcyon badge
#

that is the request for creating the payment intent

#

but I cant find a request for that failed one

#

this is what I can find out for that PI

errant basin
#

The error usually indicates the Payment Intent doesn't exist on the account you tried to make the request on.

halcyon badge
#

does the app need to know which account?

errant basin
#

The request log would exist on that other account, not your platform account.

#

Yes, the app needs to know which account.

halcyon badge
#

where can we set account in iOS SDK? or this is related to publishable key?

errant basin
#

Switch to the iOS tab there.

halcyon badge
#

oh man @errant basin big thanks

#

finally

#

is there a rating button here to provide feedback on your awesome help? ๐Ÿ˜‰

errant basin
#

We don't have anything like that set up here, but thank you for the kind words! ๐Ÿ™‚

halcyon badge
#

again, big thanks!