paykassa 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/paykassa/version.rb +1 -1
- data/lib/paykassa.rb +9 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8687f5ec9fd91c050e4e5f8ac214b21c4749f7d29d380cb019752cbd0855746d
|
4
|
+
data.tar.gz: 532ac74da80f99e7fdc94ffa54fcf06e24b54f3fa1d3da95d50282dc087ca026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef0b01632b37372bf16409462a2ec24d9ed54aafe95ab5db6a7293d2675002c0b4e3fdad2c3d1b75cc309b19c87d5143e6eefa0c1fe8baebf6fefaebcc934454
|
7
|
+
data.tar.gz: 3c5cd6a97d0459e1d211ece2759602208b5a834f08238cceef49cb48406e237b8273f5ab6a7fc7f8e1a989f294606b07f7e5b6760b862d7f4d211f0edafd7aa2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/paykassa/version.rb
CHANGED
data/lib/paykassa.rb
CHANGED
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
require_relative "paykassa/version"
|
4
4
|
require_relative "paykassa/order"
|
5
|
+
require_relative "paykassa/pay"
|
5
6
|
module Paykassa
|
6
7
|
class Error < StandardError; end
|
7
|
-
class
|
8
|
-
def initialize(domain
|
8
|
+
class Paykassa
|
9
|
+
def initialize(domain:, sci_id:, sci_key:, api_id: nil, api_key: nil, test:)
|
9
10
|
@paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key})
|
10
11
|
if api_id.nil?
|
11
12
|
@paykassa_pay = nil
|
@@ -16,8 +17,8 @@ module Paykassa
|
|
16
17
|
}
|
17
18
|
)
|
18
19
|
end
|
19
|
-
|
20
20
|
end
|
21
|
+
|
21
22
|
def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)
|
22
23
|
raise "api_key not present!" if @paykassa_pay.nil?
|
23
24
|
@paykassa_pay.pay({
|
@@ -31,6 +32,7 @@ module Paykassa
|
|
31
32
|
priority: priority
|
32
33
|
})
|
33
34
|
end
|
35
|
+
|
34
36
|
def balance(shop:)
|
35
37
|
raise "api_key not present!" if @paykassa_pay.nil?
|
36
38
|
@paykassa_pay.balance(shop: shop)
|
@@ -38,10 +40,8 @@ module Paykassa
|
|
38
40
|
def rate(c_in, c_out)
|
39
41
|
@paykassa_pay.currency_rate(c_in, c_out)
|
40
42
|
end
|
41
|
-
|
42
|
-
|
43
|
-
end
|
44
|
-
def create_order(amount, currency, order_id, system, comment="from paykassa gem")
|
43
|
+
|
44
|
+
def create_order(amount:, currency:, order_id:, system:, comment: "from paykassa gem")
|
45
45
|
order = @paykassa_order.create_order(
|
46
46
|
amount: amount,
|
47
47
|
currency: currency,
|
@@ -52,15 +52,12 @@ module Paykassa
|
|
52
52
|
raise StandardError.new(order[:message]) if order[:error]
|
53
53
|
url = order[:data][:url]
|
54
54
|
end
|
55
|
-
def confirm_order(hash)
|
55
|
+
def confirm_order(hash:)
|
56
56
|
result = @paykassa_order.confirm_order(hash)
|
57
57
|
raise StandardError.new(result[:message]) if result[:error]
|
58
58
|
order_id = res[:data][:order_id]
|
59
59
|
amount = res[:data][:amount]
|
60
60
|
{order_id: order_id, amount: amount}
|
61
61
|
end
|
62
|
-
|
63
|
-
|
64
|
-
end
|
65
|
-
|
62
|
+
end
|
66
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paykassa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nottewae
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|