Class: Moip::Payment
- Includes:
- HTTParty, Header
- Defined in:
- lib/moip/models/payment.rb
Instance Attribute Summary collapse
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#customer_code ⇒ Object
Returns the value of attribute customer_code.
-
#id ⇒ Object
Returns the value of attribute id.
-
#invoice ⇒ Object
Returns the value of attribute invoice.
-
#moip_id ⇒ Object
Returns the value of attribute moip_id.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subscription_code ⇒ Object
Returns the value of attribute subscription_code.
Instance Method Summary collapse
Methods included from Header
#auth, #base_url, #default_header
Methods inherited from Model
build, #set_parameters, #to_json, #validate_response
Instance Attribute Details
#creation_date ⇒ Object
Returns the value of attribute creation_date.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def creation_date @creation_date end |
#customer_code ⇒ Object
Returns the value of attribute customer_code.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def customer_code @customer_code end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def id @id end |
#invoice ⇒ Object
Returns the value of attribute invoice.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def invoice @invoice end |
#moip_id ⇒ Object
Returns the value of attribute moip_id.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def moip_id @moip_id end |
#payment_method ⇒ Object
Returns the value of attribute payment_method.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def payment_method @payment_method end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def status @status end |
#subscription_code ⇒ Object
Returns the value of attribute subscription_code.
5 6 7 |
# File 'lib/moip/models/payment.rb', line 5 def subscription_code @subscription_code end |
Instance Method Details
#attributes ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/moip/models/payment.rb', line 9 def attributes { "id" => id, "moip_id" => moip_id, "status" => status, "subscription_code" => subscription_code, "customer_code" => customer_code, "invoice" => invoice, "payment_method" => payment_method, "creation_date" => creation_date } end |
#find ⇒ Object
41 42 43 44 |
# File 'lib/moip/models/payment.rb', line 41 def find response = self.class.get(base_url(:payments, :code => self.id), default_header).parsed_response self.set_parameters response unless response.nil? end |
#load ⇒ Object
36 37 38 39 |
# File 'lib/moip/models/payment.rb', line 36 def load list = self.class.get(base_url(:invoices, :code => self.invoice, :status => "payments"), default_header).parsed_response self.payments = list["payments"] end |
#payments ⇒ Object
32 33 34 |
# File 'lib/moip/models/payment.rb', line 32 def payments @payments ||= self.payments = self.load end |