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 +4 -4
- data/lib/paykassa/order.rb +25 -5
- data/lib/paykassa/version.rb +1 -1
- data/lib/paykassa.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3593a8efb9f87d15ae638745fa20b92222155605b70b51114fbaf77afe28d2
|
4
|
+
data.tar.gz: 3b0113e6185dbd9fa1e62109fd6e9e4c7adea32546cefcdbd61b9bf27ec001f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0012c0e1e99aea0ed3473c76f6fd2825456d124f22d9fed61cc3946110c4fb70e206f32bb47ffa687fbe7db94c41c7cd50edeed79c62f352bb351f71a1e364d
|
7
|
+
data.tar.gz: f48c8bfed4f650ac94a26bdf0a03304b03df16fcb18c1f81f8a4580ee93dddf45c3e34e63c2a7803f48eeae93a5e977382ce0f552ebee5f3a248b1f8073c9d53
|
data/lib/paykassa/order.rb
CHANGED
@@ -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
|
|
data/lib/paykassa/version.rb
CHANGED
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(
|