paygate
paygate copied to clipboard
inbound: webhooks on NOC files
PayGate Version: v0.8.0
What were you trying to do? When PayGate processes an inbound file which has NOC batches there should be a way to notify an external application. This allows extensibility of what PayGate can offer right now.
What did you expect to see? Offer a webhook for notifying an external application.
I can see us offering a file config where we can specify targets to notify. ~~The payload would be an ACH file's JSON representation.~~ The payload would be a URI to download the file. PayGate would retry sending this until an 200 OK
is returned by the receiving service.
inbound:
interval: <duration> # moved from odfi.inbound
webhooks:
notificationOfChange:
- target: <address>
authToken: <secret>
[ insecure: <boolean> ]
Would an admin endpoint for registering a webhook be useful? I can see us supporting something like this:
$ curl -X POST http://paygate:9092/webhooks
{
"type": "inbound",
"target": "<address>",
"authToken": "<secret>",
"insecure": false
}
// responds with
{
"webhookID": "<string>"
}
// offer deletion / disablement
$ curl -X DELETE http://paygate:8082/webhooks/$webhookID
David Z in slack mentioned webhooks having a URL to the file rather than shipping the JSON body. This would require endpoints to list/retrieve downloaded files.
Webhook body
{
"fileURL": "https://paygate:9092/inbound/<filepath>"
}
https
vs http
would be determined by the bind file configs. -- https://github.com/moov-io/paygate/blob/master/docs/config.md#http
Edit: That fileURL
could be determined by the odfi.storage
value as well to reference an ftps://
or gcs://
URI instead of serving the files from PayGate.