Class: PagSeguro::AuthorizationRequest
- Inherits:
-
Object
- Object
- PagSeguro::AuthorizationRequest
- Defined in:
- lib/pagseguro/authorization_request.rb,
lib/pagseguro/authorization_request/response.rb,
lib/pagseguro/authorization_request/request_serializer.rb,
lib/pagseguro/authorization_request/response_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response, ResponseSerializer
Constant Summary collapse
- PERMISSIONS =
{ checkouts: 'CREATE_CHECKOUTS', notifications: 'RECEIVE_TRANSACTION_NOTIFICATIONS', searches: 'SEARCH_TRANSACTIONS', pre_approvals: 'MANAGE_PAYMENT_PRE_APPROVALS', payments: 'DIRECT_PAYMENT', refunds: 'REFUND_TRANSACTIONS', cancels: 'CANCEL_TRANSACTIONS' }
Instance Attribute Summary collapse
-
#account ⇒ Object
The account that can be passed to register suggestion.
-
#code ⇒ Object
readonly
The code used to confirm the authorization.
-
#date ⇒ Object
readonly
The date of authorization creation.
- #errors ⇒ Object
-
#notification_url ⇒ Object
The url which PagSeguro can send notifications.
-
#permissions ⇒ Object
The permissions given to the application Defaults to all permissions.
-
#redirect_url ⇒ Object
The url which the application is going to be redirected after the proccess.
-
#reference ⇒ Object
The seller reference (optional).
Attributes included from Extensions::Credentiable
Instance Method Summary collapse
-
#create ⇒ Object
Post and create an Authorization.
-
#url ⇒ Object
URL to confirm authorization after create one.
Methods included from Extensions::EnsureType
Methods included from Extensions::MassAssignment
Instance Attribute Details
#account ⇒ Object
The account that can be passed to register suggestion
21 22 23 |
# File 'lib/pagseguro/authorization_request.rb', line 21 def account @account end |
#code ⇒ Object
The code used to confirm the authorization
24 25 26 |
# File 'lib/pagseguro/authorization_request.rb', line 24 def code @code end |
#date ⇒ Object
The date of authorization creation
27 28 29 |
# File 'lib/pagseguro/authorization_request.rb', line 27 def date @date end |
#errors ⇒ Object
61 62 63 |
# File 'lib/pagseguro/authorization_request.rb', line 61 def errors @errors ||= Errors.new end |
#notification_url ⇒ Object
The url which PagSeguro can send notifications
15 16 17 |
# File 'lib/pagseguro/authorization_request.rb', line 15 def notification_url @notification_url end |
#permissions ⇒ Object
The permissions given to the application Defaults to all permissions
9 10 11 |
# File 'lib/pagseguro/authorization_request.rb', line 9 def @permissions end |
#redirect_url ⇒ Object
The url which the application is going to be redirected after the proccess
18 19 20 |
# File 'lib/pagseguro/authorization_request.rb', line 18 def redirect_url @redirect_url end |
#reference ⇒ Object
The seller reference (optional)
12 13 14 |
# File 'lib/pagseguro/authorization_request.rb', line 12 def reference @reference end |
Instance Method Details
#create ⇒ Object
Post and create an Authorization. Return Boolean.
48 49 50 51 52 53 54 |
# File 'lib/pagseguro/authorization_request.rb', line 48 def create request = Request.post_xml('authorizations/request', api_version, credentials, xml) response = Response.new(request) update_attributes(response.serialize) response.success? end |