#cynnez
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
Normally it should be on the header of the request
if you print all headers, do you see it
where do i print the all headers from?
ie. request.headers['stripe-signature'];
How your lambda code looks like? Could you paste the webhook logic here?
const signature = event.headers['Stripe-Signature'];
If you console log here, what do you see event.headers value?
eventheaders went to my origin localhost
how do i make it to take in stripe signature then?
That means the lambda somehow altererd event from the request
wait
Can you create a bodyMapping template according to this mail
you mean put this code in mapping template right?
^ i did it but it still gimme the same error
Does it change the value of event?
nope. it didnt
give back this
Content-Type: application/json (just this – do not include ; charset=utf-8 afterwards)
Template content
{
"method": "$context.httpMethod",
"body": $input.json('$'),
"rawBody": "$util.escapeJavaScript($input.body).replaceAll("\\'", "'")",
"headers": {
#foreach($param in $input.params().header.keySet())
"$param": "$util.escapeJavaScript($input.params().header.get($param))"
#if($foreach.hasNext),#end
#end
}
}
Did you set it as the first screenshot "body passthrough"
still get the same thing
do u think is cuz the first part of my code, i redirect the event.headers{origin}..?
mode: 'subscription',
success_url: `${event.headers.Origin}/payments/success`,
cancel_url: `${event.headers.Origin}/payments/cancel`,
tbh. in the link u gave me, theres one github website, i see a person commented ^... i also facing this issue when i dont even check for signature in stripe. how do i solve this?
That's a different issue so let's ignore them. There could be a lot of different errors
Yes I do think the Subscription code is noisy. You would want to remove them to focus on how to make your webhook endpoint works first
Think I mentioned yesterday but you would want to separate the logic into 2 different endpoints, or better different server
hahha i tried to do it.... but
- subscription -> go through checkout process -> triggered webhook
- checking of webhook signature in lambda function -> api gateway url inside webhook -> stripe webhook "waiting for events" [ how do i trigger the webhook then?]
the webhook event triggered when your customer paid on the Checkout UI
That's completely 2 different step of (a) You create a Checkout Session, redirect its URL so your customer can see it and (b) Your another server, handling webhook receives checkout.session.completed when the customer finished a
finished a...?
HHAHA no worries
ohh so b is when after the session is done then will check for the signature?
for b do i need to create another new webhook or use the same?
(b) is the webhook logic you are trying to fix
I meant (a) should be moved to a completed different endpoint, or different lamda function
ohh
hmm have to try again then since hv to split btwn two
do u need to close this chat again?