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



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

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.



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

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

#name_wasObject



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

def name_was
  name
end

#update_from_oauth(auth) ⇒ Object



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

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