paykassa 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paykassa/version.rb +1 -1
- data/lib/paykassa.rb +6 -6
- 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: 75bdef9bd41f06f69a8b42fb4eb8e8388d3e87e64c5b7dad4f0e5a8127e93e39
|
4
|
+
data.tar.gz: da37b4dcfd7afa660737654b72430359f10742ab11e695a35832314327eea9bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c51aced00d07703379310bc6481d76ec24e67cc7f93dfde1763d5e0a13401ed4d46296d2d4c2c4e1e0b13c4dd42ea0a890dc38cdaba7a87ba3d87d62662706b
|
7
|
+
data.tar.gz: 44106fd03bd254f4c3c4dcdcdea04be6ef780097a453a54547cd42a8c06f9b238dfbdfc8b2bdefb328949650c2db522949161ea74db83b3a3f27b0e25b1dfc6f
|
data/lib/paykassa/version.rb
CHANGED
data/lib/paykassa.rb
CHANGED
@@ -5,7 +5,7 @@ require_relative "paykassa/order"
|
|
5
5
|
module Paykassa
|
6
6
|
class Error < StandardError; end
|
7
7
|
class Paykassa
|
8
|
-
def initialize(domain
|
8
|
+
def initialize(domain:, sci_id:, sci_key:, api_id: nil, api_key: nil, test:)
|
9
9
|
@paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key})
|
10
10
|
if api_id.nil?
|
11
11
|
@paykassa_pay = nil
|
@@ -17,6 +17,7 @@ module Paykassa
|
|
17
17
|
)
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
20
21
|
def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)
|
21
22
|
raise "api_key not present!" if @paykassa_pay.nil?
|
22
23
|
@paykassa_pay.pay({
|
@@ -30,6 +31,7 @@ module Paykassa
|
|
30
31
|
priority: priority
|
31
32
|
})
|
32
33
|
end
|
34
|
+
|
33
35
|
def balance(shop:)
|
34
36
|
raise "api_key not present!" if @paykassa_pay.nil?
|
35
37
|
@paykassa_pay.balance(shop: shop)
|
@@ -37,10 +39,8 @@ module Paykassa
|
|
37
39
|
def rate(c_in, c_out)
|
38
40
|
@paykassa_pay.currency_rate(c_in, c_out)
|
39
41
|
end
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
def create_order(amount, currency, order_id, system, comment="from paykassa gem")
|
42
|
+
|
43
|
+
def create_order(amount:, currency:, order_id:, system:, comment: "from paykassa gem")
|
44
44
|
order = @paykassa_order.create_order(
|
45
45
|
amount: amount,
|
46
46
|
currency: currency,
|
@@ -51,7 +51,7 @@ module Paykassa
|
|
51
51
|
raise StandardError.new(order[:message]) if order[:error]
|
52
52
|
url = order[:data][:url]
|
53
53
|
end
|
54
|
-
def confirm_order(hash)
|
54
|
+
def confirm_order(hash:)
|
55
55
|
result = @paykassa_order.confirm_order(hash)
|
56
56
|
raise StandardError.new(result[:message]) if result[:error]
|
57
57
|
order_id = res[:data][:order_id]
|