1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Plaid webhook processor

This commit is contained in:
Zach Gollwitzer 2025-05-24 18:33:59 -04:00
parent 5125411822
commit ffc5f844b2
3 changed files with 55 additions and 25 deletions

View file

@ -9,7 +9,8 @@ class WebhooksController < ApplicationController
client = Provider::Registry.plaid_provider_for_region(:us)
client.validate_webhook!(plaid_verification_header, webhook_body)
client.process_webhook(webhook_body)
PlaidItem::WebhookProcessor.new(webhook_body).process
render json: { received: true }, status: :ok
rescue => error
@ -24,7 +25,8 @@ class WebhooksController < ApplicationController
client = Provider::Registry.plaid_provider_for_region(:eu)
client.validate_webhook!(plaid_verification_header, webhook_body)
client.process_webhook(webhook_body)
PlaidItem::WebhookProcessor.new(webhook_body).process
render json: { received: true }, status: :ok
rescue => error