lib/pesapal/merchant.rb in pesapal-1.6.0 vs lib/pesapal/merchant.rb in pesapal-1.7.0

- old
+ new

@@ -245,14 +245,12 @@ query_string = Pesapal::Oauth.generate_encoded_params_query_string @params # get status response uri = URI.parse "#{@api_endpoints[:querypaymentdetails]}?#{query_string}" http = Net::HTTP.new(uri.host, uri.port) - if @env == 'production' - http.use_ssl = true - http.verify_mode = OpenSSL::SSL::VERIFY_NONE - end + http.use_ssl = true + http.verify_mode = OpenSSL::SSL::VERIFY_NONE response = http.request(Net::HTTP::Get.new(uri.request_uri)) response = CGI.parse response.body response = response['pesapal_response_data'][0].split(',') { method: response[1], @@ -300,14 +298,12 @@ query_string = Pesapal::Oauth.generate_encoded_params_query_string @params # get status response uri = URI.parse "#{@api_endpoints[:querypaymentstatus]}?#{query_string}" http = Net::HTTP.new(uri.host, uri.port) - if @env == 'production' - http.use_ssl = true - http.verify_mode = OpenSSL::SSL::VERIFY_NONE - end + http.use_ssl = true + http.verify_mode = OpenSSL::SSL::VERIFY_NONE response = http.request(Net::HTTP::Get.new(uri.request_uri)) response = CGI.parse response.body response['pesapal_response_data'][0] end @@ -410,10 +406,10 @@ # Assign API endpoints depending on the environment. def assign_endpoints if @env == 'production' @api_domain = 'https://www.pesapal.com' else - @api_domain = 'http://demo.pesapal.com' + @api_domain = 'https://demo.pesapal.com' end @api_endpoints = {} @api_endpoints[:postpesapaldirectorderv4] = "#{@api_domain}/API/PostPesapalDirectOrderV4" @api_endpoints[:querypaymentstatus] = "#{@api_domain}/API/QueryPaymentStatus"