cloudpayments 0.4.1 → 0.4.2
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 +4 -4
- data/lib/cloudpayments/client/request/base.rb +2 -2
- data/lib/cloudpayments/client/request/receipts/correction/create.rb +4 -3
- data/lib/cloudpayments/client/request/receipts/correction/get.rb +4 -3
- data/lib/cloudpayments/client/request/receipts/correction/get_status.rb +4 -3
- data/lib/cloudpayments/client/request/receipts/create.rb +4 -3
- data/lib/cloudpayments/client/request/receipts/get.rb +4 -3
- data/lib/cloudpayments/client/request/receipts/get_status.rb +4 -3
- data/lib/cloudpayments/connection.rb +4 -3
- data/lib/cloudpayments/version.rb +3 -0
- data/lib/cloudpayments.rb +1 -0
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71c73a688527d0e855cb7e6de0e7a11d49faa9c89c070095a031c96bf9046b20
|
|
4
|
+
data.tar.gz: dca3f590fe26425a45e1f2cdf5ab49f5694489f3e3a0e2dc3e65dfb88d1f7fd8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c413a93259ddec0788629d08594f1f1ba7e07b96b857b574f5696a2d004acda96569b27618de22fe2db18b71bd83d712356ea077c128b2cb2b5f429dce58f02d
|
|
7
|
+
data.tar.gz: '088d7087317264cd40e5e73c03ef146e363aad9622fe87b9b06b8244b5cd9616b8c4aec928405e5979b7ce9c07e2f3c717308a07421b63b10c5eef6cff852dd0'
|
|
@@ -4,8 +4,8 @@ module Cloudpayments
|
|
|
4
4
|
class Base
|
|
5
5
|
include Cloudpayments::Connection
|
|
6
6
|
|
|
7
|
-
def self.call(*args, &block)
|
|
8
|
-
response = new(*args, &block).call
|
|
7
|
+
def self.call(*args, **kwargs, &block)
|
|
8
|
+
response = new(*args, **kwargs, &block).call
|
|
9
9
|
Cloudpayments::Client::Response::Base.new(response)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -4,14 +4,15 @@ module Cloudpayments
|
|
|
4
4
|
module Receipts
|
|
5
5
|
module Correction
|
|
6
6
|
class Create < Cloudpayments::Client::Request::Base
|
|
7
|
-
attr_reader :params
|
|
7
|
+
attr_reader :params, :request_id
|
|
8
8
|
|
|
9
|
-
def initialize(params)
|
|
9
|
+
def initialize(params, request_id: SecureRandom.uuid)
|
|
10
10
|
@params = params
|
|
11
|
+
@request_id = request_id
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def call
|
|
14
|
-
post("kkt/correction-receipt", params)
|
|
15
|
+
post("kkt/correction-receipt", params, { "X-Request-ID" => request_id })
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
end
|
|
@@ -4,14 +4,15 @@ module Cloudpayments
|
|
|
4
4
|
module Receipts
|
|
5
5
|
module Correction
|
|
6
6
|
class Get < Cloudpayments::Client::Request::Base
|
|
7
|
-
attr_reader :id
|
|
7
|
+
attr_reader :id, :request_id
|
|
8
8
|
|
|
9
|
-
def initialize(id)
|
|
9
|
+
def initialize(id, request_id: SecureRandom.uuid)
|
|
10
10
|
@id = id
|
|
11
|
+
@request_id = request_id
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def call
|
|
14
|
-
post("kkt/correction-receipt/get", { Id: id })
|
|
15
|
+
post("kkt/correction-receipt/get", { Id: id }, { "X-Request-ID" => request_id })
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
end
|
|
@@ -4,14 +4,15 @@ module Cloudpayments
|
|
|
4
4
|
module Receipts
|
|
5
5
|
module Correction
|
|
6
6
|
class GetStatus < Cloudpayments::Client::Request::Base
|
|
7
|
-
attr_reader :id
|
|
7
|
+
attr_reader :id, :request_id
|
|
8
8
|
|
|
9
|
-
def initialize(id)
|
|
9
|
+
def initialize(id, request_id: SecureRandom.uuid)
|
|
10
10
|
@id = id
|
|
11
|
+
@request_id = request_id
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def call
|
|
14
|
-
post("kkt/correction-receipt/status/get", { Id: id })
|
|
15
|
+
post("kkt/correction-receipt/status/get", { Id: id }, { "X-Request-ID" => request_id })
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
end
|
|
@@ -3,14 +3,15 @@ module Cloudpayments
|
|
|
3
3
|
module Request
|
|
4
4
|
module Receipts
|
|
5
5
|
class Create < Cloudpayments::Client::Request::Base
|
|
6
|
-
attr_reader :params
|
|
6
|
+
attr_reader :params, :request_id
|
|
7
7
|
|
|
8
|
-
def initialize(params)
|
|
8
|
+
def initialize(params, request_id: SecureRandom.uuid)
|
|
9
9
|
@params = params
|
|
10
|
+
@request_id = request_id
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def call
|
|
13
|
-
post("kkt/receipt", params)
|
|
14
|
+
post("kkt/receipt", params, { "X-Request-ID" => request_id })
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -3,14 +3,15 @@ module Cloudpayments
|
|
|
3
3
|
module Request
|
|
4
4
|
module Receipts
|
|
5
5
|
class Get < Cloudpayments::Client::Request::Base
|
|
6
|
-
attr_reader :id
|
|
6
|
+
attr_reader :id, :request_id
|
|
7
7
|
|
|
8
|
-
def initialize(id)
|
|
8
|
+
def initialize(id, request_id: SecureRandom.uuid)
|
|
9
9
|
@id = id
|
|
10
|
+
@request_id = request_id
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def call
|
|
13
|
-
post("kkt/receipt/get", { Id: id })
|
|
14
|
+
post("kkt/receipt/get", { Id: id }, { "X-Request-ID" => request_id })
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -3,14 +3,15 @@ module Cloudpayments
|
|
|
3
3
|
module Request
|
|
4
4
|
module Receipts
|
|
5
5
|
class GetStatus < Cloudpayments::Client::Request::Base
|
|
6
|
-
attr_reader :id
|
|
6
|
+
attr_reader :id, :request_id
|
|
7
7
|
|
|
8
|
-
def initialize(id)
|
|
8
|
+
def initialize(id, request_id: SecureRandom.uuid)
|
|
9
9
|
@id = id
|
|
10
|
+
@request_id = request_id
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def call
|
|
13
|
-
post("kkt/receipt/status/get", { Id: id })
|
|
14
|
+
post("kkt/receipt/status/get", { Id: id }, { "X-Request-ID" => request_id })
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
module Cloudpayments
|
|
2
2
|
module Connection
|
|
3
|
-
def post(path, data = {})
|
|
4
|
-
request(:post, path, data)
|
|
3
|
+
def post(path, data = {}, headers = {})
|
|
4
|
+
request(:post, path, data, headers)
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
private
|
|
8
8
|
|
|
9
|
-
def request(method, path, data)
|
|
9
|
+
def request(method, path, data, headers = {})
|
|
10
10
|
connection.send(method) do |req|
|
|
11
11
|
req.url path
|
|
12
12
|
req.headers["Content-Type"] = "application/json"
|
|
13
|
+
req.headers.merge!(headers)
|
|
13
14
|
req.body = data.to_json
|
|
14
15
|
end
|
|
15
16
|
end
|
data/lib/cloudpayments.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloudpayments
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexey Spiridonov
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -24,7 +23,6 @@ dependencies:
|
|
|
24
23
|
- - "<"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '3'
|
|
27
|
-
description:
|
|
28
26
|
email: alex9spiridonov@gmail.com
|
|
29
27
|
executables: []
|
|
30
28
|
extensions: []
|
|
@@ -43,11 +41,11 @@ files:
|
|
|
43
41
|
- lib/cloudpayments/client/response/body.rb
|
|
44
42
|
- lib/cloudpayments/configuration.rb
|
|
45
43
|
- lib/cloudpayments/connection.rb
|
|
44
|
+
- lib/cloudpayments/version.rb
|
|
46
45
|
homepage: https://github.com/alex9spiridonov/cloudpayments
|
|
47
46
|
licenses:
|
|
48
47
|
- MIT
|
|
49
48
|
metadata: {}
|
|
50
|
-
post_install_message:
|
|
51
49
|
rdoc_options: []
|
|
52
50
|
require_paths:
|
|
53
51
|
- lib
|
|
@@ -62,8 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
62
60
|
- !ruby/object:Gem::Version
|
|
63
61
|
version: '0'
|
|
64
62
|
requirements: []
|
|
65
|
-
rubygems_version: 3.
|
|
66
|
-
signing_key:
|
|
63
|
+
rubygems_version: 3.6.9
|
|
67
64
|
specification_version: 4
|
|
68
65
|
summary: Сloudpayments API wrapper
|
|
69
66
|
test_files: []
|