Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

Stripe connect managed accounts

Rails • Asked by josh edgar

I'm trying to add webhooks to stripe using stripe connect and managed accounts

I'm using the stripe_events plugin and have followed your stripe webhooks video. I nearly have it working but I have to add an "account" attribute somewhere?!?! I've been looking at the screen to long. Can you please help!


Stripe.api_key = Rails.configuration.stripe[:secret_key]

class RecordAccount
    def call(event)
        event =
        account = event.account

        #Look up StripeAccount in our database
        stripe_account = StripeAccount.where(stripe_id: account).last

        #Record Verification details, status in StripeAccount
        u = stripe_account.update_attributes(verification_status: event.legal_entity.verification.status, verification_details: event.legal_entity.verification.details)


StripeEvent.configure do |events|
  events.subscribe 'account.updated',

Ended up removing the stripe_event gem and set up webhooks manually. Was very easy...

created a webhooks_controller.rb and new post route

            payload = JSON.parse(
            # Verify the event by fetching it from Stripe
            if payload['account'].present?

              # This is for connected accounts
              event = Stripe::Event.retrieve(payload['id'], stripe_account: payload['account'])
              @stripe_object =
              @stripe_account_update = StripeAccount.where(stripe_id: payload['account']).first!

                    # update verification status etc in db
              u = @stripe_account_update.update_attributes(
                    verification_status: @stripe_object.legal_entity.verification.status, 
                    verification_details: @stripe_object.verification.fields_needed

              # Normal events not using stripe_event

            rescue Stripe::StripeError => e
            # Handle this however you prefer

Only thing I need to figure out is how to read the event type "account_created", "account_updated" etc. Haven't looked into it yet. But I'm sure there's nothing to it.

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.