Class: PagSeguro::SubscriptionTransaction

Inherits:
Object
  • Object
show all
Includes:
Extensions::MassAssignment
Defined in:
lib/pagseguro/subscription_transaction.rb

Constant Summary collapse

STATUSES =
{
  waiting_payment: 1,
  in_review: 2,
  paid: 3,
  available: 4,
  in_dispute: 5,
  returned: 6,
  canceled: 7,
  charged: 8,
  temporary_retention: 9
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#codeObject

Returns the value of attribute code.



17
18
19
# File 'lib/pagseguro/subscription_transaction.rb', line 17

def code
  @code
end

#dateObject

Returns the value of attribute date.



19
20
21
# File 'lib/pagseguro/subscription_transaction.rb', line 19

def date
  @date
end

#statusObject

Returns the value of attribute status.



18
19
20
# File 'lib/pagseguro/subscription_transaction.rb', line 18

def status
  @status
end

Instance Method Details

#==(object) ⇒ Object



25
26
27
# File 'lib/pagseguro/subscription_transaction.rb', line 25

def ==(object)
  [code, status, date] == [object.code, object.status, object.date]
end

#status_codeObject



21
22
23
# File 'lib/pagseguro/subscription_transaction.rb', line 21

def status_code
  STATUSES[status.to_sym]
end