#cynnez

1 messages · Page 1 of 1 (latest)

woven basaltBOT
#

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.

  • cynnez, 21 hours ago, 5 messages
  • cynnez, 1 day ago, 15 messages
outer quarry
#

Normally it should be on the header of the request

#

if you print all headers, do you see it

astral vigil
outer quarry
#

ie. request.headers['stripe-signature'];

#

How your lambda code looks like? Could you paste the webhook logic here?

astral vigil
#

This is my whole lambda function code.. the webhook logic could be seen above

outer quarry
#
const signature = event.headers['Stripe-Signature'];
#

If you console log here, what do you see event.headers value?

astral vigil
#

eventheaders went to my origin localhost

#

how do i make it to take in stripe signature then?

outer quarry
#

That means the lambda somehow altererd event from the request

#

wait

#

Can you create a bodyMapping template according to this mail

astral vigil
#

you mean put this code in mapping template right?
^ i did it but it still gimme the same error

outer quarry
#

Does it change the value of event?

astral vigil
#

nope. it didnt

astral vigil
outer quarry
#

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
  }
}
astral vigil
outer quarry
#

Did you set it as the first screenshot "body passthrough"

astral vigil
#

yeap

astral vigil
#

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?

outer quarry
#

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

astral vigil
outer quarry
#

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

astral vigil
#

finished a...?

outer quarry
#

"Finish (a)"

#

Sorry!

astral vigil
#

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?

outer quarry
#

(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

astral vigil
#

hmm have to try again then since hv to split btwn two

#

do u need to close this chat again?

outer quarry
#

You can come back later.

#

I probably close when I sign off but feel free to request a new chat when my colleague takes over