#j-webhook-signature

1 messages ยท Page 1 of 1 (latest)

next sundialBOT
smoky chasm
#

Hi ๐Ÿ‘‹

restive parrot
#

Hello!

smoky chasm
#

Which event are you listening to?

#

And can you log the event object?

restive parrot
smoky chasm
#

We can see that this is only set if the network is stripe

#

Set if network is stripe and the source flow is visible to the user

restive parrot
smoky chasm
#

What do you mean by that?

restive parrot
#

compared to what would happen on a live event trigger compared to a test local environment trigger

#

because on our live environment its not null when a user pays via payment link

smoky chasm
#

Do you have an example Received Credt object ID I can look at?

#

Where the source_flow is not null?

restive parrot
#

yeah one moment

#

this is how it looks when running on our dev environment and a payment is received via a payment link, here source_flow is populated. Is that just a payment link thing?

{'id': 'rc_1NgDrb4Ja87CD0ut5MyNXr3z', 'object': 'treasury.received_credit', 'amount': 9680, 'created': 1692308179, 'currency': 'usd', 'description': 'payment', 'failure_code': None, 'financial_account': 'fa_1MgHIK4Ja87CD0utuoXXAd79', 'hosted_regulatory_receipt_url': 'https://payments.stripe.com/regulatory-receipt/CBQaFwoVYWNjdF8xTWRmbTY0SmE4N0NEMHV0KNSl-qYGMgZe3Klavnc6NZMPNhRgiTcJt5pfMNSLsJiTq1Bqz_BTUI6vRC9ie9wGYmnfIEUCEtDAm-WMcqdGI9Ll308B', 'initiating_payment_method_details': {'billing_details': {'address': {'city': None, 'country': None, 'line1': None, 'line2': None, 'postal_code': None, 'state': None}, 'email': None, 'name': None}, 'financial_account': {'id': 'fa_1KGyEuKmW9tOWppXARzm8eeP', 'network': 'stripe'}, 'type': 'financial_account'}, 'linked_flows': {'credit_reversal': None, 'issuing_authorization': None, 'issuing_transaction': None, 'source_flow': 'obp_1NgDrXKmW9tOWppXuwei9UC8', 'source_flow_type': 'outbound_payment'}, 'livemode': False, 'network': 'stripe', 'reversal_details': {'deadline': None, 'restricted_reason': None}, 'status': 'succeeded', 'transaction': 'trxn_1NgDrb4Ja87CD0utBHpLNsAn'}
smoky chasm
#

Just the ID is fine

restive parrot
#

we can retrieve an outbound payment with that using stripe.treasury.OutboundPayment.retrieve(ob['id')

smoky chasm
#

No, in this case it is because the network is stripe

#

Which is what our docs say

#

source_flow will be null if the network ins not stripe or the source flow object is not one you can access from the API

#

In your test code you are setting the network to ach

restive parrot
#

i see! I got it now! So one more questions lets say the user did receive credit via ach or something out of stripe network is there's no way to retrieve the outbound payment with stripe.treasury.OutboundPayment.retrieve()? You just have to handle the data you get from the response?

smoky chasm
#

That is correct AFAIk.

restive parrot
#

sorry what's AFAIk ๐Ÿ˜ญ ?

#

and my last question would be if its off stripe network would it then not come with a Stripe signature and would cause this error?

stripe.error.SignatureVerificationError: No signatures 
found matching the expected signature for payload    
smoky chasm
#

As Far As I Know

#

And all webhook events come with Stripe signatures

restive parrot
smoky chasm
restive parrot
#

thank you!

smoky chasm
#

Yeah that is where it will fail if the signature verification process does not match

next sundialBOT