Module: Oauth::StripeAccounts::Base

Extended by:
ActiveSupport::Concern
Included in:
Oauth::StripeAccount
Defined in:
app/models/concerns/oauth/stripe_accounts/base.rb

Instance Method Summary collapse

Instance Method Details

#label_stringObject



25
26
27
# File 'app/models/concerns/oauth/stripe_accounts/base.rb', line 25

def label_string
  name
end

#nameObject

TODO You should update this with an implementation appropriate for the provider you’re integrating with. This must return something, otherwise new installations won’t save.



31
32
33
34
35
# File 'app/models/concerns/oauth/stripe_accounts/base.rb', line 31

def name
  data.dig("info", "name").presence || "Stripe Account"
rescue
  "Stripe Account"
end

#name_wasObject



37
38
39
# File 'app/models/concerns/oauth/stripe_accounts/base.rb', line 37

def name_was
  name
end

#update_from_oauth(auth) ⇒ Object



41
42
43
44
45
# File 'app/models/concerns/oauth/stripe_accounts/base.rb', line 41

def update_from_oauth(auth)
  self.uid = auth.uid
  self.data = auth
  save
end