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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bd84aa5f8a08e720cb7eb6140911be472d923ee
4
- data.tar.gz: c9345a68d16c46d723812c9934f561c3ce5513ec
3
+ metadata.gz: f70f586a365434836344fda5f592ed44905cbb09
4
+ data.tar.gz: 4749a977febe88ac2c2f4ea1b9cfc72f5da3eada
5
5
  SHA512:
6
- metadata.gz: 045d465056dce7c1025c4c04b7dca6e4f504b2203c86f3ea52b86f40ede6b919db556c312fe25b5477e47304846eb48e294ee94c9e3edaecec46354ea0d48106
7
- data.tar.gz: 7b9e0f4368ce879baf32b3a20f4b41ba1d1f3164ae3a44f69d83ffb7c0b6ab4a8835281da3aa67c9a80171a8f8a70dc7144a7d0473baf327c851b2286c3ac5c1
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" => :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.7.alpha
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-13 00:00:00.000000000 Z
12
+ date: 2014-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: braintree