cloudpayments 0.3.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f307dc18eacad3758cfa4da4b48aff062e481a6d3f2e1d2f7aad4440dabc905c
4
- data.tar.gz: 7cac2424a2ba5d5f2ac497af45be548ff8dd83a33e797d5fa1bc20db2bcf22af
3
+ metadata.gz: 349f89dbce1afcabbca53d53b85ecde1c3bede1b5cc6612fa25535e6c8798740
4
+ data.tar.gz: '091e48f95944de49a2c2b799e9b7f050bfb58450d1a63f6d28a85b3673ec2f76'
5
5
  SHA512:
6
- metadata.gz: e493712612ea528c03e57ba7b597d0dffc8ca553e99133fa3a0502176ca5f1f3522bd8eeb84bde6ec910b569ccf86898b9de2ad05c917c4a8e4e850a64eb177b
7
- data.tar.gz: cb8285a9dccaadf001314facd5c323c8e3d6a13cbe410f5f574deb252f78116242ead6a0a3575fecd2741fc5a765441aa53ea1b392e8d42ecc6f8365d5be4daa
6
+ metadata.gz: 110a916c702106ca175b24323fe5b6c385d319215dc0aa9b0136864494c5b17cf7a3aad3d4d729f8456e548b18bb41f9553f707418dd91d05285f5c7d197edfd
7
+ data.tar.gz: e0d212362982353f35f5d180c7d88c9e60feceb8d1604117db2291d5617086cdbb26918286ce5eb64882a394bcba2b0bf8f74043b23a4b967ac7402fd78c6828
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
+ ```
@@ -15,9 +15,9 @@ module Cloudpayments
15
15
  end
16
16
 
17
17
  def connection
18
- conn = Faraday.new(config.base_url)
19
- conn.basic_auth(config.login, config.password)
20
- conn
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
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Spiridonov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-11-19 00:00:00.000000000 Z
12
- dependencies: []
13
- description:
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: 2.7.10
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.7.10
27
+ description:
14
28
  email: alex9spiridonov@gmail.com
15
29
  executables: []
16
30
  extensions: []
@@ -26,11 +40,11 @@ files:
26
40
  - lib/cloudpayments/client/response/body.rb
27
41
  - lib/cloudpayments/configuration.rb
28
42
  - lib/cloudpayments/connection.rb
29
- homepage: https://rubygems.org/gems/cloudpayments
43
+ homepage: https://github.com/alex9spiridonov/cloudpayments
30
44
  licenses:
31
45
  - MIT
32
46
  metadata: {}
33
- post_install_message:
47
+ post_install_message:
34
48
  rdoc_options: []
35
49
  require_paths:
36
50
  - lib
@@ -45,8 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
59
  - !ruby/object:Gem::Version
46
60
  version: '0'
47
61
  requirements: []
48
- rubygems_version: 3.0.6
49
- signing_key:
62
+ rubygems_version: 3.2.22
63
+ signing_key:
50
64
  specification_version: 4
51
65
  summary: Сloudpayments API wrapper
52
66
  test_files: []