Class: Order

Inherits:
Base
  • Object
show all
Defined in:
app/models/order.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Method Summary collapse

Instance Method Details

#authorize(credit_card = {}) ⇒ Object



6
7
8
# File 'app/models/order.rb', line 6

def authorize(credit_card={})
  post(:authorize, :credit_card => credit_card)
end

#captureObject



10
11
12
# File 'app/models/order.rb', line 10

def capture
  post(:capture)
end

#credit(amount, credit_card_number) ⇒ Object



14
15
16
# File 'app/models/order.rb', line 14

def credit(amount, credit_card_number)
  post(:credit, :amount => amount, :credit_card_number => credit_card_number)
end

#itemsObject



2
3
4
# File 'app/models/order.rb', line 2

def items
  OrderItem.find(:all, :from => "/v1/orders/#{self.number}/items.xml")
end

#process_paypal_express(token, payer_id) ⇒ Object



22
23
24
# File 'app/models/order.rb', line 22

def process_paypal_express(token, payer_id)
  post(:process_paypal_express, :params => {:token => token, :payer_id => payer_id})
end

#voidObject



18
19
20
# File 'app/models/order.rb', line 18

def void
  post(:void)
end