braintree 4.14.0 → 4.15.0
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.
- 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.rb +5 -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/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 +1315 -1149
- 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_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 +3 -2
|
@@ -6,7 +6,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
6
6
|
search.credit_card_cardholder_name.is "thisnameisnotreal"
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
collection.maximum_size.
|
|
9
|
+
expect(collection.maximum_size).to eq(0)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it "can search on text fields" do
|
|
@@ -33,14 +33,14 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
33
33
|
search.id.is verification.id
|
|
34
34
|
search.send(criterion).is value
|
|
35
35
|
end
|
|
36
|
-
collection.maximum_size.
|
|
37
|
-
collection.first.id.
|
|
36
|
+
expect(collection.maximum_size).to eq(1)
|
|
37
|
+
expect(collection.first.id).to eq(verification.id)
|
|
38
38
|
|
|
39
39
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
40
40
|
search.id.is verification.id
|
|
41
41
|
search.send(criterion).is("invalid_attribute")
|
|
42
42
|
end
|
|
43
|
-
collection.
|
|
43
|
+
expect(collection).to be_empty
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
@@ -50,8 +50,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
collection.maximum_size.
|
|
54
|
-
collection.first.id.
|
|
53
|
+
expect(collection.maximum_size).to eq(1)
|
|
54
|
+
expect(collection.first.id).to eq(verification.id)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
describe "multiple value fields" do
|
|
@@ -84,7 +84,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
84
84
|
search.ids.in verification_id1, verification_id2
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
-
collection.maximum_size.
|
|
87
|
+
expect(collection.maximum_size).to eq(2)
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
@@ -112,24 +112,24 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
112
112
|
)
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
collection.maximum_size.
|
|
116
|
-
collection.first.id.
|
|
115
|
+
expect(collection.maximum_size).to eq(1)
|
|
116
|
+
expect(collection.first.id).to eq(verification.id)
|
|
117
117
|
|
|
118
118
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
119
119
|
search.id.is verification.id
|
|
120
120
|
search.created_at >= created_at - 1
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
collection.maximum_size.
|
|
124
|
-
collection.first.id.
|
|
123
|
+
expect(collection.maximum_size).to eq(1)
|
|
124
|
+
expect(collection.first.id).to eq(verification.id)
|
|
125
125
|
|
|
126
126
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
127
127
|
search.id.is verification.id
|
|
128
128
|
search.created_at <= created_at + 1
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
collection.maximum_size.
|
|
132
|
-
collection.first.id.
|
|
131
|
+
expect(collection.maximum_size).to eq(1)
|
|
132
|
+
expect(collection.first.id).to eq(verification.id)
|
|
133
133
|
|
|
134
134
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
135
135
|
search.id.is verification.id
|
|
@@ -139,15 +139,15 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
139
139
|
)
|
|
140
140
|
end
|
|
141
141
|
|
|
142
|
-
collection.maximum_size.
|
|
142
|
+
expect(collection.maximum_size).to eq(0)
|
|
143
143
|
|
|
144
144
|
collection = Braintree::CreditCardVerification.search do |search|
|
|
145
145
|
search.id.is verification.id
|
|
146
146
|
search.created_at.is created_at
|
|
147
147
|
end
|
|
148
148
|
|
|
149
|
-
collection.maximum_size.
|
|
150
|
-
collection.first.id.
|
|
149
|
+
expect(collection.maximum_size).to eq(1)
|
|
150
|
+
expect(collection.first.id).to eq(verification.id)
|
|
151
151
|
end
|
|
152
152
|
end
|
|
153
153
|
|
|
@@ -17,12 +17,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
17
17
|
|
|
18
18
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
19
19
|
|
|
20
|
-
result.
|
|
21
|
-
result.credit_card_verification.id.
|
|
22
|
-
result.credit_card_verification.status.
|
|
23
|
-
result.credit_card_verification.processor_response_code.
|
|
24
|
-
result.credit_card_verification.processor_response_text.
|
|
25
|
-
result.credit_card_verification.processor_response_type.
|
|
20
|
+
expect(result).to be_success
|
|
21
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
22
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
23
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
24
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
25
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
26
26
|
expect(result.credit_card_verification.network_transaction_id).not_to be_nil
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -61,12 +61,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
61
61
|
|
|
62
62
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
63
63
|
|
|
64
|
-
result.success
|
|
65
|
-
result.credit_card_verification.id.
|
|
66
|
-
result.credit_card_verification.status.
|
|
67
|
-
result.credit_card_verification.processor_response_code.
|
|
68
|
-
result.credit_card_verification.processor_response_text.
|
|
69
|
-
result.credit_card_verification.processor_response_type.
|
|
64
|
+
expect(result.success?).to eq(false)
|
|
65
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
66
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::ProcessorDeclined)
|
|
67
|
+
expect(result.credit_card_verification.processor_response_code).to eq("2000")
|
|
68
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Do Not Honor")
|
|
69
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::SoftDeclined)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
it "returns validation errors" do
|
|
@@ -82,8 +82,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
82
82
|
|
|
83
83
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
84
84
|
|
|
85
|
-
result.success
|
|
86
|
-
result.errors.for(:verification).for(:options).first.code.
|
|
85
|
+
expect(result.success?).to eq(false)
|
|
86
|
+
expect(result.errors.for(:verification).for(:options).first.code).to eq(Braintree::ErrorCodes::Verification::Options::AmountCannotBeNegative)
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
it "returns account type with debit" do
|
|
@@ -98,8 +98,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
98
98
|
},
|
|
99
99
|
)
|
|
100
100
|
|
|
101
|
-
result.success
|
|
102
|
-
result.credit_card_verification.credit_card[:account_type].
|
|
101
|
+
expect(result.success?).to eq(true)
|
|
102
|
+
expect(result.credit_card_verification.credit_card[:account_type]).to eq("debit")
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
it "returns account type with credit" do
|
|
@@ -114,8 +114,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
114
114
|
},
|
|
115
115
|
)
|
|
116
116
|
|
|
117
|
-
result.success
|
|
118
|
-
result.credit_card_verification.credit_card[:account_type].
|
|
117
|
+
expect(result.success?).to eq(true)
|
|
118
|
+
expect(result.credit_card_verification.credit_card[:account_type]).to eq("credit")
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
it "errors with unsupported account type" do
|
|
@@ -129,8 +129,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
129
129
|
},
|
|
130
130
|
)
|
|
131
131
|
|
|
132
|
-
result.success
|
|
133
|
-
result.errors.for(:verification).for(:options).on(:account_type)[0].code.
|
|
132
|
+
expect(result.success?).to eq(false)
|
|
133
|
+
expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeNotSupported)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
it "errors with invalid account type" do
|
|
@@ -145,8 +145,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
145
145
|
},
|
|
146
146
|
)
|
|
147
147
|
|
|
148
|
-
result.success
|
|
149
|
-
result.errors.for(:verification).for(:options).on(:account_type)[0].code.
|
|
148
|
+
expect(result.success?).to eq(false)
|
|
149
|
+
expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeIsInvalid)
|
|
150
150
|
end
|
|
151
151
|
end
|
|
152
152
|
|
|
@@ -162,8 +162,8 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
162
162
|
credit_card_verification = Braintree::Customer.create(:credit_card => credit_card_params).credit_card_verification
|
|
163
163
|
found_verification = Braintree::CreditCardVerification.find(credit_card_verification.id)
|
|
164
164
|
|
|
165
|
-
found_verification.
|
|
166
|
-
found_verification.graphql_id.
|
|
165
|
+
expect(found_verification).to eq(credit_card_verification)
|
|
166
|
+
expect(found_verification.graphql_id).not_to be_nil
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
it "raises a NotFoundError exception if verification cannot be found" do
|
|
@@ -215,7 +215,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
215
215
|
search.status.in credit_card_verification.status
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
-
found_verifications.
|
|
218
|
+
expect(found_verifications).to include(credit_card_verification)
|
|
219
219
|
end
|
|
220
220
|
|
|
221
221
|
it "searches and finds verifications using customer fields" do
|
|
@@ -231,7 +231,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
231
231
|
search.payment_method_token.is credit_card.token
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
-
found_verifications.count.
|
|
234
|
+
expect(found_verifications.count).to eq(1)
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
describe "card type indicators" do
|
|
@@ -256,7 +256,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
256
256
|
verification_id = search_results.first.id
|
|
257
257
|
|
|
258
258
|
found_verification = Braintree::CreditCardVerification.find(verification_id)
|
|
259
|
-
found_verification.credit_card[:prepaid].
|
|
259
|
+
expect(found_verification.credit_card[:prepaid]).to eq(Braintree::CreditCard::Prepaid::Yes)
|
|
260
260
|
end
|
|
261
261
|
end
|
|
262
262
|
end
|
|
@@ -276,12 +276,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
276
276
|
|
|
277
277
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
278
278
|
|
|
279
|
-
result.
|
|
280
|
-
result.credit_card_verification.id.
|
|
281
|
-
result.credit_card_verification.status.
|
|
282
|
-
result.credit_card_verification.processor_response_code.
|
|
283
|
-
result.credit_card_verification.processor_response_text.
|
|
284
|
-
result.credit_card_verification.processor_response_type.
|
|
279
|
+
expect(result).to be_success
|
|
280
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
281
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
282
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
283
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
284
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
285
285
|
expect(result.credit_card_verification.network_transaction_id).not_to be_nil
|
|
286
286
|
end
|
|
287
287
|
end
|
|
@@ -309,12 +309,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
309
309
|
|
|
310
310
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
311
311
|
|
|
312
|
-
result.
|
|
313
|
-
result.credit_card_verification.id.
|
|
314
|
-
result.credit_card_verification.status.
|
|
315
|
-
result.credit_card_verification.processor_response_code.
|
|
316
|
-
result.credit_card_verification.processor_response_text.
|
|
317
|
-
result.credit_card_verification.processor_response_type.
|
|
312
|
+
expect(result).to be_success
|
|
313
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
314
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
315
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
316
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
317
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
318
318
|
expect(result.credit_card_verification.network_transaction_id).not_to be_nil
|
|
319
319
|
end
|
|
320
320
|
|
|
@@ -326,7 +326,7 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
326
326
|
:expiration_year => "2099",
|
|
327
327
|
},
|
|
328
328
|
)
|
|
329
|
-
nonce.
|
|
329
|
+
expect(nonce).not_to be_nil
|
|
330
330
|
|
|
331
331
|
verification_params = {
|
|
332
332
|
:credit_card => {
|
|
@@ -341,12 +341,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
341
341
|
|
|
342
342
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
343
343
|
|
|
344
|
-
result.
|
|
345
|
-
result.credit_card_verification.id.
|
|
346
|
-
result.credit_card_verification.status.
|
|
347
|
-
result.credit_card_verification.processor_response_code.
|
|
348
|
-
result.credit_card_verification.processor_response_text.
|
|
349
|
-
result.credit_card_verification.processor_response_type.
|
|
344
|
+
expect(result).to be_success
|
|
345
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
346
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
347
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
348
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
349
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
350
350
|
expect(result.credit_card_verification.network_transaction_id).not_to be_nil
|
|
351
351
|
end
|
|
352
352
|
|
|
@@ -373,12 +373,12 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
373
373
|
|
|
374
374
|
result = Braintree::CreditCardVerification.create(verification_params)
|
|
375
375
|
|
|
376
|
-
result.
|
|
377
|
-
result.credit_card_verification.id.
|
|
378
|
-
result.credit_card_verification.status.
|
|
379
|
-
result.credit_card_verification.processor_response_code.
|
|
380
|
-
result.credit_card_verification.processor_response_text.
|
|
381
|
-
result.credit_card_verification.processor_response_type.
|
|
376
|
+
expect(result).to be_success
|
|
377
|
+
expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
|
|
378
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
379
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
380
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
381
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
382
382
|
expect(result.credit_card_verification.network_transaction_id).not_to be_nil
|
|
383
383
|
end
|
|
384
384
|
end
|
|
@@ -8,7 +8,7 @@ describe Braintree::Transaction, "search" do
|
|
|
8
8
|
search.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
|
|
@@ -69,14 +69,14 @@ describe Braintree::Transaction, "search" do
|
|
|
69
69
|
search.send(criterion).is value
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
collection.maximum_size.
|
|
73
|
-
collection.first.id.
|
|
72
|
+
expect(collection.maximum_size).to eq(1)
|
|
73
|
+
expect(collection.first.id).to eq(customer.id)
|
|
74
74
|
|
|
75
75
|
collection = Braintree::Customer.search do |search|
|
|
76
76
|
search.id.is customer.id
|
|
77
77
|
search.send(criterion).is("invalid_attribute")
|
|
78
78
|
end
|
|
79
|
-
collection.
|
|
79
|
+
expect(collection).to be_empty
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
collection = Braintree::Customer.search do |search|
|
|
@@ -86,8 +86,8 @@ describe Braintree::Transaction, "search" do
|
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
collection.maximum_size.
|
|
90
|
-
collection.first.id.
|
|
89
|
+
expect(collection.maximum_size).to eq(1)
|
|
90
|
+
expect(collection.first.id).to eq(customer.id)
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
it "can find duplicate credit cards for a give payment method token " do
|
|
@@ -111,8 +111,8 @@ describe Braintree::Transaction, "search" do
|
|
|
111
111
|
search.payment_method_token_with_duplicates.is jim.credit_cards.first.token
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
collection.
|
|
115
|
-
collection.
|
|
114
|
+
expect(collection).to include(jim)
|
|
115
|
+
expect(collection).to include(joe)
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
it "can search by created_at" do
|
|
@@ -122,7 +122,7 @@ describe Braintree::Transaction, "search" do
|
|
|
122
122
|
)
|
|
123
123
|
|
|
124
124
|
created_at = customer.created_at
|
|
125
|
-
created_at.
|
|
125
|
+
expect(created_at).to be_utc
|
|
126
126
|
|
|
127
127
|
collection = Braintree::Customer.search do |search|
|
|
128
128
|
search.company.is company
|
|
@@ -132,24 +132,24 @@ describe Braintree::Transaction, "search" do
|
|
|
132
132
|
)
|
|
133
133
|
end
|
|
134
134
|
|
|
135
|
-
collection.maximum_size.
|
|
136
|
-
collection.first.id.
|
|
135
|
+
expect(collection.maximum_size).to eq(1)
|
|
136
|
+
expect(collection.first.id).to eq(customer.id)
|
|
137
137
|
|
|
138
138
|
collection = Braintree::Customer.search do |search|
|
|
139
139
|
search.company.is customer.company
|
|
140
140
|
search.created_at >= created_at - 1
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
collection.maximum_size.
|
|
144
|
-
collection.first.company.
|
|
143
|
+
expect(collection.maximum_size).to eq(1)
|
|
144
|
+
expect(collection.first.company).to eq(customer.company)
|
|
145
145
|
|
|
146
146
|
collection = Braintree::Customer.search do |search|
|
|
147
147
|
search.company.is customer.company
|
|
148
148
|
search.created_at <= created_at + 1
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
-
collection.maximum_size.
|
|
152
|
-
collection.first.company.
|
|
151
|
+
expect(collection.maximum_size).to eq(1)
|
|
152
|
+
expect(collection.first.company).to eq(customer.company)
|
|
153
153
|
|
|
154
154
|
collection = Braintree::Customer.search do |search|
|
|
155
155
|
search.company.is customer.company
|
|
@@ -159,15 +159,15 @@ describe Braintree::Transaction, "search" do
|
|
|
159
159
|
)
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
-
collection.maximum_size.
|
|
162
|
+
expect(collection.maximum_size).to eq(0)
|
|
163
163
|
|
|
164
164
|
collection = Braintree::Customer.search do |search|
|
|
165
165
|
search.company.is customer.company
|
|
166
166
|
search.created_at.is created_at
|
|
167
167
|
end
|
|
168
168
|
|
|
169
|
-
collection.maximum_size.
|
|
170
|
-
collection.first.company.
|
|
169
|
+
expect(collection.maximum_size).to eq(1)
|
|
170
|
+
expect(collection.first.company).to eq(customer.company)
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
173
|
|
|
@@ -189,7 +189,7 @@ describe Braintree::Transaction, "search" do
|
|
|
189
189
|
search.id.is customer_id
|
|
190
190
|
end
|
|
191
191
|
|
|
192
|
-
collection.maximum_size.
|
|
193
|
-
collection.first.
|
|
192
|
+
expect(collection.maximum_size).to eq(1)
|
|
193
|
+
expect(collection.first).to eq(customer)
|
|
194
194
|
end
|
|
195
195
|
end
|