braintree 4.13.0 → 4.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/braintree/credit_card.rb +13 -0
- data/lib/braintree/credit_card_gateway.rb +15 -3
- data/lib/braintree/payment_method_gateway.rb +15 -3
- data/lib/braintree/test/nonce.rb +1 -0
- data/lib/braintree/test/venmo_sdk.rb +2 -0
- data/lib/braintree/transaction/credit_card_details.rb +3 -0
- data/lib/braintree/transaction/local_payment_details.rb +2 -0
- data/lib/braintree/transaction/payment_receipt/card_present_data.rb +36 -0
- data/lib/braintree/transaction/payment_receipt/merchant_address.rb +19 -0
- data/lib/braintree/transaction/payment_receipt.rb +31 -0
- data/lib/braintree/transaction/us_bank_account_details.rb +1 -0
- data/lib/braintree/transaction.rb +7 -4
- data/lib/braintree/transaction_gateway.rb +15 -3
- data/lib/braintree/transaction_search.rb +6 -5
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/webhook_notification.rb +1 -0
- data/lib/braintree/webhook_testing_gateway.rb +17 -0
- data/lib/braintree.rb +3 -0
- data/spec/integration/braintree/add_on_spec.rb +9 -9
- data/spec/integration/braintree/address_spec.rb +69 -69
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +8 -8
- data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
- data/spec/integration/braintree/credit_card_spec.rb +223 -223
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
- data/spec/integration/braintree/credit_card_verification_spec.rb +52 -52
- data/spec/integration/braintree/customer_search_spec.rb +20 -20
- data/spec/integration/braintree/customer_spec.rb +313 -313
- data/spec/integration/braintree/disbursement_spec.rb +2 -2
- data/spec/integration/braintree/discount_spec.rb +9 -9
- data/spec/integration/braintree/dispute_spec.rb +87 -87
- data/spec/integration/braintree/document_upload_spec.rb +17 -17
- data/spec/integration/braintree/error_codes_spec.rb +2 -2
- data/spec/integration/braintree/http_spec.rb +28 -28
- data/spec/integration/braintree/merchant_account_spec.rb +127 -127
- data/spec/integration/braintree/merchant_spec.rb +103 -103
- data/spec/integration/braintree/oauth_spec.rb +61 -61
- data/spec/integration/braintree/payment_method_nonce_spec.rb +73 -73
- data/spec/integration/braintree/payment_method_spec.rb +389 -389
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +78 -78
- data/spec/integration/braintree/paypal_account_spec.rb +38 -38
- data/spec/integration/braintree/plan_spec.rb +15 -15
- data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
- data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
- data/spec/integration/braintree/subscription_spec.rb +364 -364
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +19 -19
- data/spec/integration/braintree/transaction_line_item_spec.rb +6 -6
- data/spec/integration/braintree/transaction_search_spec.rb +198 -165
- data/spec/integration/braintree/transaction_spec.rb +1319 -1151
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
- data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
- data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
- data/spec/spec_helper.rb +9 -8
- data/spec/unit/braintree/address_spec.rb +8 -8
- data/spec/unit/braintree/base_module_spec.rb +4 -4
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +57 -57
- data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
- data/spec/unit/braintree/credit_card_spec.rb +31 -29
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +28 -28
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
- data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
- data/spec/unit/braintree/customer_spec.rb +41 -40
- data/spec/unit/braintree/digest_spec.rb +5 -5
- data/spec/unit/braintree/disbursement_spec.rb +11 -11
- data/spec/unit/braintree/dispute_search_spec.rb +2 -2
- data/spec/unit/braintree/dispute_spec.rb +56 -56
- data/spec/unit/braintree/document_upload_spec.rb +8 -8
- data/spec/unit/braintree/enriched_customer_data_spec.rb +2 -2
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +9 -9
- data/spec/unit/braintree/http_spec.rb +8 -8
- data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
- data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
- data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
- data/spec/unit/braintree/merchant_account_spec.rb +4 -4
- data/spec/unit/braintree/modification_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
- data/spec/unit/braintree/payment_method_spec.rb +19 -19
- data/spec/unit/braintree/paypal_account_spec.rb +4 -4
- data/spec/unit/braintree/resource_collection_spec.rb +7 -7
- data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
- data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
- data/spec/unit/braintree/signature_service_spec.rb +2 -2
- data/spec/unit/braintree/subscription_search_spec.rb +17 -17
- data/spec/unit/braintree/subscription_spec.rb +8 -8
- data/spec/unit/braintree/successful_result_spec.rb +5 -5
- data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
- data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
- data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
- data/spec/unit/braintree/transaction/payment_receipt_spec.rb +73 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +9 -6
- data/spec/unit/braintree/transaction_search_spec.rb +2 -2
- data/spec/unit/braintree/transaction_spec.rb +101 -93
- data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
- data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
- data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +7 -7
- data/spec/unit/braintree/util_spec.rb +27 -27
- data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
- data/spec/unit/braintree/validation_error_spec.rb +4 -4
- data/spec/unit/braintree/venmo_profile_data_spec.rb +5 -5
- data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
- data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
- data/spec/unit/braintree/xml/parser_spec.rb +8 -8
- data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
- data/spec/unit/braintree/xml_spec.rb +17 -17
- data/spec/unit/braintree_spec.rb +2 -2
- metadata +7 -2
@@ -8,7 +8,7 @@ describe Braintree::Transaction, "search" do
|
|
8
8
|
search.billing_first_name.is "thisnameisnotreal"
|
9
9
|
end
|
10
10
|
|
11
|
-
collection.maximum_size.
|
11
|
+
expect(collection.maximum_size).to eq(0)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "can search on text fields" do
|
@@ -109,14 +109,14 @@ describe Braintree::Transaction, "search" do
|
|
109
109
|
search.id.is transaction.id
|
110
110
|
search.send(criterion).is value
|
111
111
|
end
|
112
|
-
collection.maximum_size.
|
113
|
-
collection.first.id.
|
112
|
+
expect(collection.maximum_size).to eq(1)
|
113
|
+
expect(collection.first.id).to eq(transaction.id)
|
114
114
|
|
115
115
|
collection = Braintree::Transaction.search do |search|
|
116
116
|
search.id.is transaction.id
|
117
117
|
search.send(criterion).is("invalid_attribute")
|
118
118
|
end
|
119
|
-
collection.
|
119
|
+
expect(collection).to be_empty
|
120
120
|
end
|
121
121
|
|
122
122
|
collection = Braintree::Transaction.search do |search|
|
@@ -126,8 +126,8 @@ describe Braintree::Transaction, "search" do
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
-
collection.maximum_size.
|
130
|
-
collection.first.id.
|
129
|
+
expect(collection.maximum_size).to eq(1)
|
130
|
+
expect(collection.first.id).to eq(transaction.id)
|
131
131
|
end
|
132
132
|
|
133
133
|
it "searches on users" do
|
@@ -140,7 +140,7 @@ describe Braintree::Transaction, "search" do
|
|
140
140
|
search.user.is "integration_user_public_id"
|
141
141
|
end
|
142
142
|
|
143
|
-
collection.any? { |t| t.id == transaction.id }.
|
143
|
+
expect(collection.any? { |t| t.id == transaction.id }).to eq(true)
|
144
144
|
end
|
145
145
|
|
146
146
|
it "searches on paypal transactions" do
|
@@ -157,8 +157,8 @@ describe Braintree::Transaction, "search" do
|
|
157
157
|
search.paypal_payer_email.is paypal_details.payer_email
|
158
158
|
end
|
159
159
|
|
160
|
-
collection.maximum_size.
|
161
|
-
collection.first.id.
|
160
|
+
expect(collection.maximum_size).to eq(1)
|
161
|
+
expect(collection.first.id).to eq(transaction.id)
|
162
162
|
end
|
163
163
|
|
164
164
|
it "searches on store_id" do
|
@@ -170,8 +170,8 @@ describe Braintree::Transaction, "search" do
|
|
170
170
|
search.store_ids.in store_id
|
171
171
|
end
|
172
172
|
|
173
|
-
collection.maximum_size.
|
174
|
-
collection.first.id.
|
173
|
+
expect(collection.maximum_size).to eq(1)
|
174
|
+
expect(collection.first.id).to eq(transaction_id)
|
175
175
|
end
|
176
176
|
|
177
177
|
it "searches on reason_code" do
|
@@ -182,9 +182,9 @@ describe Braintree::Transaction, "search" do
|
|
182
182
|
search.reason_code.in reason_code
|
183
183
|
end
|
184
184
|
|
185
|
-
collection.maximum_size.
|
186
|
-
collection.first.id.
|
187
|
-
collection.first.ach_return_responses.first[:reason_code].
|
185
|
+
expect(collection.maximum_size).to eq(1)
|
186
|
+
expect(collection.first.id).to eq(transaction_id)
|
187
|
+
expect(collection.first.ach_return_responses.first[:reason_code]).to eq("R01")
|
188
188
|
end
|
189
189
|
|
190
190
|
it "searches on reason_codes" do
|
@@ -194,7 +194,7 @@ describe Braintree::Transaction, "search" do
|
|
194
194
|
search.reason_code.is reason_code
|
195
195
|
end
|
196
196
|
|
197
|
-
collection.maximum_size.
|
197
|
+
expect(collection.maximum_size).to eq(2)
|
198
198
|
end
|
199
199
|
|
200
200
|
context "multiple value fields" do
|
@@ -212,21 +212,21 @@ describe Braintree::Transaction, "search" do
|
|
212
212
|
search.created_using.is Braintree::Transaction::CreatedUsing::FullInformation
|
213
213
|
end
|
214
214
|
|
215
|
-
collection.maximum_size.
|
215
|
+
expect(collection.maximum_size).to eq(1)
|
216
216
|
|
217
217
|
collection = Braintree::Transaction.search do |search|
|
218
218
|
search.id.is transaction.id
|
219
219
|
search.created_using.in Braintree::Transaction::CreatedUsing::FullInformation, Braintree::Transaction::CreatedUsing::Token
|
220
220
|
end
|
221
221
|
|
222
|
-
collection.maximum_size.
|
222
|
+
expect(collection.maximum_size).to eq(1)
|
223
223
|
|
224
224
|
collection = Braintree::Transaction.search do |search|
|
225
225
|
search.id.is transaction.id
|
226
226
|
search.created_using.is Braintree::Transaction::CreatedUsing::Token
|
227
227
|
end
|
228
228
|
|
229
|
-
collection.maximum_size.
|
229
|
+
expect(collection.maximum_size).to eq(0)
|
230
230
|
end
|
231
231
|
|
232
232
|
it "searches on credit_card_customer_location" do
|
@@ -243,21 +243,21 @@ describe Braintree::Transaction, "search" do
|
|
243
243
|
search.credit_card_customer_location.is Braintree::CreditCard::CustomerLocation::US
|
244
244
|
end
|
245
245
|
|
246
|
-
collection.maximum_size.
|
246
|
+
expect(collection.maximum_size).to eq(1)
|
247
247
|
|
248
248
|
collection = Braintree::Transaction.search do |search|
|
249
249
|
search.id.is transaction.id
|
250
250
|
search.credit_card_customer_location.in Braintree::CreditCard::CustomerLocation::US, Braintree::CreditCard::CustomerLocation::International
|
251
251
|
end
|
252
252
|
|
253
|
-
collection.maximum_size.
|
253
|
+
expect(collection.maximum_size).to eq(1)
|
254
254
|
|
255
255
|
collection = Braintree::Transaction.search do |search|
|
256
256
|
search.id.is transaction.id
|
257
257
|
search.credit_card_customer_location.is Braintree::CreditCard::CustomerLocation::International
|
258
258
|
end
|
259
259
|
|
260
|
-
collection.maximum_size.
|
260
|
+
expect(collection.maximum_size).to eq(0)
|
261
261
|
end
|
262
262
|
|
263
263
|
it "searches on merchant_account_id" do
|
@@ -274,21 +274,21 @@ describe Braintree::Transaction, "search" do
|
|
274
274
|
search.merchant_account_id.is transaction.merchant_account_id
|
275
275
|
end
|
276
276
|
|
277
|
-
collection.maximum_size.
|
277
|
+
expect(collection.maximum_size).to eq(1)
|
278
278
|
|
279
279
|
collection = Braintree::Transaction.search do |search|
|
280
280
|
search.id.is transaction.id
|
281
281
|
search.merchant_account_id.in transaction.merchant_account_id, "bogus_merchant_account_id"
|
282
282
|
end
|
283
283
|
|
284
|
-
collection.maximum_size.
|
284
|
+
expect(collection.maximum_size).to eq(1)
|
285
285
|
|
286
286
|
collection = Braintree::Transaction.search do |search|
|
287
287
|
search.id.is transaction.id
|
288
288
|
search.merchant_account_id.is "bogus_merchant_account_id"
|
289
289
|
end
|
290
290
|
|
291
|
-
collection.maximum_size.
|
291
|
+
expect(collection.maximum_size).to eq(0)
|
292
292
|
end
|
293
293
|
|
294
294
|
it "searches on credit_card_card_type" do
|
@@ -305,28 +305,28 @@ describe Braintree::Transaction, "search" do
|
|
305
305
|
search.credit_card_card_type.is Braintree::CreditCard::CardType::Visa
|
306
306
|
end
|
307
307
|
|
308
|
-
collection.maximum_size.
|
308
|
+
expect(collection.maximum_size).to eq(1)
|
309
309
|
|
310
310
|
collection = Braintree::Transaction.search do |search|
|
311
311
|
search.id.is transaction.id
|
312
312
|
search.credit_card_card_type.is transaction.credit_card_details.card_type
|
313
313
|
end
|
314
314
|
|
315
|
-
collection.maximum_size.
|
315
|
+
expect(collection.maximum_size).to eq(1)
|
316
316
|
|
317
317
|
collection = Braintree::Transaction.search do |search|
|
318
318
|
search.id.is transaction.id
|
319
319
|
search.credit_card_card_type.in Braintree::CreditCard::CardType::Visa, Braintree::CreditCard::CardType::MasterCard
|
320
320
|
end
|
321
321
|
|
322
|
-
collection.maximum_size.
|
322
|
+
expect(collection.maximum_size).to eq(1)
|
323
323
|
|
324
324
|
collection = Braintree::Transaction.search do |search|
|
325
325
|
search.id.is transaction.id
|
326
326
|
search.credit_card_card_type.is Braintree::CreditCard::CardType::MasterCard
|
327
327
|
end
|
328
328
|
|
329
|
-
collection.maximum_size.
|
329
|
+
expect(collection.maximum_size).to eq(0)
|
330
330
|
end
|
331
331
|
|
332
332
|
it "searches for an Elo card" do
|
@@ -345,7 +345,7 @@ describe Braintree::Transaction, "search" do
|
|
345
345
|
search.credit_card_card_type.is Braintree::CreditCard::CardType::Elo
|
346
346
|
end
|
347
347
|
|
348
|
-
collection.maximum_size.
|
348
|
+
expect(collection.maximum_size).to eq(1)
|
349
349
|
end
|
350
350
|
|
351
351
|
it "searches by payment instrument type CreditCardDetail" do
|
@@ -362,8 +362,8 @@ describe Braintree::Transaction, "search" do
|
|
362
362
|
search.payment_instrument_type.in ["CreditCardDetail"]
|
363
363
|
end
|
364
364
|
|
365
|
-
collection.first.id.
|
366
|
-
collection.first.payment_instrument_type.
|
365
|
+
expect(collection.first.id).to eq(transaction.id)
|
366
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::CreditCard)
|
367
367
|
end
|
368
368
|
|
369
369
|
it "searches by payment instrument type PayPal" do
|
@@ -377,8 +377,8 @@ describe Braintree::Transaction, "search" do
|
|
377
377
|
search.payment_instrument_type.in ["PayPalDetail"]
|
378
378
|
end
|
379
379
|
|
380
|
-
collection.first.id.
|
381
|
-
collection.first.payment_instrument_type.
|
380
|
+
expect(collection.first.id).to eq(transaction.id)
|
381
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::PayPalAccount)
|
382
382
|
end
|
383
383
|
|
384
384
|
it "searches by payment instrument type LocalPaymentDetail" do
|
@@ -392,8 +392,8 @@ describe Braintree::Transaction, "search" do
|
|
392
392
|
search.payment_instrument_type.in ["LocalPaymentDetail"]
|
393
393
|
end
|
394
394
|
|
395
|
-
collection.first.id.
|
396
|
-
collection.first.payment_instrument_type.
|
395
|
+
expect(collection.first.id).to eq(transaction.id)
|
396
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::LocalPayment)
|
397
397
|
end
|
398
398
|
|
399
399
|
it "searches by payment instrument type SepaDebitAccountDetail" do
|
@@ -408,8 +408,8 @@ describe Braintree::Transaction, "search" do
|
|
408
408
|
search.payment_instrument_type.in ["SEPADebitAccountDetail"]
|
409
409
|
end
|
410
410
|
|
411
|
-
collection.first.id.
|
412
|
-
collection.first.payment_instrument_type.
|
411
|
+
expect(collection.first.id).to eq(transaction.id)
|
412
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::SepaDirectDebitAccount)
|
413
413
|
end
|
414
414
|
|
415
415
|
it "searches by paypal_v2_order_id" do
|
@@ -424,8 +424,8 @@ describe Braintree::Transaction, "search" do
|
|
424
424
|
search.sepa_debit_paypal_v2_order_id.is transaction.sepa_direct_debit_account_details.paypal_v2_order_id
|
425
425
|
end
|
426
426
|
|
427
|
-
collection.first.id.
|
428
|
-
collection.first.payment_instrument_type.
|
427
|
+
expect(collection.first.id).to eq(transaction.id)
|
428
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::SepaDirectDebitAccount)
|
429
429
|
end
|
430
430
|
|
431
431
|
it "searches by payment instrument type ApplePay" do
|
@@ -439,8 +439,8 @@ describe Braintree::Transaction, "search" do
|
|
439
439
|
search.payment_instrument_type.in ["ApplePayDetail"]
|
440
440
|
end
|
441
441
|
|
442
|
-
collection.first.id.
|
443
|
-
collection.first.payment_instrument_type.
|
442
|
+
expect(collection.first.id).to eq(transaction.id)
|
443
|
+
expect(collection.first.payment_instrument_type).to eq(Braintree::PaymentInstrumentType::ApplePayCard)
|
444
444
|
end
|
445
445
|
|
446
446
|
it "searches on status" do
|
@@ -457,21 +457,21 @@ describe Braintree::Transaction, "search" do
|
|
457
457
|
search.status.is Braintree::Transaction::Status::Authorized
|
458
458
|
end
|
459
459
|
|
460
|
-
collection.maximum_size.
|
460
|
+
expect(collection.maximum_size).to eq(1)
|
461
461
|
|
462
462
|
collection = Braintree::Transaction.search do |search|
|
463
463
|
search.id.is transaction.id
|
464
464
|
search.status.in Braintree::Transaction::Status::Authorized, Braintree::Transaction::Status::ProcessorDeclined
|
465
465
|
end
|
466
466
|
|
467
|
-
collection.maximum_size.
|
467
|
+
expect(collection.maximum_size).to eq(1)
|
468
468
|
|
469
469
|
collection = Braintree::Transaction.search do |search|
|
470
470
|
search.id.is transaction.id
|
471
471
|
search.status.is Braintree::Transaction::Status::ProcessorDeclined
|
472
472
|
end
|
473
473
|
|
474
|
-
collection.maximum_size.
|
474
|
+
expect(collection.maximum_size).to eq(0)
|
475
475
|
end
|
476
476
|
|
477
477
|
it "searches for settlement_confirmed transaction" do
|
@@ -481,8 +481,8 @@ describe Braintree::Transaction, "search" do
|
|
481
481
|
search.id.is transaction_id
|
482
482
|
end
|
483
483
|
|
484
|
-
collection.maximum_size.
|
485
|
-
collection.first.id.
|
484
|
+
expect(collection.maximum_size).to eq(1)
|
485
|
+
expect(collection.first.id).to eq(transaction_id)
|
486
486
|
end
|
487
487
|
|
488
488
|
it "finds expired authorizations by status" do
|
@@ -490,8 +490,8 @@ describe Braintree::Transaction, "search" do
|
|
490
490
|
search.status.in Braintree::Transaction::Status::AuthorizationExpired
|
491
491
|
end
|
492
492
|
|
493
|
-
collection.maximum_size.
|
494
|
-
collection.first.status.
|
493
|
+
expect(collection.maximum_size).to be > 0
|
494
|
+
expect(collection.first.status).to eq(Braintree::Transaction::Status::AuthorizationExpired)
|
495
495
|
end
|
496
496
|
|
497
497
|
it "searches on source" do
|
@@ -508,21 +508,21 @@ describe Braintree::Transaction, "search" do
|
|
508
508
|
search.source.is Braintree::Transaction::Source::Api
|
509
509
|
end
|
510
510
|
|
511
|
-
collection.maximum_size.
|
511
|
+
expect(collection.maximum_size).to eq(1)
|
512
512
|
|
513
513
|
collection = Braintree::Transaction.search do |search|
|
514
514
|
search.id.is transaction.id
|
515
515
|
search.source.in Braintree::Transaction::Source::Api, Braintree::Transaction::Source::ControlPanel
|
516
516
|
end
|
517
517
|
|
518
|
-
collection.maximum_size.
|
518
|
+
expect(collection.maximum_size).to eq(1)
|
519
519
|
|
520
520
|
collection = Braintree::Transaction.search do |search|
|
521
521
|
search.id.is transaction.id
|
522
522
|
search.source.is Braintree::Transaction::Source::ControlPanel
|
523
523
|
end
|
524
524
|
|
525
|
-
collection.maximum_size.
|
525
|
+
expect(collection.maximum_size).to eq(0)
|
526
526
|
end
|
527
527
|
|
528
528
|
it "searches on type" do
|
@@ -554,7 +554,7 @@ describe Braintree::Transaction, "search" do
|
|
554
554
|
search.type.is Braintree::Transaction::Type::Credit
|
555
555
|
end
|
556
556
|
|
557
|
-
collection.maximum_size.
|
557
|
+
expect(collection.maximum_size).to eq(2)
|
558
558
|
|
559
559
|
collection = Braintree::Transaction.search do |search|
|
560
560
|
search.credit_card_cardholder_name.is cardholder_name
|
@@ -562,8 +562,8 @@ describe Braintree::Transaction, "search" do
|
|
562
562
|
search.refund.is true
|
563
563
|
end
|
564
564
|
|
565
|
-
collection.maximum_size.
|
566
|
-
collection.first.id.
|
565
|
+
expect(collection.maximum_size).to eq(1)
|
566
|
+
expect(collection.first.id).to eq(refund_transaction.id)
|
567
567
|
|
568
568
|
collection = Braintree::Transaction.search do |search|
|
569
569
|
search.credit_card_cardholder_name.is cardholder_name
|
@@ -571,8 +571,8 @@ describe Braintree::Transaction, "search" do
|
|
571
571
|
search.refund.is false
|
572
572
|
end
|
573
573
|
|
574
|
-
collection.maximum_size.
|
575
|
-
collection.first.id.
|
574
|
+
expect(collection.maximum_size).to eq(1)
|
575
|
+
expect(collection.first.id).to eq(credit_transaction.id)
|
576
576
|
end
|
577
577
|
|
578
578
|
it "searches on store_ids" do
|
@@ -584,8 +584,8 @@ describe Braintree::Transaction, "search" do
|
|
584
584
|
search.store_ids.in store_ids
|
585
585
|
end
|
586
586
|
|
587
|
-
collection.maximum_size.
|
588
|
-
collection.first.id.
|
587
|
+
expect(collection.maximum_size).to eq(1)
|
588
|
+
expect(collection.first.id).to eq(transaction_id)
|
589
589
|
end
|
590
590
|
|
591
591
|
it "searches on reason_codes for 2 items" do
|
@@ -595,7 +595,7 @@ describe Braintree::Transaction, "search" do
|
|
595
595
|
search.reason_code.in reason_code
|
596
596
|
end
|
597
597
|
|
598
|
-
collection.maximum_size.
|
598
|
+
expect(collection.maximum_size).to eq(2)
|
599
599
|
end
|
600
600
|
|
601
601
|
it "searches on a reason_code" do
|
@@ -606,10 +606,35 @@ describe Braintree::Transaction, "search" do
|
|
606
606
|
search.reason_code.in reason_code
|
607
607
|
end
|
608
608
|
|
609
|
-
collection.maximum_size.
|
610
|
-
collection.first.id.
|
609
|
+
expect(collection.maximum_size).to eq(1)
|
610
|
+
expect(collection.first.id).to eq(transaction_id)
|
611
611
|
end
|
612
612
|
|
613
|
+
xit "searches on debit_network" do
|
614
|
+
transaction = Braintree::Transaction.sale!(
|
615
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
616
|
+
:merchant_account_id => SpecHelper::PinlessDebitMerchantAccountId,
|
617
|
+
:currency_iso_code => "USD",
|
618
|
+
:payment_method_nonce => Braintree::Test::Nonce::TransactablePinlessDebitVisa,
|
619
|
+
:options => {
|
620
|
+
:submit_for_settlement => true
|
621
|
+
},
|
622
|
+
)
|
623
|
+
|
624
|
+
collection = Braintree::Transaction.search do |search|
|
625
|
+
search.id.is transaction.id
|
626
|
+
search.credit_card_card_type.is Braintree::CreditCard::CardType::Visa
|
627
|
+
end
|
628
|
+
|
629
|
+
expect(collection.maximum_size).to be > 0
|
630
|
+
|
631
|
+
collection = Braintree::Transaction.search do |search|
|
632
|
+
search.id.is transaction.id
|
633
|
+
search.debit_network.in Braintree::CreditCard::DebitNetwork::All
|
634
|
+
end
|
635
|
+
|
636
|
+
expect(collection.maximum_size).to be > 0
|
637
|
+
end
|
613
638
|
end
|
614
639
|
|
615
640
|
context "invalid search" do
|
@@ -621,6 +646,14 @@ describe Braintree::Transaction, "search" do
|
|
621
646
|
end
|
622
647
|
end.to raise_error(ArgumentError)
|
623
648
|
end
|
649
|
+
|
650
|
+
it "raises an exception on invalid debit network" do
|
651
|
+
expect do
|
652
|
+
collection = Braintree::Transaction.search do |search|
|
653
|
+
search.debit_network.is "invalid_network"
|
654
|
+
end
|
655
|
+
end.to raise_error(ArgumentError)
|
656
|
+
end
|
624
657
|
end
|
625
658
|
|
626
659
|
context "range fields" do
|
@@ -639,31 +672,31 @@ describe Braintree::Transaction, "search" do
|
|
639
672
|
search.amount.between "500.00", "1500.00"
|
640
673
|
end
|
641
674
|
|
642
|
-
collection.maximum_size.
|
643
|
-
collection.first.id.
|
675
|
+
expect(collection.maximum_size).to eq(1)
|
676
|
+
expect(collection.first.id).to eq(transaction.id)
|
644
677
|
|
645
678
|
collection = Braintree::Transaction.search do |search|
|
646
679
|
search.id.is transaction.id
|
647
680
|
search.amount >= "500.00"
|
648
681
|
end
|
649
682
|
|
650
|
-
collection.maximum_size.
|
651
|
-
collection.first.id.
|
683
|
+
expect(collection.maximum_size).to eq(1)
|
684
|
+
expect(collection.first.id).to eq(transaction.id)
|
652
685
|
|
653
686
|
collection = Braintree::Transaction.search do |search|
|
654
687
|
search.id.is transaction.id
|
655
688
|
search.amount <= "1500.00"
|
656
689
|
end
|
657
690
|
|
658
|
-
collection.maximum_size.
|
659
|
-
collection.first.id.
|
691
|
+
expect(collection.maximum_size).to eq(1)
|
692
|
+
expect(collection.first.id).to eq(transaction.id)
|
660
693
|
|
661
694
|
collection = Braintree::Transaction.search do |search|
|
662
695
|
search.id.is transaction.id
|
663
696
|
search.amount.between "500.00", "900.00"
|
664
697
|
end
|
665
698
|
|
666
|
-
collection.maximum_size.
|
699
|
+
expect(collection.maximum_size).to eq(0)
|
667
700
|
end
|
668
701
|
|
669
702
|
it "can also take BigDecimal for amount" do
|
@@ -680,7 +713,7 @@ describe Braintree::Transaction, "search" do
|
|
680
713
|
search.amount <= BigDecimal("1000.00")
|
681
714
|
end
|
682
715
|
|
683
|
-
collection.maximum_size.
|
716
|
+
expect(collection.maximum_size).to eq(1)
|
684
717
|
end
|
685
718
|
end
|
686
719
|
|
@@ -695,7 +728,7 @@ describe Braintree::Transaction, "search" do
|
|
695
728
|
)
|
696
729
|
|
697
730
|
created_at = transaction.created_at
|
698
|
-
created_at.
|
731
|
+
expect(created_at).to be_utc
|
699
732
|
|
700
733
|
collection = Braintree::Transaction.search do |search|
|
701
734
|
search.id.is transaction.id
|
@@ -705,24 +738,24 @@ describe Braintree::Transaction, "search" do
|
|
705
738
|
)
|
706
739
|
end
|
707
740
|
|
708
|
-
collection.maximum_size.
|
709
|
-
collection.first.id.
|
741
|
+
expect(collection.maximum_size).to eq(1)
|
742
|
+
expect(collection.first.id).to eq(transaction.id)
|
710
743
|
|
711
744
|
collection = Braintree::Transaction.search do |search|
|
712
745
|
search.id.is transaction.id
|
713
746
|
search.created_at >= created_at - 1
|
714
747
|
end
|
715
748
|
|
716
|
-
collection.maximum_size.
|
717
|
-
collection.first.id.
|
749
|
+
expect(collection.maximum_size).to eq(1)
|
750
|
+
expect(collection.first.id).to eq(transaction.id)
|
718
751
|
|
719
752
|
collection = Braintree::Transaction.search do |search|
|
720
753
|
search.id.is transaction.id
|
721
754
|
search.created_at <= created_at + 1
|
722
755
|
end
|
723
756
|
|
724
|
-
collection.maximum_size.
|
725
|
-
collection.first.id.
|
757
|
+
expect(collection.maximum_size).to eq(1)
|
758
|
+
expect(collection.first.id).to eq(transaction.id)
|
726
759
|
|
727
760
|
collection = Braintree::Transaction.search do |search|
|
728
761
|
search.id.is transaction.id
|
@@ -732,15 +765,15 @@ describe Braintree::Transaction, "search" do
|
|
732
765
|
)
|
733
766
|
end
|
734
767
|
|
735
|
-
collection.maximum_size.
|
768
|
+
expect(collection.maximum_size).to eq(0)
|
736
769
|
|
737
770
|
collection = Braintree::Transaction.search do |search|
|
738
771
|
search.id.is transaction.id
|
739
772
|
search.created_at.is created_at
|
740
773
|
end
|
741
774
|
|
742
|
-
collection.maximum_size.
|
743
|
-
collection.first.id.
|
775
|
+
expect(collection.maximum_size).to eq(1)
|
776
|
+
expect(collection.first.id).to eq(transaction.id)
|
744
777
|
end
|
745
778
|
|
746
779
|
it "searches on created_at in local time" do
|
@@ -762,24 +795,24 @@ describe Braintree::Transaction, "search" do
|
|
762
795
|
)
|
763
796
|
end
|
764
797
|
|
765
|
-
collection.maximum_size.
|
766
|
-
collection.first.id.
|
798
|
+
expect(collection.maximum_size).to eq(1)
|
799
|
+
expect(collection.first.id).to eq(transaction.id)
|
767
800
|
|
768
801
|
collection = Braintree::Transaction.search do |search|
|
769
802
|
search.id.is transaction.id
|
770
803
|
search.created_at >= now - 60
|
771
804
|
end
|
772
805
|
|
773
|
-
collection.maximum_size.
|
774
|
-
collection.first.id.
|
806
|
+
expect(collection.maximum_size).to eq(1)
|
807
|
+
expect(collection.first.id).to eq(transaction.id)
|
775
808
|
|
776
809
|
collection = Braintree::Transaction.search do |search|
|
777
810
|
search.id.is transaction.id
|
778
811
|
search.created_at <= now + 60
|
779
812
|
end
|
780
813
|
|
781
|
-
collection.maximum_size.
|
782
|
-
collection.first.id.
|
814
|
+
expect(collection.maximum_size).to eq(1)
|
815
|
+
expect(collection.first.id).to eq(transaction.id)
|
783
816
|
|
784
817
|
collection = Braintree::Transaction.search do |search|
|
785
818
|
search.id.is transaction.id
|
@@ -789,7 +822,7 @@ describe Braintree::Transaction, "search" do
|
|
789
822
|
)
|
790
823
|
end
|
791
824
|
|
792
|
-
collection.maximum_size.
|
825
|
+
expect(collection.maximum_size).to eq(0)
|
793
826
|
end
|
794
827
|
|
795
828
|
it "searches on created_at with dates" do
|
@@ -809,8 +842,8 @@ describe Braintree::Transaction, "search" do
|
|
809
842
|
)
|
810
843
|
end
|
811
844
|
|
812
|
-
collection.maximum_size.
|
813
|
-
collection.first.id.
|
845
|
+
expect(collection.maximum_size).to eq(1)
|
846
|
+
expect(collection.first.id).to eq(transaction.id)
|
814
847
|
end
|
815
848
|
end
|
816
849
|
|
@@ -822,7 +855,7 @@ describe Braintree::Transaction, "search" do
|
|
822
855
|
search.ach_return_responses_created_at.between(DateTime.now - 1.0, DateTime.now + 1.0)
|
823
856
|
end
|
824
857
|
|
825
|
-
date_search.maximum_size.
|
858
|
+
expect(date_search.maximum_size).to eq(2)
|
826
859
|
end
|
827
860
|
|
828
861
|
it "it does not find records not within date range of the custom field" do
|
@@ -832,7 +865,7 @@ describe Braintree::Transaction, "search" do
|
|
832
865
|
search.ach_return_responses_created_at.between(DateTime.now + 1.0, DateTime.now - 1.0)
|
833
866
|
end
|
834
867
|
|
835
|
-
neg_date_search.maximum_size.
|
868
|
+
expect(neg_date_search.maximum_size).to eq(0)
|
836
869
|
end
|
837
870
|
end
|
838
871
|
|
@@ -849,24 +882,24 @@ describe Braintree::Transaction, "search" do
|
|
849
882
|
)
|
850
883
|
end
|
851
884
|
|
852
|
-
collection.maximum_size.
|
853
|
-
collection.first.id.
|
885
|
+
expect(collection.maximum_size).to eq(1)
|
886
|
+
expect(collection.first.id).to eq(transaction_id)
|
854
887
|
|
855
888
|
collection = Braintree::Transaction.search do |search|
|
856
889
|
search.id.is transaction_id
|
857
890
|
search.disbursement_date >= disbursement_time - 1
|
858
891
|
end
|
859
892
|
|
860
|
-
collection.maximum_size.
|
861
|
-
collection.first.id.
|
893
|
+
expect(collection.maximum_size).to eq(1)
|
894
|
+
expect(collection.first.id).to eq(transaction_id)
|
862
895
|
|
863
896
|
collection = Braintree::Transaction.search do |search|
|
864
897
|
search.id.is transaction_id
|
865
898
|
search.disbursement_date <= disbursement_time + 1
|
866
899
|
end
|
867
900
|
|
868
|
-
collection.maximum_size.
|
869
|
-
collection.first.id.
|
901
|
+
expect(collection.maximum_size).to eq(1)
|
902
|
+
expect(collection.first.id).to eq(transaction_id)
|
870
903
|
|
871
904
|
collection = Braintree::Transaction.search do |search|
|
872
905
|
search.id.is transaction_id
|
@@ -876,15 +909,15 @@ describe Braintree::Transaction, "search" do
|
|
876
909
|
)
|
877
910
|
end
|
878
911
|
|
879
|
-
collection.maximum_size.
|
912
|
+
expect(collection.maximum_size).to eq(0)
|
880
913
|
|
881
914
|
collection = Braintree::Transaction.search do |search|
|
882
915
|
search.id.is transaction_id
|
883
916
|
search.disbursement_date.is disbursement_time
|
884
917
|
end
|
885
918
|
|
886
|
-
collection.maximum_size.
|
887
|
-
collection.first.id.
|
919
|
+
expect(collection.maximum_size).to eq(1)
|
920
|
+
expect(collection.first.id).to eq(transaction_id)
|
888
921
|
end
|
889
922
|
|
890
923
|
it "searches on disbursement_date in local time" do
|
@@ -899,24 +932,24 @@ describe Braintree::Transaction, "search" do
|
|
899
932
|
)
|
900
933
|
end
|
901
934
|
|
902
|
-
collection.maximum_size.
|
903
|
-
collection.first.id.
|
935
|
+
expect(collection.maximum_size).to eq(1)
|
936
|
+
expect(collection.first.id).to eq(transaction_id)
|
904
937
|
|
905
938
|
collection = Braintree::Transaction.search do |search|
|
906
939
|
search.id.is transaction_id
|
907
940
|
search.disbursement_date >= now - 60
|
908
941
|
end
|
909
942
|
|
910
|
-
collection.maximum_size.
|
911
|
-
collection.first.id.
|
943
|
+
expect(collection.maximum_size).to eq(1)
|
944
|
+
expect(collection.first.id).to eq(transaction_id)
|
912
945
|
|
913
946
|
collection = Braintree::Transaction.search do |search|
|
914
947
|
search.id.is transaction_id
|
915
948
|
search.disbursement_date <= now + 60
|
916
949
|
end
|
917
950
|
|
918
|
-
collection.maximum_size.
|
919
|
-
collection.first.id.
|
951
|
+
expect(collection.maximum_size).to eq(1)
|
952
|
+
expect(collection.first.id).to eq(transaction_id)
|
920
953
|
|
921
954
|
collection = Braintree::Transaction.search do |search|
|
922
955
|
search.id.is transaction_id
|
@@ -926,7 +959,7 @@ describe Braintree::Transaction, "search" do
|
|
926
959
|
)
|
927
960
|
end
|
928
961
|
|
929
|
-
collection.maximum_size.
|
962
|
+
expect(collection.maximum_size).to eq(0)
|
930
963
|
end
|
931
964
|
|
932
965
|
it "searches on disbursement_date with date ranges" do
|
@@ -941,8 +974,8 @@ describe Braintree::Transaction, "search" do
|
|
941
974
|
)
|
942
975
|
end
|
943
976
|
|
944
|
-
collection.maximum_size.
|
945
|
-
collection.first.id.
|
977
|
+
expect(collection.maximum_size).to eq(1)
|
978
|
+
expect(collection.first.id).to eq(transaction_id)
|
946
979
|
end
|
947
980
|
end
|
948
981
|
|
@@ -982,32 +1015,32 @@ describe Braintree::Transaction, "search" do
|
|
982
1015
|
)
|
983
1016
|
end
|
984
1017
|
|
985
|
-
collection.maximum_size.
|
986
|
-
collection.first.id.
|
1018
|
+
expect(collection.maximum_size).to eq(1)
|
1019
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
987
1020
|
|
988
1021
|
collection = Braintree::Transaction.search do |search|
|
989
1022
|
search.id.is @disputed_transaction.id
|
990
1023
|
search.dispute_date >= @disputed_time - 1
|
991
1024
|
end
|
992
1025
|
|
993
|
-
collection.maximum_size.
|
994
|
-
collection.first.id.
|
1026
|
+
expect(collection.maximum_size).to eq(1)
|
1027
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
995
1028
|
|
996
1029
|
collection = Braintree::Transaction.search do |search|
|
997
1030
|
search.id.is @disputed_transaction.id
|
998
1031
|
search.dispute_date <= @disputed_time + 1
|
999
1032
|
end
|
1000
1033
|
|
1001
|
-
collection.maximum_size.
|
1002
|
-
collection.first.id.
|
1034
|
+
expect(collection.maximum_size).to eq(1)
|
1035
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1003
1036
|
|
1004
1037
|
collection = Braintree::Transaction.search do |search|
|
1005
1038
|
search.id.is @disputed_transaction.id
|
1006
1039
|
search.dispute_date.is @disputed_time
|
1007
1040
|
end
|
1008
1041
|
|
1009
|
-
collection.maximum_size.
|
1010
|
-
collection.first.id.
|
1042
|
+
expect(collection.maximum_size).to eq(1)
|
1043
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1011
1044
|
end
|
1012
1045
|
|
1013
1046
|
it "searches on dispute_date in local time" do
|
@@ -1021,23 +1054,23 @@ describe Braintree::Transaction, "search" do
|
|
1021
1054
|
)
|
1022
1055
|
end
|
1023
1056
|
|
1024
|
-
collection.maximum_size.
|
1025
|
-
collection.first.id.
|
1057
|
+
expect(collection.maximum_size).to eq(1)
|
1058
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1026
1059
|
|
1027
1060
|
collection = Braintree::Transaction.search do |search|
|
1028
1061
|
search.id.is @disputed_transaction.id
|
1029
1062
|
search.dispute_date >= now - 60
|
1030
1063
|
end
|
1031
1064
|
|
1032
|
-
collection.maximum_size.
|
1033
|
-
collection.first.id.
|
1065
|
+
expect(collection.maximum_size).to eq(1)
|
1066
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1034
1067
|
|
1035
1068
|
collection = Braintree::Transaction.search do |search|
|
1036
1069
|
search.id.is @disputed_transaction.id
|
1037
1070
|
search.dispute_date <= now + 60
|
1038
1071
|
end
|
1039
1072
|
|
1040
|
-
collection.maximum_size.
|
1073
|
+
expect(collection.maximum_size).to eq(1)
|
1041
1074
|
end
|
1042
1075
|
|
1043
1076
|
it "searches on dispute_date with date ranges" do
|
@@ -1049,8 +1082,8 @@ describe Braintree::Transaction, "search" do
|
|
1049
1082
|
)
|
1050
1083
|
end
|
1051
1084
|
|
1052
|
-
collection.maximum_size.
|
1053
|
-
collection.first.id.
|
1085
|
+
expect(collection.maximum_size).to eq(1)
|
1086
|
+
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1054
1087
|
end
|
1055
1088
|
end
|
1056
1089
|
|
@@ -1072,7 +1105,7 @@ describe Braintree::Transaction, "search" do
|
|
1072
1105
|
)
|
1073
1106
|
end
|
1074
1107
|
|
1075
|
-
collection.maximum_size.
|
1108
|
+
expect(collection.maximum_size).to eq(0)
|
1076
1109
|
|
1077
1110
|
collection = Braintree::Transaction.search do |search|
|
1078
1111
|
search.id.is transaction.id
|
@@ -1082,8 +1115,8 @@ describe Braintree::Transaction, "search" do
|
|
1082
1115
|
)
|
1083
1116
|
end
|
1084
1117
|
|
1085
|
-
collection.maximum_size.
|
1086
|
-
collection.first.id.
|
1118
|
+
expect(collection.maximum_size).to eq(1)
|
1119
|
+
expect(collection.first.id).to eq(transaction.id)
|
1087
1120
|
end
|
1088
1121
|
|
1089
1122
|
it "finds transactions failed in a given range" do
|
@@ -1103,7 +1136,7 @@ describe Braintree::Transaction, "search" do
|
|
1103
1136
|
)
|
1104
1137
|
end
|
1105
1138
|
|
1106
|
-
collection.maximum_size.
|
1139
|
+
expect(collection.maximum_size).to eq(0)
|
1107
1140
|
|
1108
1141
|
collection = Braintree::Transaction.search do |search|
|
1109
1142
|
search.id.is transaction.id
|
@@ -1113,8 +1146,8 @@ describe Braintree::Transaction, "search" do
|
|
1113
1146
|
)
|
1114
1147
|
end
|
1115
1148
|
|
1116
|
-
collection.maximum_size.
|
1117
|
-
collection.first.id.
|
1149
|
+
expect(collection.maximum_size).to eq(1)
|
1150
|
+
expect(collection.first.id).to eq(transaction.id)
|
1118
1151
|
end
|
1119
1152
|
|
1120
1153
|
it "finds expired authorizations in a given range" do
|
@@ -1125,7 +1158,7 @@ describe Braintree::Transaction, "search" do
|
|
1125
1158
|
)
|
1126
1159
|
end
|
1127
1160
|
|
1128
|
-
collection.maximum_size.
|
1161
|
+
expect(collection.maximum_size).to eq(0)
|
1129
1162
|
|
1130
1163
|
collection = Braintree::Transaction.search do |search|
|
1131
1164
|
search.authorization_expired_at.between(
|
@@ -1134,8 +1167,8 @@ describe Braintree::Transaction, "search" do
|
|
1134
1167
|
)
|
1135
1168
|
end
|
1136
1169
|
|
1137
|
-
collection.maximum_size.
|
1138
|
-
collection.first.status.
|
1170
|
+
expect(collection.maximum_size).to be > 0
|
1171
|
+
expect(collection.first.status).to eq(Braintree::Transaction::Status::AuthorizationExpired)
|
1139
1172
|
end
|
1140
1173
|
|
1141
1174
|
it "finds transactions gateway_rejected in a given range" do
|
@@ -1165,7 +1198,7 @@ describe Braintree::Transaction, "search" do
|
|
1165
1198
|
)
|
1166
1199
|
end
|
1167
1200
|
|
1168
|
-
collection.maximum_size.
|
1201
|
+
expect(collection.maximum_size).to eq(0)
|
1169
1202
|
|
1170
1203
|
collection = Braintree::Transaction.search do |search|
|
1171
1204
|
search.id.is transaction.id
|
@@ -1175,8 +1208,8 @@ describe Braintree::Transaction, "search" do
|
|
1175
1208
|
)
|
1176
1209
|
end
|
1177
1210
|
|
1178
|
-
collection.maximum_size.
|
1179
|
-
collection.first.id.
|
1211
|
+
expect(collection.maximum_size).to eq(1)
|
1212
|
+
expect(collection.first.id).to eq(transaction.id)
|
1180
1213
|
ensure
|
1181
1214
|
Braintree::Configuration.merchant_id = old_merchant
|
1182
1215
|
Braintree::Configuration.public_key = old_public_key
|
@@ -1201,7 +1234,7 @@ describe Braintree::Transaction, "search" do
|
|
1201
1234
|
)
|
1202
1235
|
end
|
1203
1236
|
|
1204
|
-
collection.maximum_size.
|
1237
|
+
expect(collection.maximum_size).to eq(0)
|
1205
1238
|
|
1206
1239
|
collection = Braintree::Transaction.search do |search|
|
1207
1240
|
search.id.is transaction.id
|
@@ -1211,8 +1244,8 @@ describe Braintree::Transaction, "search" do
|
|
1211
1244
|
)
|
1212
1245
|
end
|
1213
1246
|
|
1214
|
-
collection.maximum_size.
|
1215
|
-
collection.first.id.
|
1247
|
+
expect(collection.maximum_size).to eq(1)
|
1248
|
+
expect(collection.first.id).to eq(transaction.id)
|
1216
1249
|
end
|
1217
1250
|
|
1218
1251
|
it "finds transactions settled in a given range" do
|
@@ -1237,7 +1270,7 @@ describe Braintree::Transaction, "search" do
|
|
1237
1270
|
)
|
1238
1271
|
end
|
1239
1272
|
|
1240
|
-
collection.maximum_size.
|
1273
|
+
expect(collection.maximum_size).to eq(0)
|
1241
1274
|
|
1242
1275
|
collection = Braintree::Transaction.search do |search|
|
1243
1276
|
search.id.is transaction.id
|
@@ -1247,8 +1280,8 @@ describe Braintree::Transaction, "search" do
|
|
1247
1280
|
)
|
1248
1281
|
end
|
1249
1282
|
|
1250
|
-
collection.maximum_size.
|
1251
|
-
collection.first.id.
|
1283
|
+
expect(collection.maximum_size).to eq(1)
|
1284
|
+
expect(collection.first.id).to eq(transaction.id)
|
1252
1285
|
end
|
1253
1286
|
|
1254
1287
|
it "finds transactions submitted for settlement in a given range" do
|
@@ -1271,7 +1304,7 @@ describe Braintree::Transaction, "search" do
|
|
1271
1304
|
)
|
1272
1305
|
end
|
1273
1306
|
|
1274
|
-
collection.maximum_size.
|
1307
|
+
expect(collection.maximum_size).to eq(0)
|
1275
1308
|
|
1276
1309
|
collection = Braintree::Transaction.search do |search|
|
1277
1310
|
search.id.is transaction.id
|
@@ -1281,8 +1314,8 @@ describe Braintree::Transaction, "search" do
|
|
1281
1314
|
)
|
1282
1315
|
end
|
1283
1316
|
|
1284
|
-
collection.maximum_size.
|
1285
|
-
collection.first.id.
|
1317
|
+
expect(collection.maximum_size).to eq(1)
|
1318
|
+
expect(collection.first.id).to eq(transaction.id)
|
1286
1319
|
end
|
1287
1320
|
|
1288
1321
|
it "finds transactions voided in a given range" do
|
@@ -1303,7 +1336,7 @@ describe Braintree::Transaction, "search" do
|
|
1303
1336
|
)
|
1304
1337
|
end
|
1305
1338
|
|
1306
|
-
collection.maximum_size.
|
1339
|
+
expect(collection.maximum_size).to eq(0)
|
1307
1340
|
|
1308
1341
|
collection = Braintree::Transaction.search do |search|
|
1309
1342
|
search.id.is transaction.id
|
@@ -1313,8 +1346,8 @@ describe Braintree::Transaction, "search" do
|
|
1313
1346
|
)
|
1314
1347
|
end
|
1315
1348
|
|
1316
|
-
collection.maximum_size.
|
1317
|
-
collection.first.id.
|
1349
|
+
expect(collection.maximum_size).to eq(1)
|
1350
|
+
expect(collection.first.id).to eq(transaction.id)
|
1318
1351
|
end
|
1319
1352
|
end
|
1320
1353
|
|
@@ -1342,16 +1375,16 @@ describe Braintree::Transaction, "search" do
|
|
1342
1375
|
)
|
1343
1376
|
end
|
1344
1377
|
|
1345
|
-
collection.maximum_size.
|
1378
|
+
expect(collection.maximum_size).to be > 0
|
1346
1379
|
end
|
1347
1380
|
end
|
1348
1381
|
|
1349
1382
|
it "returns multiple results" do
|
1350
1383
|
collection = Braintree::Transaction.search
|
1351
|
-
collection.maximum_size.
|
1384
|
+
expect(collection.maximum_size).to be > 100
|
1352
1385
|
|
1353
1386
|
transaction_ids = collection.map { |t| t.id }.uniq.compact
|
1354
|
-
transaction_ids.size.
|
1387
|
+
expect(transaction_ids.size).to eq(collection.maximum_size)
|
1355
1388
|
end
|
1356
1389
|
|
1357
1390
|
context "text node operations" do
|
@@ -1372,15 +1405,15 @@ describe Braintree::Transaction, "search" do
|
|
1372
1405
|
search.credit_card_cardholder_name.is "Tom Smith"
|
1373
1406
|
end
|
1374
1407
|
|
1375
|
-
collection.maximum_size.
|
1376
|
-
collection.first.id.
|
1408
|
+
expect(collection.maximum_size).to eq(1)
|
1409
|
+
expect(collection.first.id).to eq(@transaction.id)
|
1377
1410
|
|
1378
1411
|
collection = Braintree::Transaction.search do |search|
|
1379
1412
|
search.id.is @transaction.id
|
1380
1413
|
search.credit_card_cardholder_name.is "Invalid"
|
1381
1414
|
end
|
1382
1415
|
|
1383
|
-
collection.maximum_size.
|
1416
|
+
expect(collection.maximum_size).to eq(0)
|
1384
1417
|
end
|
1385
1418
|
|
1386
1419
|
it "is_not" do
|
@@ -1389,15 +1422,15 @@ describe Braintree::Transaction, "search" do
|
|
1389
1422
|
search.credit_card_cardholder_name.is_not "Anybody Else"
|
1390
1423
|
end
|
1391
1424
|
|
1392
|
-
collection.maximum_size.
|
1393
|
-
collection.first.id.
|
1425
|
+
expect(collection.maximum_size).to eq(1)
|
1426
|
+
expect(collection.first.id).to eq(@transaction.id)
|
1394
1427
|
|
1395
1428
|
collection = Braintree::Transaction.search do |search|
|
1396
1429
|
search.id.is @transaction.id
|
1397
1430
|
search.credit_card_cardholder_name.is_not "Tom Smith"
|
1398
1431
|
end
|
1399
1432
|
|
1400
|
-
collection.maximum_size.
|
1433
|
+
expect(collection.maximum_size).to eq(0)
|
1401
1434
|
end
|
1402
1435
|
|
1403
1436
|
it "ends_with" do
|
@@ -1406,15 +1439,15 @@ describe Braintree::Transaction, "search" do
|
|
1406
1439
|
search.credit_card_cardholder_name.ends_with "m Smith"
|
1407
1440
|
end
|
1408
1441
|
|
1409
|
-
collection.maximum_size.
|
1410
|
-
collection.first.id.
|
1442
|
+
expect(collection.maximum_size).to eq(1)
|
1443
|
+
expect(collection.first.id).to eq(@transaction.id)
|
1411
1444
|
|
1412
1445
|
collection = Braintree::Transaction.search do |search|
|
1413
1446
|
search.id.is @transaction.id
|
1414
1447
|
search.credit_card_cardholder_name.ends_with "Tom S"
|
1415
1448
|
end
|
1416
1449
|
|
1417
|
-
collection.maximum_size.
|
1450
|
+
expect(collection.maximum_size).to eq(0)
|
1418
1451
|
end
|
1419
1452
|
|
1420
1453
|
it "starts_with" do
|
@@ -1423,15 +1456,15 @@ describe Braintree::Transaction, "search" do
|
|
1423
1456
|
search.credit_card_cardholder_name.starts_with "Tom S"
|
1424
1457
|
end
|
1425
1458
|
|
1426
|
-
collection.maximum_size.
|
1427
|
-
collection.first.id.
|
1459
|
+
expect(collection.maximum_size).to eq(1)
|
1460
|
+
expect(collection.first.id).to eq(@transaction.id)
|
1428
1461
|
|
1429
1462
|
collection = Braintree::Transaction.search do |search|
|
1430
1463
|
search.id.is @transaction.id
|
1431
1464
|
search.credit_card_cardholder_name.starts_with "m Smith"
|
1432
1465
|
end
|
1433
1466
|
|
1434
|
-
collection.maximum_size.
|
1467
|
+
expect(collection.maximum_size).to eq(0)
|
1435
1468
|
end
|
1436
1469
|
|
1437
1470
|
it "contains" do
|
@@ -1440,15 +1473,15 @@ describe Braintree::Transaction, "search" do
|
|
1440
1473
|
search.credit_card_cardholder_name.contains "m Sm"
|
1441
1474
|
end
|
1442
1475
|
|
1443
|
-
collection.maximum_size.
|
1444
|
-
collection.first.id.
|
1476
|
+
expect(collection.maximum_size).to eq(1)
|
1477
|
+
expect(collection.first.id).to eq(@transaction.id)
|
1445
1478
|
|
1446
1479
|
collection = Braintree::Transaction.search do |search|
|
1447
1480
|
search.id.is @transaction.id
|
1448
1481
|
search.credit_card_cardholder_name.contains "Anybody Else"
|
1449
1482
|
end
|
1450
1483
|
|
1451
|
-
collection.maximum_size.
|
1484
|
+
expect(collection.maximum_size).to eq(0)
|
1452
1485
|
end
|
1453
1486
|
end
|
1454
1487
|
|