cloudpayments 0.3.1 → 0.4.1
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/README.md +58 -0
- data/lib/cloudpayments/client/request/receipts/correction/create.rb +21 -0
- data/lib/cloudpayments/client/request/receipts/correction/get.rb +21 -0
- data/lib/cloudpayments/client/request/receipts/correction/get_status.rb +21 -0
- data/lib/cloudpayments/connection.rb +3 -3
- data/lib/cloudpayments.rb +3 -0
- metadata +26 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34375a70e47d3fe33b24b207d430db57bbfba877f195202931609ea0c7ea2e67
|
|
4
|
+
data.tar.gz: 390825dcb308c8d90c79b270ec928a5fa9171beb4581011eb1eb98baf1784d1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5c07b9d0e5554d60b0385e2c26ffbe9e94b93a7f97e6e478bf88df2a0644713d260c96e5b185a298c1d6aa39607d62a74e1af7d0d8bcb9c2e765c29c05d9d6f
|
|
7
|
+
data.tar.gz: 7388f1836c960801f449b924cd329f6ed1646684fcaeccc399daa8d4189d1c67d6179ffb7f8cefa72f5731f73d13771cb07b8909fd29b36fa8d7b544f259414d
|
data/README.md
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Cloudpayments
|
|
2
|
+
|
|
3
|
+
A Ruby wrapper for cloudpayments
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```rb
|
|
8
|
+
# Gemfile
|
|
9
|
+
gem "cloudpayments", "~> 0.4.0"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ bundle install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage:
|
|
17
|
+
|
|
18
|
+
```rb
|
|
19
|
+
# config/initializers/cloudpayments.rb
|
|
20
|
+
require "cloudpayments"
|
|
21
|
+
|
|
22
|
+
Cloudpayments.configure do |config|
|
|
23
|
+
config.login = "login"
|
|
24
|
+
config.password = "password"
|
|
25
|
+
end
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```rb
|
|
29
|
+
request_params = {
|
|
30
|
+
"Inn" => inn,
|
|
31
|
+
"Type" => format_receipt_type,
|
|
32
|
+
"CustomerReceipt" => {
|
|
33
|
+
"Items" => [{
|
|
34
|
+
"Label" => label,
|
|
35
|
+
"Quantity" => 1,
|
|
36
|
+
"Amount" => amount,
|
|
37
|
+
"Price" => amount,
|
|
38
|
+
"Vat" => "",
|
|
39
|
+
"Method" => 1,
|
|
40
|
+
"Object" => 10
|
|
41
|
+
}],
|
|
42
|
+
"calculationPlace" => calculation_place,
|
|
43
|
+
"TaxationSystem" => 0,
|
|
44
|
+
"Email" => email,
|
|
45
|
+
"Amounts" => {
|
|
46
|
+
"Electronic" => amount
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
response = Cloudpayments::Client::Request::Receipts::Create.call(request_params)
|
|
52
|
+
response.success?
|
|
53
|
+
|
|
54
|
+
receipt_ofd_id = response.body.model_id
|
|
55
|
+
|
|
56
|
+
response = Cloudpayments::Client::Request::Receipts::GetStatus.call(receipt_ofd_id)
|
|
57
|
+
status = response.body.model
|
|
58
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Cloudpayments
|
|
2
|
+
module Client
|
|
3
|
+
module Request
|
|
4
|
+
module Receipts
|
|
5
|
+
module Correction
|
|
6
|
+
class Create < Cloudpayments::Client::Request::Base
|
|
7
|
+
attr_reader :params
|
|
8
|
+
|
|
9
|
+
def initialize(params)
|
|
10
|
+
@params = params
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def call
|
|
14
|
+
post("kkt/correction-receipt", params)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Cloudpayments
|
|
2
|
+
module Client
|
|
3
|
+
module Request
|
|
4
|
+
module Receipts
|
|
5
|
+
module Correction
|
|
6
|
+
class Get < Cloudpayments::Client::Request::Base
|
|
7
|
+
attr_reader :id
|
|
8
|
+
|
|
9
|
+
def initialize(id)
|
|
10
|
+
@id = id
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def call
|
|
14
|
+
post("kkt/correction-receipt/get", { Id: id })
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Cloudpayments
|
|
2
|
+
module Client
|
|
3
|
+
module Request
|
|
4
|
+
module Receipts
|
|
5
|
+
module Correction
|
|
6
|
+
class GetStatus < Cloudpayments::Client::Request::Base
|
|
7
|
+
attr_reader :id
|
|
8
|
+
|
|
9
|
+
def initialize(id)
|
|
10
|
+
@id = id
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def call
|
|
14
|
+
post("kkt/correction-receipt/status/get", { Id: id })
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -15,9 +15,9 @@ module Cloudpayments
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def connection
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
Faraday.new(config.base_url) do |conn|
|
|
19
|
+
conn.request :authorization, :basic, config.login, config.password
|
|
20
|
+
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def config
|
data/lib/cloudpayments.rb
CHANGED
|
@@ -8,6 +8,9 @@ require_relative "cloudpayments/client/request/base"
|
|
|
8
8
|
require_relative "cloudpayments/client/request/receipts/create"
|
|
9
9
|
require_relative "cloudpayments/client/request/receipts/get_status"
|
|
10
10
|
require_relative "cloudpayments/client/request/receipts/get"
|
|
11
|
+
require_relative "cloudpayments/client/request/receipts/correction/create"
|
|
12
|
+
require_relative "cloudpayments/client/request/receipts/correction/get_status"
|
|
13
|
+
require_relative "cloudpayments/client/request/receipts/correction/get"
|
|
11
14
|
|
|
12
15
|
module Cloudpayments
|
|
13
16
|
class << self
|
metadata
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloudpayments
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexey Spiridonov
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
|
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: faraday
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "<"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '3'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "<"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '3'
|
|
27
|
+
description:
|
|
14
28
|
email: alex9spiridonov@gmail.com
|
|
15
29
|
executables: []
|
|
16
30
|
extensions: []
|
|
@@ -19,6 +33,9 @@ files:
|
|
|
19
33
|
- README.md
|
|
20
34
|
- lib/cloudpayments.rb
|
|
21
35
|
- lib/cloudpayments/client/request/base.rb
|
|
36
|
+
- lib/cloudpayments/client/request/receipts/correction/create.rb
|
|
37
|
+
- lib/cloudpayments/client/request/receipts/correction/get.rb
|
|
38
|
+
- lib/cloudpayments/client/request/receipts/correction/get_status.rb
|
|
22
39
|
- lib/cloudpayments/client/request/receipts/create.rb
|
|
23
40
|
- lib/cloudpayments/client/request/receipts/get.rb
|
|
24
41
|
- lib/cloudpayments/client/request/receipts/get_status.rb
|
|
@@ -26,11 +43,11 @@ files:
|
|
|
26
43
|
- lib/cloudpayments/client/response/body.rb
|
|
27
44
|
- lib/cloudpayments/configuration.rb
|
|
28
45
|
- lib/cloudpayments/connection.rb
|
|
29
|
-
homepage: https://
|
|
46
|
+
homepage: https://github.com/alex9spiridonov/cloudpayments
|
|
30
47
|
licenses:
|
|
31
48
|
- MIT
|
|
32
49
|
metadata: {}
|
|
33
|
-
post_install_message:
|
|
50
|
+
post_install_message:
|
|
34
51
|
rdoc_options: []
|
|
35
52
|
require_paths:
|
|
36
53
|
- lib
|
|
@@ -45,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
45
62
|
- !ruby/object:Gem::Version
|
|
46
63
|
version: '0'
|
|
47
64
|
requirements: []
|
|
48
|
-
rubygems_version: 3.
|
|
49
|
-
signing_key:
|
|
65
|
+
rubygems_version: 3.2.22
|
|
66
|
+
signing_key:
|
|
50
67
|
specification_version: 4
|
|
51
68
|
summary: Сloudpayments API wrapper
|
|
52
69
|
test_files: []
|