Class: PagSeguro::PaymentStatus
- Inherits:
-
Object
- Object
- PagSeguro::PaymentStatus
- Defined in:
- lib/pagseguro/payment_status.rb
Constant Summary collapse
- STATUSES =
{ "0" => :initiated, "1" => :waiting_payment, "2" => :in_analysis, "3" => :paid, "4" => :available, "5" => :in_dispute, "6" => :refunded, "7" => :cancelled, "8" => :chargeback_charged, "9" => :contested }.freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
The payment status id.
Instance Method Summary collapse
-
#initialize(id) ⇒ PaymentStatus
constructor
A new instance of PaymentStatus.
-
#status ⇒ Object
Return a readable status.
Constructor Details
#initialize(id) ⇒ PaymentStatus
Returns a new instance of PaymentStatus.
19 20 21 |
# File 'lib/pagseguro/payment_status.rb', line 19 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
The payment status id.
17 18 19 |
# File 'lib/pagseguro/payment_status.rb', line 17 def id @id end |
Instance Method Details
#status ⇒ Object
Return a readable status.
31 32 33 |
# File 'lib/pagseguro/payment_status.rb', line 31 def status STATUSES.fetch(id.to_s) { raise "PagSeguro::PaymentStatus#id isn't mapped" } end |