#anna_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272509250467401808
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! what does your exact code look like?
hi!
Webhook.Signature.verifyHeader(callback, signature, secret, 0L)
in production app:
@PostMapping(value = ["/deposit/stripe/callback"])
internal fun handleCallback(
@RequestHeader("stripe-signature") stripeSignature: String,
@RequestBody body: String
): ResponseEntity<Void> {
log.info("Received POST /deposit/stripe/callback request")
log.trace(body)
stripeDepositFacade.handleCallback(stripeSignature, body)
we are using spring controller there
and then Webhook.Signature.verifyHeader(body, stripeSignature, endpointSecret, 1000L)
can you trigger some events and log exact values of body stripeSignature and share the exact raw output of the logs?
sure
body from logs
{
"id": "evt_3Pl8RUE3bUONX0TG0cPRRs7y",
"object": "event",
"api_version": "2024-06-20",
"created": 1723031670,
"data": {
"object": {
"id": "pi_3Pl8RUE3bUONX0TG0gHaeLsj",
"object": "payment_intent",
"amount": 5000,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 5000,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always",
"enabled": true
},
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "pi_3Pl8RUE3bUONX0TG0gHaeLsj_secret_uZ5s94OC7MnNcrDUiBACkFEdj",
"confirmation_method": "automatic",
"created": 1723031652,
"currency": "usd",
"customer": "cus_QcNBATLHKMHoyh",
"description": "50.00 USD -\u003E 50.00 USD",
"invoice": null,
"last_payment_error": null,
"latest_charge": "ch_3Pl8RUE3bUONX0TG05fPEj2Y",
"livemode": true,
"metadata": {
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1Pl8RlE3bUONX0TG3OPCkg7l",
"payment_method_configuration_details": {
"id": "pmc_1PH6HiE3bUONX0TGZUTbjQW9",
"parent": null
},
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
},
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"card",
"link"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": true,
"pending_webhooks": 1,
"request": {
"id": "req_O6UQilwyaTf1ov",
"idempotency_key": "91570d96-a869-4bc0-84f3-79bf2599e07a"
},
"type": "payment_intent.succeeded"
}
and signature: t=1723460828,v1=a2b6f03fed12b5093cc30bcbaa06c83f231db0f24647bea903b976e5a7f192fe
this "description": "50.00 USD -\u003E 50.00 USD" is potentially an issue, but let's come back to that in a second.
what is the last 4 characters of the string endpointSecret when you log that as well?
it's Hrep
I also thaught that the description could be the issue, but tried with body copied from dashboard, copierd from logs, but with this description changes and no success
if you do a test with a new testmode PaymentIntent and leave the description blank or just to something without this -> character, does the resulting event work?
hmm, and how can I create such test event? can I do this from stripe dashboard?
you seem to have an existing testmode setup with your Java backend and a frontend payment page, can you use that and just edit your backend code that creates the PaymentIntent to set a different description ?
ortherwise you can install/use stripe-cli and do stripe trigger payment_intent.payment_succeeded , too.
oh, thx, will check