spook_and_pay 0.2.7.alpha → 0.2.8.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spook_and_pay/providers/spreedly.rb +5 -2
- data/lib/spook_and_pay/submission_error.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70f586a365434836344fda5f592ed44905cbb09
|
4
|
+
data.tar.gz: 4749a977febe88ac2c2f4ea1b9cfc72f5da3eada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735b374fc353bfd752d89622d0e237ce408c1998613eeaa9e59412558da1c63395060decd0edbc910a80e35f0e2b24351deac5e54abc4552fe4eb1663db10f71
|
7
|
+
data.tar.gz: 813e6179d99ba8a8cf4a79120b08d3226c4dc80fe17300e8994062a8588a71c9bb65e9fbf5d0dcd9fcc0b48e803d45734d9945e02aa0727a3c1cd8752b82884c
|
@@ -207,7 +207,7 @@ module SpookAndPay
|
|
207
207
|
# Maps the error types from Spreedly's to the names used internally.
|
208
208
|
ERRORS = {
|
209
209
|
"errors.invalid" => :invalid,
|
210
|
-
"errors.blank" => :
|
210
|
+
"errors.blank" => :required,
|
211
211
|
"errors.expired" => :expired
|
212
212
|
}.freeze
|
213
213
|
|
@@ -258,13 +258,16 @@ module SpookAndPay
|
|
258
258
|
# @param Spreedly::CreditCard
|
259
259
|
# @return SpookAndPay::CreditCard
|
260
260
|
def coerce_credit_card(card)
|
261
|
+
expired = !card.errors.select {|e| e[:key] == 'errors.expired'}.empty?
|
262
|
+
|
261
263
|
fields = {
|
262
264
|
:card_type => card.card_type,
|
263
265
|
:number => card.number,
|
264
266
|
:name => card.full_name,
|
265
267
|
:expiration_month => card.month,
|
266
268
|
:expiration_year => card.year,
|
267
|
-
:valid => card.valid
|
269
|
+
:valid => card.valid?,
|
270
|
+
:expired => expired
|
268
271
|
}
|
269
272
|
|
270
273
|
SpookAndPay::CreditCard.new(self, card.token, fields, card)
|
@@ -16,12 +16,14 @@ module SpookAndPay
|
|
16
16
|
:number_required => "number is required",
|
17
17
|
:number_invalid => "number is invalid",
|
18
18
|
:number_too_short => "number must be between 12 and 19 digits",
|
19
|
+
:name_required => "name is required",
|
19
20
|
:type_not_accepted => "card type is not accepted by this merchant",
|
20
21
|
:expiration_month_invalid => "expiration month is invalid",
|
21
22
|
:expiration_month_expired => "expiration month has expired",
|
22
23
|
:expiration_year_invalid => "expiration year is invalid",
|
23
24
|
:expiration_year_expired => "expiration year has expired",
|
24
|
-
:cvv_invalid => "CVV must be three digits"
|
25
|
+
:cvv_invalid => "CVV must be three digits",
|
26
|
+
:cvv_required => "CVV is required"
|
25
27
|
},
|
26
28
|
:transaction => {
|
27
29
|
:cannot_capture => "must be authorized in order to capture funds",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spook_and_pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Sutton
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: braintree
|