Sha256: 73412cfea53589a9d8825ce7459ba8762bbb13b5eecbe9b260e7299493323d38

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

module Spree
  class Gateway
    class BraintreeVzeroBase
      class BraintreeUser
        attr_reader :user, :spree_user, :request, :utils

        delegate :shipping_address, :billing_address, to: :spree_user

        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

        def register_user
          @request.create(@utils.customer_data(spree_user))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_braintree_vzero-3.6.0 app/models/spree/gateway/braintree_vzero_base/braintree_user.rb
spree_braintree_vzero-3.5.1 app/models/spree/gateway/braintree_vzero_base/braintree_user.rb