class PagSeguro::Payment
Attributes
Set the bank name. Optional. Bank
name should be used for eft payment method to specify which the buyer should be redirect.
Get the payment sender.
Set the payment currency. Defaults to BRL.
Set the max installment with no interest. Optional.
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.
Set the payment method. Payment
method should be creditCard, boleto or eft.
Set the payment mode
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.
Get the payment sender.
Public Class Methods
# 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
Products/items in this payment request.
# File lib/pagseguro/payment.rb, line 57 def items @items ||= Items.new end
Normalize the items list.
# File lib/pagseguro/payment.rb, line 62 def items=(_items) _items.each {|item| items << item } end
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
# File lib/pagseguro/payment.rb, line 83 def paid_with_card? payment_method == "creditCard" end
# File lib/pagseguro/payment.rb, line 87 def paid_with_eft? payment_method == "eft" end