Class: PagSeguro::PaymentRequest
- Inherits:
-
Object
- Object
- PagSeguro::PaymentRequest
- Defined in:
- lib/pagseguro/payment_request.rb,
lib/pagseguro/payment_request/response.rb,
lib/pagseguro/payment_request/request_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response
Instance Attribute Summary collapse
-
#abandon_url ⇒ Object
Determines for which url PagSeguro will send the buyer when he doesn’t complete the payment.
-
#currency ⇒ Object
Set the payment currency.
-
#extra_amount ⇒ Object
Set the extra amount to be applied to the transaction’s total.
-
#extra_params ⇒ Object
The extra parameters for payment request.
-
#max_age ⇒ Object
Set the payment request duration, in seconds.
-
#max_uses ⇒ Object
How many times the payment redirect uri returned by the payment web service can be accessed.
-
#notification_url ⇒ Object
Determines for which url PagSeguro will send the order related notifications codes.
-
#primary_receiver ⇒ Object
Set and get primary receiver email.
-
#receivers ⇒ Object
Get the payment receivers.
-
#redirect_url ⇒ Object
Set the redirect url.
-
#reference ⇒ Object
Set the reference code.
-
#sender ⇒ Object
Get the payment sender.
-
#shipping ⇒ Object
Get the shipping info.
Attributes included from Extensions::Credentiable
Instance Method Summary collapse
-
#items ⇒ Object
Products/items in this payment request.
-
#register ⇒ Object
Calls the PagSeguro web service and register this request for payment.
Methods included from Extensions::EnsureType
Methods included from Extensions::MassAssignment
Instance Attribute Details
#abandon_url ⇒ Object
Determines for which url PagSeguro will send the buyer when he doesn’t complete the payment.
59 60 61 |
# File 'lib/pagseguro/payment_request.rb', line 59 def abandon_url @abandon_url end |
#currency ⇒ Object
Set the payment currency. Defaults to BRL.
9 10 11 |
# File 'lib/pagseguro/payment_request.rb', line 9 def currency @currency end |
#extra_amount ⇒ Object
Set the extra amount to be applied to the transaction’s total. This value can be used to add an extra charge to the transaction or provide a discount, if negative.
32 33 34 |
# File 'lib/pagseguro/payment_request.rb', line 32 def extra_amount @extra_amount end |
#extra_params ⇒ Object
The extra parameters for payment request
62 63 64 |
# File 'lib/pagseguro/payment_request.rb', line 62 def extra_params @extra_params end |
#max_age ⇒ Object
Set the payment request duration, in seconds.
41 42 43 |
# File 'lib/pagseguro/payment_request.rb', line 41 def max_age @max_age end |
#max_uses ⇒ Object
How many times the payment redirect uri returned by the payment web service can be accessed. Optional. After this payment request is submitted, the payment redirect uri returned by the payment web service will remain valid for the number of uses specified here.
48 49 50 |
# File 'lib/pagseguro/payment_request.rb', line 48 def max_uses @max_uses end |
#notification_url ⇒ Object
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.
55 56 57 |
# File 'lib/pagseguro/payment_request.rb', line 55 def notification_url @notification_url end |
#primary_receiver ⇒ Object
Set and get primary receiver email.
15 16 17 |
# File 'lib/pagseguro/payment_request.rb', line 15 def primary_receiver @primary_receiver end |
#receivers ⇒ Object
Get the payment receivers.
18 19 20 |
# File 'lib/pagseguro/payment_request.rb', line 18 def receivers @receivers end |
#redirect_url ⇒ Object
Set the redirect url. The URL that will be used by PagSeguro to redirect the user after the payment information is processed. Typically this is a confirmation page on your web site.
27 28 29 |
# File 'lib/pagseguro/payment_request.rb', line 27 def redirect_url @redirect_url end |
#reference ⇒ Object
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.
38 39 40 |
# File 'lib/pagseguro/payment_request.rb', line 38 def reference @reference end |
#sender ⇒ Object
Get the payment sender.
12 13 14 |
# File 'lib/pagseguro/payment_request.rb', line 12 def sender @sender end |
#shipping ⇒ Object
Get the shipping info.
21 22 23 |
# File 'lib/pagseguro/payment_request.rb', line 21 def shipping @shipping end |
Instance Method Details
#items ⇒ Object
Products/items in this payment request.
65 66 67 |
# File 'lib/pagseguro/payment_request.rb', line 65 def items @items ||= Items.new end |
#register ⇒ Object
Calls the PagSeguro web service and register this request for payment.
87 88 89 90 91 92 93 94 95 |
# File 'lib/pagseguro/payment_request.rb', line 87 def register request = if @receivers.empty? Request.post('checkout', api_version, params) else Request.post_xml('checkouts', api_version, credentials, xml_params) end Response.new(request) end |