1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-18 20:59:39 +02:00
Maybe/app/models/provider/stripe/customer_event_processor.rb
Zach Gollwitzer a51c4d2cba
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions
New onboarding, trials, Stripe integration (#2185)
* New onboarding, trials, Stripe integration

* Fix tests

* Lint fixes

* Fix subscription endpoints
2025-05-01 16:47:14 -04:00

20 lines
432 B
Ruby

class Provider::Stripe::CustomerEventProcessor < Provider::Stripe::EventProcessor
Error = Class.new(StandardError)
def process
raise Error, "Family not found for Stripe customer ID: #{customer_id}" unless family
family.update(
stripe_customer_id: customer_id
)
end
private
def family
Family.find_by(stripe_customer_id: customer_id)
end
def customer_id
event_data.id
end
end