Module: PaynowStatus
- Defined in:
- lib/paynow_sdk.rb
Class Method Summary collapse
Class Method Details
.check_transaction_status(poll_url) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/paynow_sdk.rb', line 13 def self.check_transaction_status(poll_url) url = URI(poll_url) http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["content-type"] = "application/x-www-form-urlencoded" response = http.request(request) response.read_body response_object = URI.decode_www_form(response.read_body).to_h end |
.paid ⇒ Object
8 9 10 11 |
# File 'lib/paynow_sdk.rb', line 8 def self.paid status_paid = check_transaction_status(poll_url) status_paid["status"] == "Paid" end |