Class: Paysure::Verify
- Inherits:
-
RequestBase
- Object
- RequestBase
- Paysure::Verify
- Includes:
- Validatable
- Defined in:
- lib/paysure/requests/verify.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args = {}) ⇒ Verify
constructor
A new instance of Verify.
Constructor Details
#initialize(args = {}) ⇒ Verify
Returns a new instance of Verify.
8 9 10 11 12 13 14 |
# File 'lib/paysure/requests/verify.rb', line 8 def initialize(args = {}) super @ACTION_NAME = [:verify,'json'].join('.').freeze @token = args.fetch(:token) @merchant_id = args.fetch(:merchant_id,Paysure.configuration.merchant_id) @response = ResponseVerify.new end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/paysure/requests/verify.rb', line 5 def config @config end |
#merchant_id ⇒ Object
Returns the value of attribute merchant_id.
4 5 6 |
# File 'lib/paysure/requests/verify.rb', line 4 def merchant_id @merchant_id end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/paysure/requests/verify.rb', line 5 def response @response end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/paysure/requests/verify.rb', line 4 def token @token end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/paysure/requests/verify.rb', line 17 def call connection = Faraday.new(url: "#{@API_URL}/transaction/") do |faraday| faraday.adapter Faraday.default_adapter faraday.response :json end response = connection.get(@ACTION_NAME, token: @token,merchant_id: @merchant_id) @response.validate(response.body) end |