Class: Vpago::Vattanac::TransactionStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/vpago/vattanac/transaction_status.rb

Constant Summary

Constants inherited from Base

Base::CONTENT_TYPE_JSON

Instance Method Summary collapse

Methods inherited from Base

#access_token, #access_token_url, #amount, #check_transaction_url, #currency, #default_headers, #generate_payment_url, #initialize, #merchant_id, #parse_json, #password, #payment_method, #payment_number, #payment_type, #username

Constructor Details

This class inherits a constructor from Vpago::Vattanac::Base

Instance Method Details

#callObject



4
5
6
# File 'lib/vpago/vattanac/transaction_status.rb', line 4

def call
  @response = post(check_transaction_url, payload)
end

#json_responseObject



8
9
10
# File 'lib/vpago/vattanac/transaction_status.rb', line 8

def json_response
  @response
end

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/vpago/vattanac/transaction_status.rb', line 12

def success?
  @response.dig('data', 'status') == 'SUCCESS'
end