cryptomus 0.1.0 → 0.2.0

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: f60a4f81086d5b7e88b0fe308a09f62180cd353f373b48942ac13fd0bb474139
4
- data.tar.gz: d965a52db2e10cbdce4f4ec5c6b54fd2f9f8e6a2d466847962adbc6bf2cbf013
3
+ metadata.gz: 559fbf0dade19be29d6d13f215dba7950417dd1ae662c0ec423e7ae825e7c7b0
4
+ data.tar.gz: 7e8660488af6dc921cc3ddb440c4a94124fa049d222e57b98cd639336874ed03
5
5
  SHA512:
6
- metadata.gz: 97b863cb937d0c5da1c1592692df174809dcf513b8d1e1d2c24d9dc68242572974552cb067e5f7b36b56cef103f4bf9ca1c21761587e9ab1ca3d826996b33ec8
7
- data.tar.gz: e971b602839afee23d5cafc9c5bd8deb32f7999d47f07492f70a4df9c52ea167953a86d3e04158ecd43b9ea8cf3b2fd29e45403a0b0e33174046fa8ba364bf71
6
+ metadata.gz: 36c76acdbe5b1f3e8a2410a53a4e246911f9fbfc85983b3bc5a1019023bcaba6572e3ef87067cf2da8af94b3efe895d2c00b3717a6111c2e7c602dbd2afef89b
7
+ data.tar.gz: 9055b88a192759c97a9529c4319c6cdb0db6a150a9b969ddee6fd46c54fcf8e2edbe85dbbe457fb93c86b62b3cd921f4f5d572519ee8ce49b167f76ea4f500f2
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Cryptomus
2
2
 
3
+ ![Tests](https://github.com/senid231/cryptomus-ruby-sdk/workflows/Tests/badge.svg)
4
+ [![Gem Version](https://badge.fury.io/rb/cryptomus.svg)](https://badge.fury.io/rb/cryptomus)
5
+
3
6
  Ruby SDK for Cryptomus Crypto Payment Gateway.
4
7
  See the [documentation](https://doc.cryptomus.com)
5
8
 
@@ -42,7 +42,14 @@ module Cryptomus
42
42
  # @raise [Cryptomus::Errors::ApiError]
43
43
  def payment(uuid: nil, order_id: nil)
44
44
  attributes = { uuid:, order_id: }.compact
45
- connection.get('/v1/payment/info', body: attributes)
45
+ connection.post('/v1/payment/info', body: attributes)
46
+ end
47
+
48
+ # https://doc.cryptomus.com/payments/list-of-services
49
+ # @return [Hash]
50
+ # @raise [Cryptomus::Errors::ApiError]
51
+ def list_services
52
+ connection.post('/v1/payment/services', body: {})
46
53
  end
47
54
 
48
55
  # https://doc.cryptomus.com/payments/creating-static
@@ -6,6 +6,7 @@ module Cryptomus
6
6
  :merchant_id,
7
7
  :user_agent,
8
8
  :connection_config,
9
+ :handle_response,
9
10
  :on_error,
10
11
  :logger
11
12
 
@@ -11,13 +11,14 @@ module Cryptomus
11
11
  # @!method response_body [Hash,nil]
12
12
  attr_reader :response, :status, :response_body
13
13
 
14
- # @param msg [String]
15
14
  # @param response [Faraday::Response,nil]
16
- def initialize(msg, response = nil)
15
+ # @param msg [String,nil]
16
+ def initialize(response, msg = nil)
17
17
  @response = response
18
18
  @status = response&.status
19
19
  @response_body = response&.body
20
- super(msg)
20
+ msg ||= "Response #{status}, #{response_body}" if response
21
+ super(msg || self.class.name)
21
22
  end
22
23
  end
23
24
  end
@@ -11,7 +11,7 @@ module Cryptomus
11
11
  # @param raw_body [String]
12
12
  # @return [String]
13
13
  def generate(raw_body)
14
- raw_body_encoded = Base64.encode64(raw_body || '')
14
+ raw_body_encoded = Base64.strict_encode64(raw_body || '')
15
15
  Digest::MD5.hexdigest("#{raw_body_encoded}#{Cryptomus.config.api_key}")
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cryptomus
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptomus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Talakevich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-15 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday