cloud_payments 1.0.2 → 1.1.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: 04fb941f12526716bc4134db20ccbde6b973f1f0cbd4cbdedb16f61a0a832907
4
- data.tar.gz: 195b80061bb94786f2520491a72d7ae3e01310309fcc2ff23ef656d82de494ee
3
+ metadata.gz: 18a3af691a696388ee8c524b24e8de18be07b14d45935ed2ddfe7ac66c2f5e04
4
+ data.tar.gz: 9640d2ef9dae3d7ec7048be44c80123ce4ff735059fa0209891d7482affe2131
5
5
  SHA512:
6
- metadata.gz: 84362d280a6c6f40e2929f88a2b2d0a30b24f1e544538fb9de349bc57fc4a9dde44fc3228d937063e3a991e0bd73f378eecb1da1dccfe18013f0d8b01cd6217b
7
- data.tar.gz: ebe23ab42b51850c0eb6836dc8edd52f79c94fa63da8396f91cf440e05c1a6941b79145946609294f2f92519761e11f43dcd7f68727600f0eee0137e234ff3fa
6
+ metadata.gz: 433286122b1d5dd9ed981ed9314f0dbdb21ccc4ccb7db1a3487201211543377ad4441e953125c810bf285a035c8cadac0d17143e141c381ed4a0589cd8b1d823
7
+ data.tar.gz: bd01fc125ddd8606b8570bffb804d72964f1442cb934140c75a39ac2e92861be925b5b997638ff433375af8ff7c71624c9fba1f6de33ffe0c379e6c8e7866956
data/bin/release ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bash
2
+
3
+ VERSION=$1
4
+
5
+ if [ -z $1 ] ; then
6
+ echo "Please provide version number: bin/release 1.0.0" && exit 1;
7
+ fi
8
+
9
+ printf "module CloudPayments\n VERSION = \"$VERSION\"\nend\n" > ./lib/cloud_payments/version.rb
10
+ bundle
11
+ git add Gemfile.lock lib/cloud_payments/version.rb
12
+ git commit -m "Bump version for $VERSION"
13
+ git push
14
+ git tag v$VERSION
15
+ git push --tags
16
+ gem build cloud_payments.gemspec
17
+ gem push "cloud_payments-$VERSION.gem"
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'faraday'
22
+ spec.add_dependency 'faraday', '< 2.0'
23
23
  spec.add_dependency 'multi_json', '~> 1.11'
24
24
  spec.add_dependency 'hashie', '~> 3.4'
25
25
 
@@ -16,7 +16,6 @@ module CloudPayments
16
16
  end
17
17
 
18
18
  def perform_request(path, params = nil)
19
- connection.basic_auth(config.public_key, config.secret_key)
20
19
  response = connection.post(path, (params ? convert_to_json(params) : nil), headers)
21
20
 
22
21
  Response.new(response.status, response.body, response.headers).tap do |response|
@@ -45,7 +44,10 @@ module CloudPayments
45
44
  end
46
45
 
47
46
  def build_connection
48
- Faraday::Connection.new(config.host, config.connection_options, &config.connection_block)
47
+ Faraday::Connection.new(config.host, config.connection_options) do |conn|
48
+ conn.request :basic_auth, config.public_key, config.secret_key
49
+ config.connection_block.call(conn) if config.connection_block
50
+ end
49
51
  end
50
52
  end
51
53
  end
@@ -47,6 +47,7 @@ module CloudPayments
47
47
  property :token
48
48
  property :apple_pay
49
49
  property :android_pay
50
+ property :escrow_accumulation_id
50
51
 
51
52
  def required_secure3d?
52
53
  false
@@ -1,4 +1,3 @@
1
- # frozen_string_literal: true
2
1
  module CloudPayments
3
- VERSION = '1.0.2'
2
+ VERSION = "1.1.0"
4
3
  end
@@ -43,7 +43,8 @@ describe CloudPayments::Transaction do
43
43
  refunded: false,
44
44
  card_holder_message: 'Payment successful',
45
45
  name: 'CARDHOLDER NAME',
46
- token: 'a4e67841-abb0-42de-a364-d1d8f9f4b3c0'
46
+ token: 'a4e67841-abb0-42de-a364-d1d8f9f4b3c0',
47
+ escrow_accumulation_id: '119d1f05-4fa8-4f35-85b6-09216a5a4fb6'
47
48
  } }
48
49
 
49
50
  specify{ expect(subject.id).to eq(504) }
@@ -82,6 +83,7 @@ describe CloudPayments::Transaction do
82
83
  specify{ expect(subject.name).to eq('CARDHOLDER NAME') }
