Class: PagSeguro::Installment
- Inherits:
-
Object
- Object
- PagSeguro::Installment
- Includes:
- Extensions::MassAssignment
- Defined in:
- lib/pagseguro/installment.rb,
lib/pagseguro/installment/response.rb,
lib/pagseguro/installment/collection.rb,
lib/pagseguro/installment/request_serializer.rb,
lib/pagseguro/installment/response_serializer.rb
Defined Under Namespace
Classes: Collection, RequestSerializer, Response, ResponseSerializer
Instance Attribute Summary collapse
-
#amount ⇒ Object
Set the amount.
-
#card_brand ⇒ Object
Set the credit card brand.
-
#interest_free ⇒ Object
Set interest free.
-
#quantity ⇒ Object
Set the installments quantity.
-
#total_amount ⇒ Object
Set total amount.
Class Method Summary collapse
-
.find(amount, card_brand, options = {}) ⇒ Object
Return a PagSeguro::Installment::Collection instance.
Methods included from Extensions::MassAssignment
Instance Attribute Details
#amount ⇒ Object
Set the amount. Must fit the patern: \d+.\d2 (e.g. “12.00”)
13 14 15 |
# File 'lib/pagseguro/installment.rb', line 13 def amount @amount end |
#card_brand ⇒ Object
Set the credit card brand.
6 7 8 |
# File 'lib/pagseguro/installment.rb', line 6 def card_brand @card_brand end |
#interest_free ⇒ Object
Set interest free.
19 20 21 |
# File 'lib/pagseguro/installment.rb', line 19 def interest_free @interest_free end |
#quantity ⇒ Object
Set the installments quantity.
9 10 11 |
# File 'lib/pagseguro/installment.rb', line 9 def quantity @quantity end |
#total_amount ⇒ Object
Set total amount.
16 17 18 |
# File 'lib/pagseguro/installment.rb', line 16 def total_amount @total_amount end |
Class Method Details
.find(amount, card_brand, options = {}) ⇒ Object
Return a PagSeguro::Installment::Collection instance
25 26 27 28 29 30 31 |
# File 'lib/pagseguro/installment.rb', line 25 def self.find(amount, card_brand, = {}) request = Request.get("installments", api_version, .merge(params(amount: amount, card_brand: card_brand))) collection = Collection.new Response.new(request, collection).serialize collection end |