checkout_sdk 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 1f336f8a32173480906f369d0007b45080387f90e81012b1ca3588648d7ac01d
4
- data.tar.gz: 6d0d240dbe5b15ec742a7a705d37caa415cbff32e88d2cdf9f7d7cfd90192a1e
2
+ SHA1:
3
+ metadata.gz: 619074f072079a4136b62f90dcdf3e9ba0f9f3fd
4
+ data.tar.gz: 0b2dabf17e561c4d40c63db7a9b1690822a3bce0
5
5
  SHA512:
6
- metadata.gz: 732900d2a15bf580cc601dabfd0aec31ded3dc13544bf7c66ba9b2379d4d0a87a1674a592bcf169bcf42fc8d6a120d3ee9138c6a5d029edad9136d23e2b52d16
7
- data.tar.gz: f2267a7bf7d4fa4e12ead080b9cbf30825a00f32b0b5ea0f07d331c2cdefcca613eef5f94a78bc77800e063ad8618144ecaafb26a5ae5f9b715bbe10257d6c8d
6
+ metadata.gz: cefed8d1d8cf7853c9bda436a867ac7a96746ea69991797364b7d29b65aca9c70f5cfb2788e8176268251d89af6ddcbd791ef5370678cfde95e18e675d7d828d
7
+ data.tar.gz: 9771f371fb8b6185e3e9cb382f086d589595e9e4893eb02c1da59ba9ad3f1e6eda3367bb4b264f014297d7e7ebe9c26af441ab458335e67033d4097dd1fd26ba
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- checkout_sdk (0.2.0)
5
- excon (~> 0.66.0)
4
+ checkout_sdk (0.2.1)
5
+ excon (>= 0.66, < 0.72)
6
6
  multi_json (~> 1.0)
7
7
 
8
8
  GEM
@@ -10,9 +10,9 @@ GEM
10
10
  specs:
11
11
  coderay (1.1.2)
12
12
  diff-lcs (1.3)
13
- excon (0.66.0)
13
+ excon (0.71.1)
14
14
  method_source (0.9.2)
15
- multi_json (1.13.1)
15
+ multi_json (1.14.1)
16
16
  pry (0.11.3)
17
17
  coderay (~> 1.1.0)
18
18
  method_source (~> 0.9.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CheckoutSdk
2
2
 
3
- You are reading documentation for version: 0.2.0
3
+ You are reading documentation for version: 0.2.1
4
4
 
5
5
  ## Installation
6
6
 
@@ -113,6 +113,20 @@ response.local_port # => 51601
113
113
  response.local_address # => "..."
114
114
  ```
115
115
 
116
+ #### NB: Using boolean/falsey values
117
+ ```ruby
118
+ # `nil` or empty strings
119
+ payment_request_source.capture = nil
120
+ payment_request_source.capture = ""
121
+ # will be stripped from API call
122
+
123
+ # but `false`, or 0
124
+ payment_request_source.capture = false
125
+ payment_request_source.capture = 0
126
+ # are retained and sent in request
127
+ ```
128
+ See [api_resource_spec](https://github.com/checkout/checkout-sdk-ruby/blob/master/spec/checkout_sdk/api_resource_spec.rb#L10-L24) for details
129
+
116
130
  ## Tests
117
131
 
118
132
  $ rspec
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "rspec", "~> 3.0"
21
21
  spec.add_development_dependency "pry", "~> 0.11.3"
22
22
  spec.add_dependency "multi_json", '~> 1.0'
23
- spec.add_dependency "excon", "~> 0.66.0"
23
+ spec.add_dependency "excon", ">= 0.66", "< 0.72"
24
24
  end
@@ -68,7 +68,7 @@ class CheckoutSdk::ApiResource
68
68
 
69
69
  def delete_blank(data_hash)
70
70
  data_hash.delete_if do |k, v|
71
- (v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && delete_blank(v).empty?
71
+ (v.respond_to?(:empty?) ? v.empty? : v.nil?) or v.instance_of?(Hash) && delete_blank(v).empty?
72
72
  end
73
73
  end
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module CheckoutSdk
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,13 +9,13 @@ RSpec.describe CheckoutSdk::ApiResource do
9
9
 
10
10
  describe "#request_payment" do
11
11
  let(:payment_request_source) { CheckoutSdk::PaymentRequestSource.new }
12
- let(:data) { { mock: true } }
12
+ let(:data) { { mock: true, mockfalse: false, mockzero: 0, mocknil: nil, mockempty: "" } }
13
13
 
14
14
  it "sends a POST request with correct params" do
15
15
  allow(payment_request_source).to receive(:data).and_return(data)
16
16
 
17
17
  expect(api_resource.checkout_connection).to receive(:post)
18
- .with({ body:"{\"mock\":true}",
18
+ .with({ body:"{\"mock\":true,\"mockfalse\":false,\"mockzero\":0}",
19
19
  headers:{"Authorization"=>"sk_test", "Content-Type"=>"application/json"},
20
20
  path:"/payments" })
21
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkout_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khalid Jazaerly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,16 +84,22 @@ dependencies:
84
84
  name: excon
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.66'
90
+ - - "<"
88
91
  - !ruby/object:Gem::Version
89
- version: 0.66.0
92
+ version: '0.72'
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
- - - "~>"
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0.66'
100
+ - - "<"
95
101
  - !ruby/object:Gem::Version
96
- version: 0.66.0
102
+ version: '0.72'
97
103
  description: A Ruby API wrapper for checkout.com.
98
104
  email:
99
105
  - khalid.jaz@gmail.com
@@ -146,7 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
152
  - !ruby/object:Gem::Version
147
153
  version: '0'
148
154
  requirements: []
149
- rubygems_version: 3.0.6
155
+ rubyforge_project:
156
+ rubygems_version: 2.5.2.3
150
157
  signing_key:
151
158
  specification_version: 4
152
159
  summary: A Ruby API wrapper for checkout.com.