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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dcdc2aceb8d1bac9c1b6bbb89a55a5b756f9bc9e0600204991bea31ff7e6150
4
- data.tar.gz: 6ae43dbd1f900b1dff6964e5f04078d3ce61989a7cfb62027fbaebd8d3f35ace
3
+ metadata.gz: 75bdef9bd41f06f69a8b42fb4eb8e8388d3e87e64c5b7dad4f0e5a8127e93e39
4
+ data.tar.gz: da37b4dcfd7afa660737654b72430359f10742ab11e695a35832314327eea9bb
5
5
  SHA512:
6
- metadata.gz: a36b71e58fc19aaa7f536ea17872de7ecfef4a0182dd2664fe98edd3cf384bc6ab3a85051f82f56883c73000f0f8c0fe0f68628acc80c5bf6926039fad3bf517
7
- data.tar.gz: 93ebc1c4c570767cfb998580ae8682144356c64282440ee517fe8cd06d77cd3c4e020c0d09961ce4a55ce43eec845ea7c79474bb1bca06425feee774e018ea75
6
+ metadata.gz: 1c51aced00d07703379310bc6481d76ec24e67cc7f93dfde1763d5e0a13401ed4d46296d2d4c2c4e1e0b13c4dd42ea0a890dc38cdaba7a87ba3d87d62662706b
7
+ data.tar.gz: 44106fd03bd254f4c3c4dcdcdea04be6ef780097a453a54547cd42a8c06f9b238dfbdfc8b2bdefb328949650c2db522949161ea74db83b3a3f27b0e25b1dfc6f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paykassa
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
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, sci_id, sci_key, api_id = nil, api_key = nil, test)
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
- def create_order(amount:, currency:, order_id:, system:, comment:)
41
- create_order(amount, currency, order_id, system, comment)
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paykassa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nottewae