Class: PagSeguro::Installment

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#amountObject

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_brandObject

Set the credit card brand.



6
7
8
# File 'lib/pagseguro/installment.rb', line 6

def card_brand
  @card_brand
end

#interest_freeObject

Set interest free.



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

def interest_free
  @interest_free
end

#quantityObject

Set the installments quantity.



9
10
11
# File 'lib/pagseguro/installment.rb', line 9

def quantity
  @quantity
end

#total_amountObject

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, options = {})
  request = Request.get("installments", api_version, options.merge(params(amount: amount, card_brand: card_brand)))
  collection = Collection.new
  Response.new(request, collection).serialize

  collection
end