class PagSeguro::Payment

Attributes

bank[RW]

Set the bank name. Optional. Bank name should be used for eft payment method to specify which the buyer should be redirect.

credit_card[RW]

Get the payment sender.

currency[RW]

Set the payment currency. Defaults to BRL.

extra_amount[RW]
max_installment_no_interest[RW]

Set the max installment with no interest. Optional.

notification_url[RW]

Determines for which url PagSeguro will send the order related notifications codes. Optional. Any change happens in the transaction status, a new notification request will be send to this url. You can use that for update the related order.

payment_method[RW]

Set the payment method. Payment method should be creditCard, boleto or eft.

payment_mode[RW]

Set the payment mode

receiver_email[RW]
reference[RW]

Set the reference code. Optional. You can use the reference code to store an identifier so you can associate the PagSeguro transaction to a transaction in your system. Tipically this is the order id.

sender[RW]

Get the payment sender.

shipping[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/pagseguro/payment.rb, line 72
def initialize(options = {})
  @currency = "BRL"
  @payment_mode = 'default'
  @notification_url = options[:notification_url]
  @payment_method = options[:payment_method]
  @reference = options[:reference] if options[:reference]
  @extra_amount = options[:extra_amount] if options[:extra_amount]
  @receiver_email = options[:receiver_email] if options[:receiver_email]
end

Public Instance Methods

items() click to toggle source

Products/items in this payment request.

# File lib/pagseguro/payment.rb, line 57
def items
  @items ||= Items.new
end
items=(_items) click to toggle source

Normalize the items list.

# File lib/pagseguro/payment.rb, line 62
def items=(_items)
  _items.each {|item| items << item }
end
transaction(account = nil) click to toggle source

Calls the PagSeguro web service and register this request for payment.

# File lib/pagseguro/payment.rb, line 67
def transaction(account = nil)
  params = Serializer.new(self).to_params
  PagSeguro::Transaction.new post('/transactions', API_V2 ,account, params).parsed_response
end

Private Instance Methods

paid_with_card?() click to toggle source
paid_with_eft?() click to toggle source