braintree 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -152,6 +152,7 @@ module Braintree
152
152
  CannotBeVoided = "91504"
153
153
  CannotRefundCredit = "91505"
154
154
  CannotRefundUnlessSettled = "91506"
155
+ CannotRefundWithSuspendedMerchantAccount = "91538"
155
156
  CannotSubmitForSettlement = "91507"
156
157
  CreditCardIsRequired = "91508"
157
158
  CustomFieldIsInvalid = "91526"
@@ -16,6 +16,7 @@ module Braintree
16
16
  end
17
17
 
18
18
  module Status
19
+ AuthorizationExpired = 'authorization_expired'
19
20
  Authorizing = 'authorizing'
20
21
  Authorized = 'authorized'
21
22
  GatewayRejected = 'gateway_rejected'
@@ -60,7 +60,8 @@ module Braintree
60
60
 
61
61
  key_value_fields :refund
62
62
 
63
- range_fields :amount, :created_at, :authorized_at, :failed_at, :gateway_rejected_at, :processor_declined_at,
63
+ range_fields :amount, :created_at, :authorization_expired_at, :authorized_at,
64
+ :failed_at, :gateway_rejected_at, :processor_declined_at,
64
65
  :settled_at, :submitted_for_settlement_at, :voided_at
65
66
  end
66
67
  end
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 8
5
- Tiny = 0
4
+ Minor = 9
5
+ Tiny = 1
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
8
8
  end
@@ -263,9 +263,9 @@ describe Braintree::Transaction, "search" do
263
263
  transaction = Braintree::Transaction.sale!(
264
264
  :amount => Braintree::Test::TransactionAmounts::Authorize,
265
265
  :credit_card => {
266
- :number => Braintree::Test::CreditCardNumbers::Visa,
267
- :expiration_date => "05/12"
268
- }
266
+ :number => Braintree::Test::CreditCardNumbers::Visa,
267
+ :expiration_date => "05/12"
268
+ }
269
269
  )
270
270
 
271
271
  collection = Braintree::Transaction.search do |search|
@@ -290,6 +290,15 @@ describe Braintree::Transaction, "search" do
290
290
  collection.maximum_size.should == 0
291
291
  end
292
292
 
293
+ it "finds expired authorizations by status" do
294
+ collection = Braintree::Transaction.search do |search|
295
+ search.status.in Braintree::Transaction::Status::AuthorizationExpired
296
+ end
297
+
298
+ collection.maximum_size.should > 0
299
+ collection.first.status.should == Braintree::Transaction::Status::AuthorizationExpired
300
+ end
301
+
293
302
  it "searches on source" do
294
303
  transaction = Braintree::Transaction.sale!(
295
304
  :amount => Braintree::Test::TransactionAmounts::Authorize,
@@ -626,6 +635,27 @@ describe Braintree::Transaction, "search" do
626
635
  collection.first.id.should == transaction.id
627
636
  end
628
637
 
638
+ it "finds expired authorizations in a given range" do
639
+ collection = Braintree::Transaction.search do |search|
640
+ search.authorization_expired_at.between(
641
+ Date.today - 2,
642
+ Date.today - 1
643
+ )
644
+ end
645
+
646
+ collection.maximum_size.should == 0
647
+
648
+ collection = Braintree::Transaction.search do |search|
649
+ search.authorization_expired_at.between(
650
+ Date.today - 1,
651
+ Date.today + 1
652
+ )
653
+ end
654
+
655
+ collection.maximum_size.should > 0
656
+ collection.first.status.should == Braintree::Transaction::Status::AuthorizationExpired
657
+ end
658
+
629
659
  it "finds transactions gateway_rejected in a given range" do
630
660
  old_merchant = Braintree::Configuration.merchant_id
631
661
  old_public_key = Braintree::Configuration.public_key
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 41
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 8
9
- - 0
10
- version: 2.8.0
8
+ - 9
9
+ - 1
10
+ version: 2.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Braintree Payment Solutions
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-22 00:00:00 -06:00
18
+ date: 2011-03-25 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency