Class: Jpay::PaymentVerification
- Inherits:
-
Object
- Object
- Jpay::PaymentVerification
- Defined in:
- lib/jpay/payment_verification.rb
Overview
Verifies transaction with jahanpay
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ PaymentVerification
constructor
A new instance of PaymentVerification.
-
#verify ⇒ Jpay::Response
Send verification request to jahanpay.
Constructor Details
#initialize(args = {}) ⇒ PaymentVerification
Note:
A hash of parameters should be send to this class
Returns a new instance of PaymentVerification.
15 16 17 18 19 20 21 |
# File 'lib/jpay/payment_verification.rb', line 15 def initialize(args = {}) @api = args[:api] || Jpay.configuration.api = args.fetch(:authority) @amount = args.fetch(:amount) @client ||= Savon.client(wsdl: Jpay.configuration.client, pretty_print_xml: true) @response = Response.new end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/jpay/payment_verification.rb', line 6 def status @status end |
Instance Method Details
#verify ⇒ Jpay::Response
Send verification request to jahanpay
26 27 28 29 30 31 32 33 |
# File 'lib/jpay/payment_verification.rb', line 26 def verify response = @client.call :verification, message: { 'api' => @api, 'amount' => @amount, 'authority' => , } @response.validate(response.body) end |