paykassa 0.1.20 → 0.1.23
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 +30 -23
- data/lib/paykassa/version.rb +1 -1
- 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: 47f2cdcdc2333b4c6a65a97c7bd2f2da5fb06480ddefef2f0bca83ee096ec013
|
4
|
+
data.tar.gz: d0a11b736ee62417e9e506e1ca1ea5dd752916477066389de4aa83839a132317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5731572f3652c25125c87b85ecfa18f8df57acfe6dde1a0dbc40e28df9ca953cbc9209000b1c3a1ad767ad1821906b454409d7042cc0db8f957ee655aad1418
|
7
|
+
data.tar.gz: a28f2d1c3a8cebede63588751399033dcf62ec3f1c7fec0fe1291365229208e4df1a89b4654e0405aae178b4741bb7fe999221b2d2e26ba2bdfcb57d72d3adc9
|
data/lib/paykassa/order.rb
CHANGED
@@ -36,32 +36,36 @@ class PaykassaOrder
|
|
36
36
|
|
37
37
|
# Request for create order
|
38
38
|
def create_order(amount: , currency:, order_id:, paid_commision: , comment:, system:)
|
39
|
+
puts "system: #{system}"
|
40
|
+
data = {
|
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
|
+
}
|
50
|
+
puts data.inspect
|
39
51
|
make_request(
|
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
|
-
}
|
52
|
+
data
|
50
53
|
)
|
51
54
|
end
|
52
55
|
def get_data(amount: , currency:, order_id:, paid_commission: , comment:, system:)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
puts "system: #{system}"
|
57
|
+
data = {
|
58
|
+
func: :sci_create_order_get_data,
|
59
|
+
amount: amount,
|
60
|
+
currency: currency,
|
61
|
+
order_id: order_id,
|
62
|
+
phone: "false",
|
63
|
+
paid_commission: paid_commission,
|
64
|
+
comment: comment,
|
65
|
+
system: SYSTEM_IDS[system]
|
66
|
+
}
|
67
|
+
puts data.inspect
|
68
|
+
make_request(data)
|
65
69
|
end
|
66
70
|
|
67
71
|
# Check order status
|
@@ -72,7 +76,10 @@ class PaykassaOrder
|
|
72
76
|
private
|
73
77
|
|
74
78
|
def make_request(data)
|
75
|
-
|
79
|
+
full_data = data.merge(@_auth)
|
80
|
+
puts BASE_SCI_URI
|
81
|
+
puts full_data.inspect
|
82
|
+
res = Net::HTTP.post_form(BASE_SCI_URI, full_data)
|
76
83
|
JSON.parse(res.body).deep_symbolize_keys
|
77
84
|
end
|
78
85
|
end
|
data/lib/paykassa/version.rb
CHANGED