cryptomus 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/cryptomus/client.rb +8 -1
- data/lib/cryptomus/configuration.rb +1 -0
- data/lib/cryptomus/errors.rb +4 -3
- data/lib/cryptomus/signature.rb +1 -1
- data/lib/cryptomus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 559fbf0dade19be29d6d13f215dba7950417dd1ae662c0ec423e7ae825e7c7b0
|
4
|
+
data.tar.gz: 7e8660488af6dc921cc3ddb440c4a94124fa049d222e57b98cd639336874ed03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/cryptomus/client.rb
CHANGED
@@ -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.
|
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
|
data/lib/cryptomus/errors.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
20
|
+
msg ||= "Response #{status}, #{response_body}" if response
|
21
|
+
super(msg || self.class.name)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
data/lib/cryptomus/signature.rb
CHANGED
@@ -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.
|
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
|
data/lib/cryptomus/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|