lib/paykassa/pay.rb in paykassa-0.1.9 vs lib/paykassa/pay.rb in paykassa-0.1.10

- old
+ new

@@ -1,11 +1,11 @@ require 'net/http' class PaykassaPay - BASE_URL = "https://paykassa.app/api/0.5/index.php" - RATE_URL = "https://currency.paykassa.pro/index.php" - BASE_SCI_URI = 'https://paykassa.pro/sci/0.3/index.php' + BASE_URL = URI("https://paykassa.app/api/0.5/index.php") + RATE_URL = URI("https://currency.paykassa.pro/index.php") + BASE_SCI_URI = URI('https://paykassa.pro/sci/0.3/index.php') CURRENCIES=[ "USD", "RUB", "BTC", "ETH", "LTC", "DOGE", "DASH", "BCH", "ZEC", "XRP", "TRX", "XLM", "BNB", "USDT", "ADA", "EOS", "GBP", "EUR", "USDC", "BUSD" ] @@ -70,10 +70,10 @@ RATE_URL ) end private def make_request(func,data,merge_auth = true, url= nil) - data = data.merge({func: func}) if func + data = data.merge({func: func}) if !func.nil? data = data.merge(@_auth) if merge_auth url = BASE_SCI_URI if url.nil? res = Net::HTTP.post_form(url, data) JSON.parse(res.body).deep_symbolize_keys end