lib/paykassa/order.rb in paykassa-0.1.16 vs lib/paykassa/order.rb in paykassa-0.1.17

- old
+ new

@@ -1,11 +1,33 @@ require 'net/http' class PaykassaOrder 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" + ] + SYSTEM_IDS = { + perfectmoney: 2, + berty: 7, + bitcoin: 11, + ethereum: 12, + litecoin: 14, + dogecoin: 15, + dash: 16, + bitcoincash: 18, + zcash: 19, + ripple: 22, + tron: 27, + stellar: 28, + binancecoin: 29, + tron_trc20: 30, + binancesmartchain_bep20: 31, # available currencies USDT, BUSD, USDC, ADA, EOS, BTC, ETH, DOGE + ethereum_erc20: 32 + } - # def initialize(auth) # where auth has keys: sci_id, sci_key, domain def initialize(auth, logger = nil, test = false) @logger = logger @_auth = auth @@ -20,12 +42,11 @@ currency: currency, order_id: order_id, phone: "false", paid_commission: paid_commision, comment: comment, - system: system, - test: @test.to_s + system: SYSTEM_IDS[system] ) end def get_data(amount: , currency:, order_id:, paid_commision: , comment:, system:) make_request( func: :sci_create_order_get_data, @@ -33,11 +54,10 @@ currency: currency, order_id: order_id, phone: "false", paid_commission: paid_commision, comment: comment, - system: system, - test: @test.to_s + system: SYSTEM_IDS[system] ) end # Check order status def confirm_order(private_hash) \ No newline at end of file