yoomoney 0.2.0 → 0.4.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +5 -2
- data/lib/yoomoney/client.rb +10 -0
- data/lib/yoomoney/internal/transport/base_client.rb +6 -0
- data/lib/yoomoney/version.rb +1 -1
- data/rbi/yoomoney/client.rbi +5 -0
- data/rbi/yoomoney/internal/transport/base_client.rbi +5 -0
- data/sig/yoomoney/client.rbs +2 -0
- data/sig/yoomoney/internal/transport/base_client.rbs +2 -0
- 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: 7fc7cc115fd073113e5c5ddd6f74a1dc490e0eb17283cdc0ead7e84fff2c8c28
|
|
4
|
+
data.tar.gz: 758d082193bdc8e9927eab64242366e627b9f6ab180041d7805ee0ef0ab9ce5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5499ebb0a382b81f5e8ac81aa2c4b926e52745dc9f162418f00939eefb0ca71db17dfcf8d7277f22dec6145224eafc61294b011e7f2443d17290124672ec5731
|
|
7
|
+
data.tar.gz: 43206f99994d0cb058341d71613ba1a935cd62980a5d9004cf0240ae42d065d8df0de61a7cc87e89058748d66b5c2d97ae5b80e2e04b714d4c6ecac2abc8422c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 (2026-02-19)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/Hexlet/yoomoney-ruby/compare/v0.3.0...v0.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([c792fd8](https://github.com/Hexlet/yoomoney-ruby/commit/c792fd813fb0c1937753a2deda1c1d763af4081d))
|
|
10
|
+
|
|
11
|
+
## 0.3.0 (2026-02-19)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/Hexlet/yoomoney-ruby/compare/v0.2.0...v0.3.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** manual updates ([b75593c](https://github.com/Hexlet/yoomoney-ruby/commit/b75593cad51a278a820e8835964c489af6bbf25a))
|
|
18
|
+
* **api:** manual updates ([75047a6](https://github.com/Hexlet/yoomoney-ruby/commit/75047a6b38457301fa731534c18d49393af80be0))
|
|
19
|
+
|
|
3
20
|
## 0.2.0 (2026-02-14)
|
|
4
21
|
|
|
5
22
|
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Hexlet/yoomoney-ruby/compare/v0.1.0...v0.2.0)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "yoomoney", "~> 0.
|
|
18
|
+
gem "yoomoney", "~> 0.4.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -26,7 +26,10 @@ gem "yoomoney", "~> 0.2.0"
|
|
|
26
26
|
require "bundler/setup"
|
|
27
27
|
require "yoomoney"
|
|
28
28
|
|
|
29
|
-
yoomoney = Yoomoney::Client.new
|
|
29
|
+
yoomoney = Yoomoney::Client.new(
|
|
30
|
+
username: ENV["YOOMONEY_USERNAME"], # This is the default and can be omitted
|
|
31
|
+
password: ENV["YOOMONEY_PASSWORD"] # This is the default and can be omitted
|
|
32
|
+
)
|
|
30
33
|
|
|
31
34
|
payment = yoomoney.payments.create(amount: {currency: "RUB", value: "value"}, idempotence_key: "Idempotence-Key")
|
|
32
35
|
|
data/lib/yoomoney/client.rb
CHANGED
|
@@ -56,6 +56,16 @@ module Yoomoney
|
|
|
56
56
|
# @return [Yoomoney::Resources::Me]
|
|
57
57
|
attr_reader :me
|
|
58
58
|
|
|
59
|
+
# @api private
|
|
60
|
+
#
|
|
61
|
+
# @return [Hash{String=>String}]
|
|
62
|
+
private def auth_headers
|
|
63
|
+
return {} if @username.nil? || @password.nil?
|
|
64
|
+
|
|
65
|
+
base64_credentials = ["#{@username}:#{@password}"].pack("m0")
|
|
66
|
+
{"authorization" => "Basic #{base64_credentials}"}
|
|
67
|
+
end
|
|
68
|
+
|
|
59
69
|
# Creates and returns a new client for interacting with the API.
|
|
60
70
|
#
|
|
61
71
|
# @param username [String, nil] HTTP Basic аутентификация клиента ЮKassa (shopId) Defaults to
|
|
@@ -215,6 +215,11 @@ module Yoomoney
|
|
|
215
215
|
@max_retry_delay = max_retry_delay
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
+
# @api private
|
|
219
|
+
#
|
|
220
|
+
# @return [Hash{String=>String}]
|
|
221
|
+
private def auth_headers = {}
|
|
222
|
+
|
|
218
223
|
# @api private
|
|
219
224
|
#
|
|
220
225
|
# @return [String]
|
|
@@ -271,6 +276,7 @@ module Yoomoney
|
|
|
271
276
|
|
|
272
277
|
headers = Yoomoney::Internal::Util.normalized_headers(
|
|
273
278
|
@headers,
|
|
279
|
+
auth_headers,
|
|
274
280
|
req[:headers].to_h,
|
|
275
281
|
opts[:extra_headers].to_h
|
|
276
282
|
)
|
data/lib/yoomoney/version.rb
CHANGED
data/rbi/yoomoney/client.rbi
CHANGED
|
@@ -51,6 +51,11 @@ module Yoomoney
|
|
|
51
51
|
sig { returns(Yoomoney::Resources::Me) }
|
|
52
52
|
attr_reader :me
|
|
53
53
|
|
|
54
|
+
# @api private
|
|
55
|
+
sig { override.returns(T::Hash[String, String]) }
|
|
56
|
+
private def auth_headers
|
|
57
|
+
end
|
|
58
|
+
|
|
54
59
|
# Creates and returns a new client for interacting with the API.
|
|
55
60
|
sig do
|
|
56
61
|
params(
|
data/sig/yoomoney/client.rbs
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yoomoney
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yoomoney
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|