Sha256: bb60bce935bc47bcdbbdadd3c806a3e6da4603d09aa40b3c92a7bc3e07a129b9

Contents?: true

Size: 932 Bytes

Versions: 21

Compression:

Stored size: 932 Bytes

Contents

module Conekta
  class Customer < Resource
    include Conekta::Operations::Find
    include Conekta::Operations::Where
    include Conekta::Operations::Create
    include Conekta::Operations::Delete
    include Conekta::Operations::Update
    include Conekta::Operations::CustomAction
    include Conekta::Operations::CreateMember
    def load_from(response=nil)
      if response
        super
      end
      customer = self
      self.cards.each do |k,v|
        if !v.respond_to? :deleted or !v.deleted
          v.create_attr('customer', customer)
          self.cards.set_val(k,v)
        end
      end
      if self.respond_to? :subscription and self.subscription
         self.subscription.create_attr('customer', customer)
      end
    end
    def create_card(params)
      self.create_member('cards', params)
    end
    def create_subscription(params)
      self.create_member('subscription', params)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
conekta-1.0.0 lib/conekta/customer.rb
conekta-0.5.8 lib/conekta/customer.rb
conekta-0.5.7 lib/conekta/customer.rb
conekta-0.5.6 lib/conekta/customer.rb
conekta-0.5.5 lib/conekta/customer.rb
conekta-0.5.4 lib/conekta/customer.rb
conekta-0.5.3 lib/conekta/customer.rb
conekta-0.5.2 lib/conekta/customer.rb
conekta-0.5.1 lib/conekta/customer.rb
conekta-0.4.8 lib/conekta/customer.rb
conekta-0.4.7 lib/conekta/customer.rb
conekta-0.4.6 lib/conekta/customer.rb
conekta-0.4.5 lib/conekta/customer.rb
conekta-0.4.4 lib/conekta/customer.rb
conekta-0.4.3 lib/conekta/customer.rb
conekta-0.4.2 lib/conekta/customer.rb
conekta-0.4.1 lib/conekta/customer.rb
conekta-0.4.0 lib/conekta/customer.rb
conekta-0.3.7 lib/conekta/customer.rb
conekta-0.3.6 lib/conekta/customer.rb