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 +5 -5
- data/Gemfile.lock +4 -4
- data/README.md +15 -1
- data/checkout_sdk.gemspec +1 -1
- data/lib/checkout_sdk/api_resource.rb +1 -1
- data/lib/checkout_sdk/version.rb +1 -1
- data/spec/checkout_sdk/api_resource_spec.rb +2 -2
- metadata +14 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 619074f072079a4136b62f90dcdf3e9ba0f9f3fd
|
4
|
+
data.tar.gz: 0b2dabf17e561c4d40c63db7a9b1690822a3bce0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cefed8d1d8cf7853c9bda436a867ac7a96746ea69991797364b7d29b65aca9c70f5cfb2788e8176268251d89af6ddcbd791ef5370678cfde95e18e675d7d828d
|
7
|
+
data.tar.gz: 9771f371fb8b6185e3e9cb382f086d589595e9e4893eb02c1da59ba9ad3f1e6eda3367bb4b264f014297d7e7ebe9c26af441ab458335e67033d4097dd1fd26ba
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
checkout_sdk (0.2.
|
5
|
-
excon (
|
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.
|
13
|
+
excon (0.71.1)
|
14
14
|
method_source (0.9.2)
|
15
|
-
multi_json (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.
|
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
|
data/checkout_sdk.gemspec
CHANGED
@@ -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", "
|
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? :
|
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
|
data/lib/checkout_sdk/version.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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.
|
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
|
-
|
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.
|