Class: PagSeguro::TransactionRefund
- Inherits:
-
Object
- Object
- PagSeguro::TransactionRefund
- Includes:
- Extensions::MassAssignment
- Defined in:
- lib/pagseguro/transaction_refund.rb,
lib/pagseguro/transaction_refund/response.rb,
lib/pagseguro/transaction_refund/request_serializer.rb,
lib/pagseguro/transaction_refund/response_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response, ResponseSerializer
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
PagSeguro::Errors object.
-
#result ⇒ Object
Result from request.
-
#transaction_code ⇒ Object
Set the transaction code.
-
#value ⇒ Object
Set the refund value.
Instance Method Summary collapse
-
#register ⇒ Object
Calls the PagSeguro webservice and register the refund.
- #update_attributes(attrs) ⇒ Object
Methods included from Extensions::MassAssignment
Instance Attribute Details
#errors ⇒ Object (readonly)
PagSeguro::Errors object.
18 19 20 |
# File 'lib/pagseguro/transaction_refund.rb', line 18 def errors @errors end |
#result ⇒ Object
Result from request.
15 16 17 |
# File 'lib/pagseguro/transaction_refund.rb', line 15 def result @result end |
#transaction_code ⇒ Object
Set the transaction code. The transaction status must be: Paga (3), DisponÃvel (4), Em disputa (5)
7 8 9 |
# File 'lib/pagseguro/transaction_refund.rb', line 7 def transaction_code @transaction_code end |
#value ⇒ Object
Set the refund value. Greater than 0.00 and less or equal than transaction value. If not informed, PagSeguro will assume the total transaction value.
12 13 14 |
# File 'lib/pagseguro/transaction_refund.rb', line 12 def value @value end |
Instance Method Details
#register ⇒ Object
Calls the PagSeguro webservice and register the refund. Return PagSeguro::TransactionRefund.
22 23 24 25 |
# File 'lib/pagseguro/transaction_refund.rb', line 22 def register response_request = Request.post("transactions/refunds", api_version, params) Response.new(response_request, self).serialize end |
#update_attributes(attrs) ⇒ Object
31 32 33 |
# File 'lib/pagseguro/transaction_refund.rb', line 31 def update_attributes(attrs) attrs.map { |name, value| send("#{name}=", value) } end |