paykassa 0.1.16 → 0.1.19
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 +44 -20
- data/lib/paykassa/version.rb +1 -1
- data/lib/paykassa.rb +4 -2
- 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: 70a713697194fdb5fd26d597affdbd11f99ede103c580120f9ec6a4ede4c8b4e
|
4
|
+
data.tar.gz: 850ad95ef63c237a96723798d274b86c187c99887ca6485b36639ee1341e9f9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec7af94670998882aa912ff51649bba3644298a12cdaea7798d396087dcbc6bb6da8f336265cc0ffdb3514911cb4f0e69de096f0b4029d76f7099aaf018754c1
|
7
|
+
data.tar.gz: 6e8cf3a0a482bffd547fd9755fc9811a1b854b0a9525b0f44517fac4ad1728e051965ea2e065e8d9bd55ce007bf6fb14182982fd35b871b1670f0f0323a282b1
|
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
|
@@ -15,28 +37,30 @@ class PaykassaOrder
|
|
15
37
|
# Request for create order
|
16
38
|
def create_order(amount: , currency:, order_id:, paid_commision: , comment:, system:)
|
17
39
|
make_request(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
40
|
+
{
|
41
|
+
func: :sci_create_order,
|
42
|
+
amount: amount,
|
43
|
+
currency: currency,
|
44
|
+
order_id: order_id,
|
45
|
+
phone: "false",
|
46
|
+
paid_commission: paid_commision,
|
47
|
+
comment: comment,
|
48
|
+
system: SYSTEM_IDS[system]
|
49
|
+
}
|
27
50
|
)
|
28
51
|
end
|
29
|
-
def get_data(amount: , currency:, order_id:,
|
52
|
+
def get_data(amount: , currency:, order_id:, paid_commission: , comment:, system:)
|
30
53
|
make_request(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
54
|
+
{
|
55
|
+
func: :sci_create_order_get_data,
|
56
|
+
amount: amount,
|
57
|
+
currency: currency,
|
58
|
+
order_id: order_id,
|
59
|
+
phone: "false",
|
60
|
+
paid_commission: paid_commission,
|
61
|
+
comment: comment,
|
62
|
+
system: SYSTEM_IDS[system]
|
63
|
+
}
|
40
64
|
)
|
41
65
|
end
|
42
66
|
|
data/lib/paykassa/version.rb
CHANGED
data/lib/paykassa.rb
CHANGED
@@ -42,15 +42,17 @@ module Paykassa
|
|
42
42
|
def rate(c_in, c_out)
|
43
43
|
@paykassa_pay.currency_rate(c_in, c_out)
|
44
44
|
end
|
45
|
-
def get_order_address(amount: , currency:, order_id:,
|
45
|
+
def get_order_address(amount: , currency:, order_id:, paid_commission: , comment: "from paykassa gem", system:)
|
46
46
|
order = @paykassa_order.get_data( amount: amount,
|
47
47
|
currency: currency,
|
48
48
|
order_id: order_id,
|
49
49
|
phone: "false",
|
50
|
-
paid_commission:
|
50
|
+
paid_commission: paid_commission,
|
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(
|