affirm 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/affirm.gemspec +1 -1
- data/lib/affirm/errors/charge_error.rb +8 -1
- data/spec/charge_spec.rb +12 -0
- data/spec/fixtures/charges/duplicate_capture.json +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f638e6eed73ed23e64d833f61fee602aa1442a
|
4
|
+
data.tar.gz: aa1c16021a35a1a6321be3b63262f51c1860d231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72566a23520ae4fb8854c9309b844e1b635545cdb0419baf84fea574d6bac78ebb8918254259a3f22f2c570780760028b42e5806bf729e542b520df306dd4f3d
|
7
|
+
data.tar.gz: 878d556017ec38e215adc1de57d80a7bb04a30cda82b338a37ba38ca26b62ccf4dcaf2e772eeaf3a1f723d35bc64a97aa90c80b9e6773077a9ba0456802c3cd3
|
data/affirm.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = "affirm"
|
3
3
|
s.summary = "Affirm Ruby Client Library"
|
4
4
|
s.description = "Ruby client library for integrating with Affirm financing payments"
|
5
|
-
s.version = "1.1.
|
5
|
+
s.version = "1.1.1"
|
6
6
|
s.license = "Apache License Version 2.0"
|
7
7
|
s.author = "Reverb.com"
|
8
8
|
s.email = "dev@reverb.com"
|
data/spec/charge_spec.rb
CHANGED
@@ -124,6 +124,18 @@ describe Affirm::Charge do
|
|
124
124
|
it "raises a charge error" do
|
125
125
|
expect { charge.capture }.to raise_error(Affirm::ChargeError)
|
126
126
|
end
|
127
|
+
|
128
|
+
context "when the failed response is a duplicate capture" do
|
129
|
+
let(:response_code) { 400 }
|
130
|
+
let(:response_body) { load_fixture("charges/duplicate_capture.json") }
|
131
|
+
it "the raised error is a duplicate capture" do
|
132
|
+
begin
|
133
|
+
charge.capture
|
134
|
+
rescue Affirm::ChargeError => e
|
135
|
+
e.should be_duplicate_capture
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
127
139
|
end
|
128
140
|
end
|
129
141
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: affirm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reverb.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- spec/client_spec.rb
|
104
104
|
- spec/fixtures/charges/capture.json
|
105
105
|
- spec/fixtures/charges/create.json
|
106
|
+
- spec/fixtures/charges/duplicate_capture.json
|
106
107
|
- spec/fixtures/charges/invalid_request.json
|
107
108
|
- spec/fixtures/charges/refund.json
|
108
109
|
- spec/fixtures/charges/retrieve.json
|