Class: PagSeguro::PaymentMethod
- Inherits:
-
Object
- Object
- PagSeguro::PaymentMethod
- Includes:
- Extensions::MassAssignment
- Defined in:
- lib/pagseguro/payment_method.rb
Constant Summary collapse
- TYPES =
{ "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.
16 17 18 |
# File 'lib/pagseguro/payment_method.rb', line 16 def code @code end |
#type_id ⇒ Object
The payment method type.
19 20 21 |
# File 'lib/pagseguro/payment_method.rb', line 19 def type_id @type_id end |
Instance Method Details
#description ⇒ Object
Return the payment method’s description.
34 35 36 |
# File 'lib/pagseguro/payment_method.rb', line 34 def description I18n.t(code, scope: "pagseguro.payment_methods") end |
#type ⇒ Object
Return the type in a readable manner.
29 30 31 |
# File 'lib/pagseguro/payment_method.rb', line 29 def type TYPES.fetch(type_id.to_s) { raise "PagSeguro::PaymentMethod#type_id isn't mapped" } end |