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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b22e931f7c24128cda99e11b334bb7360f85e1317dc7815d0206ce8aac232b4
4
- data.tar.gz: b9ba1055ede1292d932930c80ab0e3dc7e4aefddceee36650797907b1d125de8
3
+ metadata.gz: 8687f5ec9fd91c050e4e5f8ac214b21c4749f7d29d380cb019752cbd0855746d
4
+ data.tar.gz: 532ac74da80f99e7fdc94ffa54fcf06e24b54f3fa1d3da95d50282dc087ca026
5
5
  SHA512:
6
- metadata.gz: 9ca4889a4d967713ebd43e0f74c9326212e466fbf6c7e1537bb655c29cb8810248064f4cac560efa269431d0abba2ae7ffc34f49501b83b5fedeadb75419e701
7
- data.tar.gz: 1aa612250b188b505277041dff4ba180204616f122bc8a56a341530bd9f6e759b1cefb0cd580e41bdb189968252d0ff58601a063e8b3e6d779230a5cac742b3d
6
+ metadata.gz: ef0b01632b37372bf16409462a2ec24d9ed54aafe95ab5db6a7293d2675002c0b4e3fdad2c3d1b75cc309b19c87d5143e6eefa0c1fe8baebf6fefaebcc934454
7
+ data.tar.gz: 3c5cd6a97d0459e1d211ece2759602208b5a834f08238cceef49cb48406e237b8273f5ab6a7fc7f8e1a989f294606b07f7e5b6760b862d7f4d211f0edafd7aa2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paykassa (0.1.0)
4
+ paykassa (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'paykassa'
12
+ gem 'paykassa', '~> 0.1.1'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paykassa
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.4"
5
5
  end
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 Order
8
- def initialize(domain, sci_id, sci_key, api_id = nil, api_key = nil, test)
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
- def create_order(amount:, currency:, order_id:, system:, comment:)
42
- create_order(amount, currency, order_id, system, comment)
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.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-04-07 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet