paykassa 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b76212dc11636965468660eb6431508eabc5ebca36cff22e405449b05a28b54b
4
- data.tar.gz: fb923e1a378c91876ab5e730ab0108697c07868082a1f5413aa0dd8bbe558230
3
+ metadata.gz: 75bdef9bd41f06f69a8b42fb4eb8e8388d3e87e64c5b7dad4f0e5a8127e93e39
4
+ data.tar.gz: da37b4dcfd7afa660737654b72430359f10742ab11e695a35832314327eea9bb
5
5
  SHA512:
6
- metadata.gz: 806d7425e9f49bef40ef5276695a2e401649d4269c1768ee3b6c7af87a4fa771824840fe0d993e4ac1897d307d09868c4872776efba544a67cb34e075c6080f0
7
- data.tar.gz: 6b97d0c700e3bb7ed6d23f6e35bfa667340588956e842cb258f0a4d1d3081e4438b591b1252806a53bf2ac5b8a6c1f8ed6bd799bbe7f8a2db0c98982ee56d6bc
6
+ metadata.gz: 1c51aced00d07703379310bc6481d76ec24e67cc7f93dfde1763d5e0a13401ed4d46296d2d4c2c4e1e0b13c4dd42ea0a890dc38cdaba7a87ba3d87d62662706b
7
+ data.tar.gz: 44106fd03bd254f4c3c4dcdcdea04be6ef780097a453a54547cd42a8c06f9b238dfbdfc8b2bdefb328949650c2db522949161ea74db83b3a3f27b0e25b1dfc6f
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:
data/lib/paykassa/pay.rb CHANGED
@@ -30,7 +30,7 @@ class PaykassaPay
30
30
  @token = api_password
31
31
  @_auth = {domain: domain, api_id: api_id, api_key: api_key, test: test}
32
32
  end
33
- def pay(amount: amount, shop: shop, currency: currency, system_name: system_name, paid_commission: "shop", number:, tag:, priority:)
33
+ def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)
34
34
  data = {
35
35
  amount: amount,
36
36
  shop: shop,
@@ -43,7 +43,7 @@ class PaykassaPay
43
43
  }
44
44
  make_request("api_payment",data)
45
45
  end
46
- def balance(shop: shop)
46
+ def balance(shop: )
47
47
  data = {
48
48
  shop: shop,
49
49
  pi_id: api_id,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paykassa
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/paykassa.rb CHANGED
@@ -4,8 +4,8 @@ require_relative "paykassa/version"
4
4
  require_relative "paykassa/order"
5
5
  module Paykassa
6
6
  class Error < StandardError; end
7
- class Order
8
- def initialize(domain, sci_id, sci_key, api_id = nil, api_key = nil, test)
7
+ class Paykassa
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
@@ -16,9 +16,9 @@ module Paykassa
16
16
  }
17
17
  )
18
18
  end
19
-
20
19
  end
21
- def pay(amount: amount, shop: shop, currency: currency, system_name: system_name, paid_commission: "shop", number:, tag:, priority:)
20
+
21
+ def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)
22
22
  raise "api_key not present!" if @paykassa_pay.nil?
23
23
  @paykassa_pay.pay({
24
24
  amount: amount,
@@ -31,6 +31,7 @@ module Paykassa
31
31
  priority: priority
32
32
  })
33
33
  end
34
+
34
35
  def balance(shop:)
35
36
  raise "api_key not present!" if @paykassa_pay.nil?
36
37
  @paykassa_pay.balance(shop: shop)
@@ -38,10 +39,8 @@ module Paykassa
38
39
  def rate(c_in, c_out)
39
40
  @paykassa_pay.currency_rate(c_in, c_out)
40
41
  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")
42
+
43
+ def create_order(amount:, currency:, order_id:, system:, comment: "from paykassa gem")
45
44
  order = @paykassa_order.create_order(
46
45
  amount: amount,
47
46
  currency: currency,
@@ -52,15 +51,12 @@ module Paykassa
52
51
  raise StandardError.new(order[:message]) if order[:error]
53
52
  url = order[:data][:url]
54
53
  end
55
- def confirm_order(hash)
54
+ def confirm_order(hash:)
56
55
  result = @paykassa_order.confirm_order(hash)
57
56
  raise StandardError.new(result[:message]) if result[:error]
58
57
  order_id = res[:data][:order_id]
59
58
  amount = res[:data][:amount]
60
59
  {order_id: order_id, amount: amount}
61
60
  end
62
-
63
-
64
- end
65
-
61
+ end
66
62
  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.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nottewae
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-29 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
@@ -102,7 +102,6 @@ files:
102
102
  - lib/paykassa/order.rb
103
103
  - lib/paykassa/pay.rb
104
104
  - lib/paykassa/version.rb
105
- - paykassa.gemspec
106
105
  homepage: http://github.com/nottewae/paykassa
107
106
  licenses:
108
107
  - MIT
data/paykassa.gemspec DELETED
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/paykassa/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "paykassa"
7
- spec.version = Paykassa::VERSION
8
- spec.authors = ["nottewae"]
9
- spec.email = ["nottewae@gmail.com"]
10
-
11
- spec.summary = "Library for PayKassa Service"
12
- spec.description = "Library for PayKassa Service. Send and recieve payments."
13
- spec.homepage = "http://github.com/nottewae/paykassa"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.0.3"
16
-
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
-
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "http://github.com/nottewae/paykassa"
21
- spec.metadata["changelog_uri"] = "http://github.com/nottewae/paykassa/CHANGELOG.md"
22
-
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
- end
29
- end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
33
- spec.add_development_dependency "redcarpet", "~> 2.3.0"
34
- spec.add_development_dependency "yard", "~> 0.9.27"
35
- spec.add_development_dependency "rspec-core", "~> 3.11.0"
36
- spec.add_development_dependency "rspec-expectations", "~> 3.11.0"
37
- spec.add_development_dependency "rr", "~> 3.0.3"
38
- # Uncomment to register a new dependency of your gem
39
- # spec.add_dependency "example-gem", "~> 1.0"
40
-
41
- # For more information and examples about making a new gem, checkout our
42
- # guide at: https://bundler.io/guides/creating_gem.html
43
- end