Class: PagSeguro::SubscriptionPaymentOrder
- Inherits:
-
Object
- Object
- PagSeguro::SubscriptionPaymentOrder
- Includes:
- Extensions::EnsureType, Extensions::MassAssignment
- Defined in:
- lib/pagseguro/subscription_payment_order.rb,
lib/pagseguro/subscription_payment_order/response.rb,
lib/pagseguro/subscription_payment_order/response_serializer.rb
Defined Under Namespace
Classes: Response, ResponseSerializer
Constant Summary collapse
- STATUSES =
{ scheduled: 1, processing: 2, not_processed: 3, suspended: 4, paid: 5, not_paid: 6 }
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#code ⇒ Object
Returns the value of attribute code.
-
#discount ⇒ Object
Returns the value of attribute discount.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#gross_amount ⇒ Object
Returns the value of attribute gross_amount.
-
#last_event_date ⇒ Object
Returns the value of attribute last_event_date.
-
#scheduling_date ⇒ Object
Returns the value of attribute scheduling_date.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #status_code ⇒ Object
- #transactions ⇒ Object
- #transactions=(attrs) ⇒ Object
- #update_attributes(attrs) ⇒ Object
Methods included from Extensions::EnsureType
Methods included from Extensions::MassAssignment
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
19 20 21 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 19 def amount @amount end |
#code ⇒ Object
Returns the value of attribute code.
17 18 19 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 17 def code @code end |
#discount ⇒ Object
Returns the value of attribute discount.
23 24 25 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 23 def discount @discount end |
#errors ⇒ Object
Returns the value of attribute errors.
15 16 17 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 15 def errors @errors end |
#gross_amount ⇒ Object
Returns the value of attribute gross_amount.
20 21 22 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 20 def gross_amount @gross_amount end |
#last_event_date ⇒ Object
Returns the value of attribute last_event_date.
21 22 23 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 21 def last_event_date @last_event_date end |
#scheduling_date ⇒ Object
Returns the value of attribute scheduling_date.
22 23 24 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 22 def scheduling_date @scheduling_date end |
#status ⇒ Object
Returns the value of attribute status.
18 19 20 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 18 def status @status end |
Class Method Details
.load_from_xml(xml) ⇒ Object
47 48 49 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 47 def self.load_from_xml(xml) new ResponseSerializer.new(xml).serialize end |
Instance Method Details
#status_code ⇒ Object
39 40 41 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 39 def status_code STATUSES[@status.to_sym] end |
#transactions ⇒ Object
29 30 31 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 29 def transactions @transactions ||= SubscriptionTransactions.new end |
#transactions=(attrs) ⇒ Object
33 34 35 36 37 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 33 def transactions=(attrs) attrs.each do |params| transactions << SubscriptionTransaction.new(params) end end |
#update_attributes(attrs) ⇒ Object
43 44 45 |
# File 'lib/pagseguro/subscription_payment_order.rb', line 43 def update_attributes(attrs) attrs.each {|name, value| send("#{name}=", value) } end |