#Zohar
1 messages · Page 1 of 1 (latest)
👋 let's chat here!
Just adding what you sent in the main thread:
payload=raw_data, sig_header=signature, secret=self.__webhook_secret
)
not getting any account info```
thanks
payment_event = event.data.object
payment_event_type = event.type
connected_account_id = event.account
payment_intent_id = payment_event.id
so event.account does not exists for some reason
but the other peices are there
here is everything i got back from the CLI
just to cover all our bases:
- Is your server running?
- is the CLI routing events to your webhook endpoint with
stripe listen --forward-to [server endpoint]?
yes
i know it's working becuase the break point light up in studio after i send the event
and i can trace through what came in
Is your endpoint returning a 200 response to stripe as part of your event handler code?
yes
return func.HttpResponse(body=json.dumps({ "success": True }),
status_code=200)
but in this case sinceit's not working it's not retunring that
except stripe.error.SignatureVerificationError as e:
return func.HttpResponse(
"Signature verification error",
status_code=400
)
it's returning this
because no account is being passed
this all works in my production enviroment
it's somthing that i don't have properly configured in test that causing the issue
what need to be setup to stripe retunr the account info in test?
Hi there, stepping in as roadrunner is away. Catching up here
thanks
Can you share the event is where it's working as expected in Live mode? Is the issue, on your first screenshot you're not seeing an account id?
yes
no account id is the issue
i can't share from live mode don't have access to production
it's looking for the stripe ID
how do i get the CLI to pass a stripe id?
can i set one up?
You're trying to trigger a payment_intent.succeeded for a connected account it sounds like, is that correct?
I see, let test this on my end
I'm looking at this document, https://stripe.com/docs/connect/webhooks#test-webhooks-locally and will confirm once I have the correct formatting
if event["type"] == "account.application.deauthorized":
application = event["data"]["object"]
connected_account_id = event["account"]
handle_deauthorization(connected_account_id, application)
connected_account_id is what i need from the example you sent
just saw this
For Connect webhooks, use --forward-connect-to with stripe listen and --stripe-account with stripe trigger.
I'm using a Connect webhook
i think i need to add the stripe-account i'll try it
it worked!
i had to add --stripe_account to get the account to populate
may i ask a differnt question?
I would like to trigger a payment_intent.succeeded that passes and invoice that is attached to a subscription how would i do that
Great to hear it worked, taking a look at the second question.
thanks
From looking at this, https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/payment_intent.succeeded.json, what you're trying to achieve is not possible. It just created a new Payment Intent. You'd instead need to make explicit API calls to see this event for an invoice.
yes i'll need to creaate the api call but how can i make sure that what's returned in the API code is a subsription linked to the invoide that i passs?
You can create a Subscription, https://stripe.com/docs/api/subscriptions and pay the invoice in your test mode. You can learn more about how it all works here: https://stripe.com/docs/billing/subscriptions/overview
how do i pay the invoice in my test module?
You can pay this by using one of these test cards, https://stripe.com/docs/testing#cards.