Class: PagSeguro::TransactionCancellation

Inherits:
Object
  • Object
show all
Includes:
Extensions::MassAssignment
Defined in:
lib/pagseguro/transaction_cancellation.rb,
lib/pagseguro/transaction_cancellation/response.rb,
lib/pagseguro/transaction_cancellation/request_serializer.rb,
lib/pagseguro/transaction_cancellation/response_serializer.rb

Defined Under Namespace

Classes: RequestSerializer, Response, ResponseSerializer

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#resultObject

Result from http request.



10
11
12
# File 'lib/pagseguro/transaction_cancellation.rb', line 10

def result
  @result
end

#transaction_codeObject

Set the transaction code. The transaction status must be: Aguardando pagamento or Em anĂ¡lise.



7
8
9
# File 'lib/pagseguro/transaction_cancellation.rb', line 7

def transaction_code
  @transaction_code
end

Instance Method Details

#errorsObject

Errors object.



20
21
22
# File 'lib/pagseguro/transaction_cancellation.rb', line 20

def errors
  @errors ||= Errors.new
end

#registerObject

Calls the PagSeguro webservice and register the cancellation. Returns PagSeguro::TransactionCancellation.



14
15
16
17
# File 'lib/pagseguro/transaction_cancellation.rb', line 14

def register
  response_request = Request.post("transactions/cancels", api_version, params)
  Response.new(response_request, self).serialize
end

#update_attributes(attrs) ⇒ Object



24
25
26
# File 'lib/pagseguro/transaction_cancellation.rb', line 24

def update_attributes(attrs)
  attrs.each { |name, value| send("#{name}=", value) }
end