Class: PagSeguro::Authorization
- Inherits:
-
Object
- Object
- PagSeguro::Authorization
- Defined in:
- lib/pagseguro/authorization.rb,
lib/pagseguro/authorization/response.rb,
lib/pagseguro/authorization/collection.rb,
lib/pagseguro/authorization/request_serializer.rb,
lib/pagseguro/authorization/response_serializer.rb
Defined Under Namespace
Classes: Collection, RequestSerializer, Response, ResponseSerializer
Instance Attribute Summary collapse
-
#authorizer_email ⇒ Object
The authorization authorizerEmail.
-
#code ⇒ Object
The authorization code.
-
#created_at ⇒ Object
The authorization creation date.
-
#permissions ⇒ Object
The authorization permissions.
-
#reference ⇒ Object
The reference related to the authorization.
Attributes included from Extensions::Credentiable
Class Method Summary collapse
- .find_by(options) ⇒ Object
-
.find_by_code(code, options = {}) ⇒ Object
Find an authorization by it’s code.
-
.find_by_notification_code(code, options = {}) ⇒ Object
Find an authorization by it’s notification code.
Instance Method Summary collapse
Methods included from Extensions::MassAssignment
Instance Attribute Details
#authorizer_email ⇒ Object
The authorization authorizerEmail
19 20 21 |
# File 'lib/pagseguro/authorization.rb', line 19 def @authorizer_email end |
#code ⇒ Object
The authorization code
7 8 9 |
# File 'lib/pagseguro/authorization.rb', line 7 def code @code end |
#created_at ⇒ Object
The authorization creation date
10 11 12 |
# File 'lib/pagseguro/authorization.rb', line 10 def created_at @created_at end |
#permissions ⇒ Object
The authorization permissions
16 17 18 |
# File 'lib/pagseguro/authorization.rb', line 16 def @permissions end |
#reference ⇒ Object
The reference related to the authorization
13 14 15 |
# File 'lib/pagseguro/authorization.rb', line 13 def reference @reference end |
Class Method Details
.find_by(options) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/pagseguro/authorization.rb', line 39 def self.find_by() request = Request.get("authorizations", api_version, RequestSerializer.new().to_params) collection = Collection.new Response.new(request, collection).serialize_collection collection end |
.find_by_code(code, options = {}) ⇒ Object
Find an authorization by it’s code
31 32 33 34 35 36 37 |
# File 'lib/pagseguro/authorization.rb', line 31 def self.find_by_code(code, = {}) request = Request.get("authorizations/#{code}", api_version, ) = PagSeguro::Authorization.new Response.new(request, ).serialize end |
.find_by_notification_code(code, options = {}) ⇒ Object
Find an authorization by it’s notification code
22 23 24 25 26 27 28 |
# File 'lib/pagseguro/authorization.rb', line 22 def self.find_by_notification_code(code, = {}) request = Request.get("authorizations/notifications/#{code}", api_version, ) = PagSeguro::Authorization.new Response.new(request, ).serialize end |
Instance Method Details
#errors ⇒ Object
51 52 53 |
# File 'lib/pagseguro/authorization.rb', line 51 def errors @errors ||= Errors.new end |
#update_attributes(attrs) ⇒ Object
47 48 49 |
# File 'lib/pagseguro/authorization.rb', line 47 def update_attributes(attrs) attrs.map { |name, value| send("#{name}=", value) } end |