paykassa 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f08dc918608da07c348a716eb133e57187372b3158adc369bbbb0cb41a6cf53
4
- data.tar.gz: 68bc52b31422fb2786d8ee7e0f998ecac762e2b4143114e92cdb876e6986075d
3
+ metadata.gz: 8e3593a8efb9f87d15ae638745fa20b92222155605b70b51114fbaf77afe28d2
4
+ data.tar.gz: 3b0113e6185dbd9fa1e62109fd6e9e4c7adea32546cefcdbd61b9bf27ec001f4
5
5
  SHA512:
6
- metadata.gz: 1c4d4c81018e7276636b68f2c1b73950ba31725c9704ebd35b8e357543c2b65fe50a0f37b15a2842dfd685e6a19e8ce6e9db559b42ad9f136828f2cf20a5b10e
7
- data.tar.gz: bf549917ae04e06a5c85be261b1d3003ceae524e20c29e6afc6587898bca17b4cf008b6e262734ceedcfd230c336ca11b50fc8632e3fcb7856bb2610cbd9bb93
6
+ metadata.gz: d0012c0e1e99aea0ed3473c76f6fd2825456d124f22d9fed61cc3946110c4fb70e206f32bb47ffa687fbe7db94c41c7cd50edeed79c62f352bb351f71a1e364d
7
+ data.tar.gz: f48c8bfed4f650ac94a26bdf0a03304b03df16fcb18c1f81f8a4580ee93dddf45c3e34e63c2a7803f48eeae93a5e977382ce0f552ebee5f3a248b1f8073c9d53
@@ -2,7 +2,29 @@ require 'net/http'
2
2
 
3
3
  class PaykassaOrder
4
4
  BASE_SCI_URI = URI('https://paykassa.pro/sci/0.3/index.php')
5
-
5
+ CURRENCIES=[
6
+ "USD", "RUB", "BTC", "ETH", "LTC", "DOGE", "DASH", "BCH", "ZEC",
7
+ "XRP", "TRX", "XLM", "BNB", "USDT", "ADA", "EOS", "GBP", "EUR",
8
+ "USDC", "BUSD"
9
+ ]
10
+ SYSTEM_IDS = {
11
+ perfectmoney: 2,
12
+ berty: 7,
13
+ bitcoin: 11,
14
+ ethereum: 12,
15
+ litecoin: 14,
16
+ dogecoin: 15,
17
+ dash: 16,
18
+ bitcoincash: 18,
19
+ zcash: 19,
20
+ ripple: 22,
21
+ tron: 27,
22
+ stellar: 28,
23
+ binancecoin: 29,
24
+ tron_trc20: 30,
25
+ binancesmartchain_bep20: 31, # available currencies USDT, BUSD, USDC, ADA, EOS, BTC, ETH, DOGE
26
+ ethereum_erc20: 32
27
+ }
6
28
 
7
29
  # def initialize(auth)
8
30
  # where auth has keys: sci_id, sci_key, domain
@@ -22,8 +44,7 @@ class PaykassaOrder
22
44
  phone: "false",
23
45
  paid_commission: paid_commision,
24
46
  comment: comment,
25
- system: system,
26
- test: @test.to_s
47
+ system: SYSTEM_IDS[system]
27
48
  )
28
49
  end
29
50
  def get_data(amount: , currency:, order_id:, paid_commision: , comment:, system:)
@@ -35,8 +56,7 @@ class PaykassaOrder
35
56
  phone: "false",
36
57
  paid_commission: paid_commision,
37
58
  comment: comment,
38
- system: system,
39
- test: @test.to_s
59
+ system: SYSTEM_IDS[system]
40
60
  )
41
61
  end
42
62
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paykassa
4
- VERSION = "0.1.16"
4
+ VERSION = "0.1.17"
5
5
  end
data/lib/paykassa.rb CHANGED
@@ -51,6 +51,8 @@ module Paykassa
51
51
  comment: comment,
52
52
  system: system
53
53
  )
54
+ raise StandardError.new(order[:message]) if order[:error]
55
+ order
54
56
  end
55
57
  def create_order(amount: , currency:, order_id:, paid_commision: , comment: "from paykassa gem", system:)
56
58
  order = @paykassa_order.create_order(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paykassa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - nottewae