paykassa 0.1.15 → 0.1.16

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: 89253b68b012458e0be950f7a67bd2f146e8fbce8c3b8020ff50188a22261ada
4
- data.tar.gz: cf90611e7c91685a21d09957d2112479859dffc90ca3f16369ea971c17ebfc5b
3
+ metadata.gz: 8f08dc918608da07c348a716eb133e57187372b3158adc369bbbb0cb41a6cf53
4
+ data.tar.gz: 68bc52b31422fb2786d8ee7e0f998ecac762e2b4143114e92cdb876e6986075d
5
5
  SHA512:
6
- metadata.gz: 52f9ed30bb2cd87f885c6d2d9518341b995407556d86fa69c79c3cf97370214c9963cc7762dd9791fc577fd4832fd5407ef4f9198b5737e713a0d9715350e217
7
- data.tar.gz: e282b93c3408baf0f5b39209ac21ad21bd931a4b8dc7b4fe65b22fbd8b729e14ebaf9f116f96144a28bda883fdbef6a776ba5ac17fca91b52df36f9af0470f64
6
+ metadata.gz: 1c4d4c81018e7276636b68f2c1b73950ba31725c9704ebd35b8e357543c2b65fe50a0f37b15a2842dfd685e6a19e8ce6e9db559b42ad9f136828f2cf20a5b10e
7
+ data.tar.gz: bf549917ae04e06a5c85be261b1d3003ceae524e20c29e6afc6587898bca17b4cf008b6e262734ceedcfd230c336ca11b50fc8632e3fcb7856bb2610cbd9bb93
@@ -6,20 +6,37 @@ class PaykassaOrder
6
6
 
7
7
  # def initialize(auth)
8
8
  # where auth has keys: sci_id, sci_key, domain
9
- def initialize(auth, logger = nil)
9
+ def initialize(auth, logger = nil, test = false)
10
10
  @logger = logger
11
11
  @_auth = auth
12
+ @test = test
12
13
  end
13
14
 
14
15
  # Request for create order
15
- def create_order(amount:, currency:, order_id:, comment:, system:)
16
+ def create_order(amount: , currency:, order_id:, paid_commision: , comment:, system:)
16
17
  make_request(
17
18
  func: :sci_create_order,
18
19
  amount: amount,
19
20
  currency: currency,
20
21
  order_id: order_id,
22
+ phone: "false",
23
+ paid_commission: paid_commision,
21
24
  comment: comment,
22
- system: system
25
+ system: system,
26
+ test: @test.to_s
27
+ )
28
+ end
29
+ def get_data(amount: , currency:, order_id:, paid_commision: , comment:, system:)
30
+ make_request(
31
+ func: :sci_create_order_get_data,
32
+ amount: amount,
33
+ currency: currency,
34
+ order_id: order_id,
35
+ phone: "false",
36
+ paid_commission: paid_commision,
37
+ comment: comment,
38
+ system: system,
39
+ test: @test.to_s
23
40
  )
24
41
  end
25
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paykassa
4
- VERSION = "0.1.15"
4
+ VERSION = "0.1.16"
5
5
  end
data/lib/paykassa.rb CHANGED
@@ -10,7 +10,7 @@ module Paykassa
10
10
  def initialize(domain:, sci_id:, sci_key:, api_id: nil, api_key: nil, test:, logger: nil)
11
11
  @logger = Logger.new(logger) unless logger.nil?
12
12
 
13
- @paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key}, @logger)
13
+ @paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key}, @logger, test)
14
14
  if api_id.nil?
15
15
  @paykassa_pay = nil
16
16
  else
@@ -42,13 +42,24 @@ module Paykassa
42
42
  def rate(c_in, c_out)
43
43
  @paykassa_pay.currency_rate(c_in, c_out)
44
44
  end
45
-
46
- def create_order(amount:, currency:, order_id:, system:, comment: "from paykassa gem")
45
+ def get_order_address(amount: , currency:, order_id:, paid_commision: , comment: "from paykassa gem", system:)
46
+ order = @paykassa_order.get_data( amount: amount,
47
+ currency: currency,
48
+ order_id: order_id,
49
+ phone: "false",
50
+ paid_commission: paid_commision,
51
+ comment: comment,
52
+ system: system
53
+ )
54
+ end
55
+ def create_order(amount: , currency:, order_id:, paid_commision: , comment: "from paykassa gem", system:)
47
56
  order = @paykassa_order.create_order(
48
- amount: amount,
49
- currency: currency,
50
- order_id: order_id,
51
- comment: comment,
57
+ amount: amount,
58
+ currency: currency,
59
+ order_id: order_id,
60
+ phone: "false",
61
+ paid_commission: paid_commision,
62
+ comment: comment,
52
63
  system: system
53
64
  )
54
65
  raise StandardError.new(order[:message]) if order[:error]
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.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - nottewae
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-11 00:00:00.000000000 Z
11
+ date: 2022-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet