Class: Spree::Gateway::BraintreeVzeroBase::BraintreeUser
- Inherits:
-
Object
- Object
- Spree::Gateway::BraintreeVzeroBase::BraintreeUser
- Defined in:
- app/models/spree/gateway/braintree_vzero_base/braintree_user.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#spree_user ⇒ Object
readonly
Returns the value of attribute spree_user.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#utils ⇒ Object
readonly
Returns the value of attribute utils.
Instance Method Summary collapse
-
#initialize(provider, spree_user, order) ⇒ BraintreeUser
constructor
A new instance of BraintreeUser.
- #register_user ⇒ Object
Constructor Details
#initialize(provider, spree_user, order) ⇒ BraintreeUser
Returns a new instance of BraintreeUser.
9 10 11 12 13 14 15 16 17 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 9 def initialize(provider, spree_user, order) @utils = Utils.new(provider, order) @spree_user = spree_user @request = provider::Customer begin @user = @request.find(spree_user.try(:id)) rescue end end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 5 def request @request end |
#spree_user ⇒ Object (readonly)
Returns the value of attribute spree_user.
5 6 7 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 5 def spree_user @spree_user end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 5 def user @user end |
#utils ⇒ Object (readonly)
Returns the value of attribute utils.
5 6 7 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 5 def utils @utils end |
Instance Method Details
#register_user ⇒ Object
19 20 21 |
# File 'app/models/spree/gateway/braintree_vzero_base/braintree_user.rb', line 19 def register_user @request.create(@utils.customer_data(spree_user)) end |