class PagSeguro::Transactions

Constants

STATUSES

Public Instance Methods

find(code) click to toggle source
# File lib/pagseguro/transactions.rb, line 20
def find(code)
  transform get("/v3/transactions/#{code}", nil, xml: :simple)
end
find_by_notification_code(code) click to toggle source
# File lib/pagseguro/transactions.rb, line 24
def find_by_notification_code(code)
  transform get("/v2/transactions/notifications/#{code}", nil, xml: :simple)
end

Private Instance Methods

transform(body) click to toggle source
# File lib/pagseguro/transactions.rb, line 29
def transform(body)
  if body.transaction?
    body.transaction.status = STATUSES[body.transaction.status]
    body.transaction
  elsif body.errors?
    body.errors
  else
    body
  end
end