In the Volt connector for payment webhooks in production, a field is occasionally changing. The payment field sometimes comes as id instead, with the same expected value as payment. Since it’s coming as id rather than payment, the webhook body deserialization is failing, causing a 5xx error. To prevent this, I have added an alias for payment as id.
Additional Changes
[ ] This PR modifies the API contract
[ ] This PR modifies the database schema
[ ] This PR modifies application configuration/environment variables
Check for webhooks in Volt dashboard under transactions.
Then for Notifications check for all webhooks, In All the 4 notifications `PENDING ` , `COMPLETED`, `RECEIVED` and `REFUND_CONFIRMED ` should have status `Delivered` and http code `200 OK`.
<img width="1164" alt="Screenshot 2024-11-14 at 7 17 34 PM" src="https://github.com/user-attachments/assets/b1ab4fa5-efa3-4959-bb70-1e44633307dd">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
Type of Change
Description
handle 5xx error for Volt payments webhooks
In the Volt connector for payment webhooks in production, a field is occasionally changing. The
payment
field sometimes comes asid
instead, with the same expected value aspayment
. Since it’s coming asid
rather thanpayment
, the webhook body deserialization is failing, causing a 5xx error. To prevent this, I have added an alias forpayment
asid
.Additional Changes
Motivation and Context
How did you test it?
Configure webhooks in volt dashboard.
Create a open_banking_uk Payment via Volt
'
curl --location 'http://localhost:8080/refunds' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: {}' \ --data '{ "payment_id": "pay_KvWJlcOapPbt7YzEY08t", "amount": 577, "reason": "Customer returned product", "refund_type": "instant", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }'