Class: PagSeguro::PaymentMethod
- Inherits:
-
Object
- Object
- PagSeguro::PaymentMethod
- Includes:
- Extensions::MassAssignment
- Defined in:
- lib/pagseguro/payment_method.rb
Constant Summary collapse
- TYPES =
{ "" => :not_set, "1" => :credit_card, "2" => :boleto, "3" => :online_transfer, "4" => :balance, "5" => :oi_paggo, "7" => :direct_deposit }.freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
The payment method code.
-
#type_id ⇒ Object
The payment method type.
Instance Method Summary collapse
-
#description ⇒ Object
Return the payment method’s description.
-
#type ⇒ Object
Return the type in a readable manner.
Methods included from Extensions::MassAssignment
Instance Attribute Details
#code ⇒ Object
The payment method code.
17 18 19 |
# File 'lib/pagseguro/payment_method.rb', line 17 def code @code end |
#type_id ⇒ Object
The payment method type.
20 21 22 |
# File 'lib/pagseguro/payment_method.rb', line 20 def type_id @type_id end |
Instance Method Details
#description ⇒ Object
Return the payment method’s description.
35 36 37 |
# File 'lib/pagseguro/payment_method.rb', line 35 def description I18n.t(code, scope: "pagseguro.payment_methods") end |
#type ⇒ Object
Return the type in a readable manner.
30 31 32 |
# File 'lib/pagseguro/payment_method.rb', line 30 def type TYPES.fetch(type_id.to_s) { raise "PagSeguro::PaymentMethod#type_id isn't mapped" } end |