83
84
  specify{ expect(subject.token).to eq('a4e67841-abb0-42de-a364-d1d8f9f4b3c0') }
84
85
  specify{ expect(subject.refunded).to eq(false) }
86
+ specify{ expect(subject.escrow_accumulation_id).to eq('119d1f05-4fa8-4f35-85b6-09216a5a4fb6') }
85
87
 
86
88
  context 'without any attributes' do
87
89
  let(:attributes){ {} }
@@ -3,9 +3,6 @@ require 'spec_helper'
3
3
 
4
4
  describe CloudPayments do
5
5
  describe '#config=' do
6
- before { @old_config = CloudPayments.config }
7
- after { CloudPayments.config = @old_config }
8
-
9
6
  specify{ expect{ CloudPayments.config = 'config' }.to change{ CloudPayments.config }.to('config') }
10
7
  end
11
8
 
@@ -41,7 +41,8 @@
41
41
  "ReasonCode":0,
42
42
  "CardHolderMessage":"Payment successful",
43
43
  "Name":"CARDHOLDER NAME",
44
- "Token":"a4e67841-abb0-42de-a364-d1d8f9f4b3c0"
44
+ "Token":"a4e67841-abb0-42de-a364-d1d8f9f4b3c0",
45
+ "EscrowAccumulationId": "119d1f05-4fa8-4f35-85b6-09216a5a4fb6"
45
46
  },
46
47
  "Success":true,
47
48
  "Message": null
@@ -41,7 +41,8 @@
41
41
  "ReasonCode":0,
42
42
  "CardHolderMessage":"Payment successful",
43
43
  "Name":"CARDHOLDER NAME",
44
- "Token":"a4e67841-abb0-42de-a364-d1d8f9f4b3c0"
44
+ "Token":"a4e67841-abb0-42de-a364-d1d8f9f4b3c0",
45
+ "EscrowAccumulationId": "119d1f05-4fa8-4f35-85b6-09216a5a4fb6"
45
46
  },
46
47
  "Success":true,
47
48
  "Message": null
data/spec/spec_helper.rb CHANGED
@@ -15,8 +15,10 @@ RSpec.configure do |config|
15
15
  config.mock_with :rspec
16
16
  config.include CloudPayments::RSpec::Helpers
17
17
 
18
- config.before :each do
19
- CloudPayments.configure do |c|
18
+ # these params are used in stubs, in basic auth
19
+ # see webmock_stub in spec/support/helpers.rb
20
+ def default_config
21
+ CloudPayments::Config.new do |c|
20
22
  c.public_key = 'user'
21
23
  c.secret_key = 'pass'
22
24
  c.host = 'http://localhost:9292'
@@ -24,4 +26,11 @@ RSpec.configure do |config|
24
26
  # c.raise_banking_errors = true
25
27
  end
26
28
  end
29
+
30
+ CloudPayments.config = default_config
31
+
32
+ config.after :each do
33
+ CloudPayments.config = default_config
34
+ CloudPayments.client = CloudPayments::Client.new
35
+ end
27
36
  end
metadata CHANGED
@@ -1,30 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - undr
8
8
  - kirillplatonov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-11 00:00:00.000000000 Z
12
+ date: 2021-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "<"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: '2.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "<"
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: '2.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: multi_json
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -85,7 +85,8 @@ description: CloudPayments ruby client
85
85
  email:
86
86
  - undr@yandex.ru
87
87
  - mail@kirillplatonov.com
88
- executables: []
88
+ executables:
89
+ - release
89
90
  extensions: []
90
91
  extra_rdoc_files: []
91
92
  files:
@@ -96,6 +97,7 @@ files:
96
97
  - LICENSE.txt
97
98
  - README.md
98
99
  - Rakefile
100
+ - bin/release
99
101
  - cloud_payments.gemspec
100
102
  - config.ru
101
103
  - lib/cloud_payments.rb
@@ -193,7 +195,7 @@ homepage: https://github.com/platmart/cloud_payments
193
195
  licenses:
194
196
  - MIT
195
197
  metadata: {}
196
- post_install_message:
198
+ post_install_message:
197
199
  rdoc_options: []
198
200
  require_paths:
199
201
  - lib
@@ -208,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
210
  - !ruby/object:Gem::Version
209
211
  version: '0'
210
212
  requirements: []
211
- rubygems_version: 3.1.2
212
- signing_key:
213
+ rubygems_version: 3.2.22
214
+ signing_key:
213
215
  specification_version: 4
214
216
  summary: CloudPayments ruby client
215
217
  test_files: