#stripeuser_96421

1 messages · Page 1 of 1 (latest)

terse pondBOT
#

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.

tawny scaffold
#

What's the issue?

candid trench
#

Itried the link which you shared

#

But unfortunately I am not getting a matching signature

#

I am gving the right values of everything and stringfy json everything

#

can youhelp

tawny scaffold
#

Not without an example of the code you're actually using no

candid trench
#

const crypto = require('crypto');

const stripeWebhookSecret = 'stripeWebhookSecret';
const unixtime = '1701693484';

const payload = {"id":"evt_1OJR0QFnpfya5sMzKtYoQpHj","object":"event","api_version":"2022-11-15","created":1701653490,"data":{"object":{"id":"po_1OJQiSFnpfya5sMzbDjZwrof","object":"payout","amount":41764,"arrival_date":1701648000,"automatic":true,"balance_transaction":"txn_1OJQiSFnpfya5sMzfzrgGcIP","created":1701652376,"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"};

const payloadString = JSON.stringify(payload);

const signature = crypto
.createHmac('sha256', stripeWebhookSecret)
.update(${unixtime}.${payloadString}, 'utf8')
.digest('hex');

console.log('Computed Signature:', signature);

#

this is the code except my actual webhook

#

*actual secret

tawny scaffold
#

If you're in Node, why can you not just use stripe-node?

candid trench
#

I was just testing it using node.js

#

I tried stripe-node also but it gave me permission error

tawny scaffold
#

What permission error?

candid trench
#

to install stripe node module I got permission error

tawny scaffold
#

Which error? A system error?

candid trench
#

sorry permission error is gobe . it give me 10 packages are looking for funding

#

Is it okay to proceed?

tawny scaffold
#

I've no idea what you're referring to. In any case, the manual signature verification is a fairly advanced integration path that is not recommended and can be easy to trip up:

  • is your timestamp correct? needs to be an epoch in milliseconds.
  • Are you using the correct signing secret (whsec_xxx)?

Outside of that, I don't really know I'm afraid. We generally recommend using the SDKs which have event signing function built-in, including functions to generate payloads for testing