#stripeuser_96421

1 messages · Page 1 of 1 (latest)

young sandalBOT
chrome knoll
#

Hi, let me help you with this.

#

What's exactly your challenge?

steady hornet
#

I created a payload like this : "1701436772".{ "id": "evt_1OILG0Fnpfya5sMz9zQg2cOG", "object": "event", "api_version": "2022-11-15", "created": 1701393064, "data": { "object": { "id": "po_1OIL8vFnpfya5sMzufFyJI4h", "object": "payout", "amount": 124529, "arrival_date": 1701388800, "automatic": true, "balance_transaction": "txn_1OIL8vFnpfya5sMzbnEhExxE", "created": 1701392625, "currency": "eur", "description": "STRIPE PAYOUT", "destination": "ba_1OFZswFnpfya5sMzwY78UQyG", "failure_balance_transaction": null, "failure_code": null, "failure_message": null, "livemode": false, "metadata": { }, "method": "standard", "original_payout": null, "reconciliation_status": "in_progress", "reversed_by": null, "source_type": "card", "statement_descriptor": null, "status": "in_transit", "type": "bank_account" } }, "livemode": false, "pending_webhooks": 1, "request": { "id": null, "idempotency_key": null }, "type": "payout.created" }

#

is it a right format?

#

because the signatures are not matching

chrome knoll
#

What are you trying to do?

steady hornet
#

trying to check if the data is coming from stripe only. so using hmac and matching the signature

#

I have created a webhook which is receiving events from stripe

#

I just want to confirm if the data is coming from stripe by using hmac functionality

chrome knoll
#

You shouldn't create payloads yourself, this won't work.

steady hornet
#

okay, then what is the right way to achieve this

chrome knoll
#

Trigger test events on your Stripe account and see if your webhook endpoint receives it.

steady hornet
#

yes that is working

#

what next

chrome knoll
#

What do you mean?

steady hornet
#

Step 2: Prepare the
signed_payload
string

The signed_payload string is created by concatenating:

The timestamp (as a string)
The character .
The actual JSON payload (that is, the request body)

#

documentation says this

#

thats why I am preparing the signed payload

#

is it not correct way?

chrome knoll
steady hornet
#

this is the documentation I am following

#

It suggests to create a signed_payload by concatenating :

#

The timestamp (as a string)
The character .
The actual JSON payload (that is, the request body)

chrome knoll
#

Why do you need to verify signatures manually?

steady hornet
#

It will be done in apigee layer which is receiving the event. but it is failing there.

#

when I check logs , I try to recreate it manually and it still doesnot work

#

what is the way of verifying the signature?

steady hornet
#

okay, but can you please tell me why it is not working with manual approach?

chrome knoll
#

I am not familiar with this approach. I can dive into it, if the recommended approach doesn't work for you.

steady hornet
#

I doubt in apigee we can import any external libraries,. it has very limited support

#

it will be great if you can help me with manual approach

#

can someone else help me with manual approach

#

hello

#

@chrome knoll are you there

steady hornet
#

can someone help

young sandalBOT
tight sorrel
#

Hi looks like this was dropped. Our apologies

#

Taking over here

#

What is your question?

steady hornet
#

hi

#

I want to know how to manually check the hmac signature

tight sorrel
#

What do you mean

#

Need more info

steady hornet
#

I am receiving stripe data using a webhook. I am doing a hmac verification . for that I am creating payload like this :

#

"1701436772".{ "id": "evt_1OILG0Fnpfya5sMz9zQg2cOG", "object": "event", "api_version": "2022-11-15", "created": 1701393064, "data": { "object": { "id": "po_1OIL8vFnpfya5sMzufFyJI4h", "object": "payout", "amount": 124529, "arrival_date": 1701388800, "automatic": true, "balance_transaction": "txn_1OIL8vFnpfya5sMzbnEhExxE", "created": 1701392625, "currency": "eur", "description": "STRIPE PAYOUT", "destination": "ba_1OFZswFnpfya5sMzwY78UQyG", "failure_balance_transaction": null, "failure_code": null, "failure_message": null, "livemode": false, "metadata": { }, "method": "standard", "original_payout": null, "reconciliation_status": "in_progress", "reversed_by": null, "source_type": "card", "statement_descriptor": null, "status": "in_transit", "type": "bank_account" } }, "livemode": false, "pending_webhooks": 1, "request": { "id": null, "idempotency_key": null }, "type": "payout.created" }

#

following this documentation :
Step 2: Prepare the
signed_payload
string
The signed_payload string is created by concatenating:

The timestamp (as a string)
The character .
The actual JSON payload (that is, the request body)

#

but the signature is not same hence failing this authentication

tight sorrel
#

Wait why are you doing this yourself and not using one of our client libraries?

steady hornet
#

apigee is not supporting these libraries

#

this is our integration layer where this operation is happening