braintree 4.14.0 → 4.16.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/account_updater_daily_report.rb +3 -3
- data/lib/braintree/ach_mandate.rb +1 -1
- data/lib/braintree/add_on_gateway.rb +1 -1
- data/lib/braintree/address.rb +4 -4
- data/lib/braintree/address_gateway.rb +5 -5
- data/lib/braintree/advanced_search.rb +10 -10
- data/lib/braintree/apple_pay.rb +3 -3
- data/lib/braintree/apple_pay_card.rb +3 -3
- data/lib/braintree/apple_pay_options.rb +3 -3
- data/lib/braintree/authorization_adjustment.rb +3 -3
- data/lib/braintree/base_module.rb +1 -1
- data/lib/braintree/bin_data.rb +2 -2
- data/lib/braintree/client_token_gateway.rb +1 -1
- data/lib/braintree/configuration.rb +22 -22
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
- data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
- data/lib/braintree/credit_card.rb +22 -9
- data/lib/braintree/credit_card_gateway.rb +23 -11
- data/lib/braintree/credit_card_verification.rb +3 -3
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +5 -9
- data/lib/braintree/customer_gateway.rb +7 -7
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/descriptor.rb +1 -1
- data/lib/braintree/digest.rb +1 -1
- data/lib/braintree/disbursement.rb +5 -5
- data/lib/braintree/discount_gateway.rb +1 -1
- data/lib/braintree/dispute/evidence.rb +1 -1
- data/lib/braintree/dispute/paypal_message.rb +1 -1
- data/lib/braintree/dispute/status_history.rb +1 -1
- data/lib/braintree/dispute/transaction.rb +1 -1
- data/lib/braintree/dispute/transaction_details.rb +1 -1
- data/lib/braintree/dispute.rb +3 -3
- data/lib/braintree/dispute_gateway.rb +1 -1
- data/lib/braintree/dispute_search.rb +1 -1
- data/lib/braintree/document_upload.rb +2 -2
- data/lib/braintree/document_upload_gateway.rb +3 -3
- data/lib/braintree/enriched_customer_data.rb +2 -2
- data/lib/braintree/error_result.rb +2 -3
- data/lib/braintree/errors.rb +3 -3
- data/lib/braintree/exceptions.rb +1 -2
- data/lib/braintree/exchange_rate.rb +2 -2
- data/lib/braintree/exchange_rate_quote.rb +3 -3
- data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
- data/lib/braintree/exchange_rate_quote_input.rb +3 -3
- data/lib/braintree/exchange_rate_quote_request.rb +3 -3
- data/lib/braintree/exchange_rate_quote_response.rb +3 -3
- data/lib/braintree/facilitated_details.rb +1 -1
- data/lib/braintree/facilitator_details.rb +1 -1
- data/lib/braintree/google_pay_card.rb +3 -3
- data/lib/braintree/granted_payment_instrument_update.rb +1 -1
- data/lib/braintree/graphql_client.rb +1 -1
- data/lib/braintree/http.rb +1 -1
- data/lib/braintree/local_payment_completed.rb +2 -2
- data/lib/braintree/local_payment_expired.rb +2 -2
- data/lib/braintree/local_payment_funded.rb +2 -2
- data/lib/braintree/local_payment_reversed.rb +2 -2
- data/lib/braintree/merchant.rb +3 -3
- data/lib/braintree/merchant_account.rb +2 -2
- data/lib/braintree/merchant_account_gateway.rb +9 -9
- data/lib/braintree/meta_checkout_card.rb +89 -0
- data/lib/braintree/meta_checkout_token.rb +88 -0
- data/lib/braintree/modification.rb +3 -3
- data/lib/braintree/oauth_credentials.rb +3 -3
- data/lib/braintree/paginated_collection.rb +2 -2
- data/lib/braintree/paginated_result.rb +1 -1
- data/lib/braintree/payment_instrument_type.rb +2 -0
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
- data/lib/braintree/payment_method_gateway.rb +23 -10
- data/lib/braintree/payment_method_nonce.rb +4 -4
- data/lib/braintree/payment_method_nonce_details.rb +1 -1
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
- data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
- data/lib/braintree/paypal_account.rb +1 -2
- data/lib/braintree/paypal_account_gateway.rb +5 -5
- data/lib/braintree/plan.rb +1 -1
- data/lib/braintree/plan_gateway.rb +2 -2
- data/lib/braintree/resource_collection.rb +2 -2
- data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
- data/lib/braintree/risk_data.rb +1 -1
- data/lib/braintree/samsung_pay_card.rb +5 -5
- data/lib/braintree/sepa_direct_debit_account.rb +2 -2
- data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
- data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
- data/lib/braintree/sha256_digest.rb +1 -1
- data/lib/braintree/subscription/status_details.rb +1 -1
- data/lib/braintree/subscription.rb +2 -2
- data/lib/braintree/subscription_gateway.rb +6 -6
- data/lib/braintree/subscription_search.rb +1 -1
- data/lib/braintree/successful_result.rb +2 -2
- data/lib/braintree/test/credit_card.rb +7 -10
- data/lib/braintree/test/merchant_account.rb +1 -1
- data/lib/braintree/test/nonce.rb +4 -0
- data/lib/braintree/test/transaction_amounts.rb +2 -3
- data/lib/braintree/test/venmo_sdk.rb +2 -0
- data/lib/braintree/testing_gateway.rb +1 -1
- data/lib/braintree/three_d_secure_info.rb +1 -1
- data/lib/braintree/transaction/address_details.rb +1 -1
- data/lib/braintree/transaction/credit_card_details.rb +4 -1
- data/lib/braintree/transaction/customer_details.rb +1 -1
- data/lib/braintree/transaction/disbursement_details.rb +1 -1
- data/lib/braintree/transaction/local_payment_details.rb +2 -0
- data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
- data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
- data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
- data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
- data/lib/braintree/transaction/status_details.rb +1 -1
- data/lib/braintree/transaction/subscription_details.rb +1 -1
- data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
- data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
- data/lib/braintree/transaction.rb +27 -20
- data/lib/braintree/transaction_gateway.rb +23 -12
- data/lib/braintree/transaction_line_item.rb +2 -2
- data/lib/braintree/transaction_line_item_gateway.rb +1 -1
- data/lib/braintree/transaction_review.rb +1 -1
- data/lib/braintree/transaction_search.rb +7 -6
- data/lib/braintree/unknown_payment_method.rb +1 -1
- data/lib/braintree/us_bank_account.rb +2 -2
- data/lib/braintree/us_bank_account_verification.rb +23 -15
- data/lib/braintree/us_bank_account_verification_search.rb +1 -1
- data/lib/braintree/util.rb +3 -3
- data/lib/braintree/validation_error.rb +1 -1
- data/lib/braintree/validation_error_collection.rb +3 -3
- data/lib/braintree/venmo_account.rb +3 -3
- data/lib/braintree/venmo_profile_data.rb +6 -4
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +7 -7
- data/lib/braintree/webhook_notification.rb +3 -2
- data/lib/braintree/webhook_notification_gateway.rb +3 -3
- data/lib/braintree/webhook_testing.rb +1 -1
- data/lib/braintree/webhook_testing_gateway.rb +18 -1
- data/lib/braintree/xml/generator.rb +1 -1
- data/lib/braintree/xml/libxml.rb +1 -1
- data/lib/braintree/xml/parser.rb +2 -2
- data/lib/braintree/xml/rexml.rb +2 -2
- data/lib/braintree/xml.rb +1 -1
- data/lib/braintree.rb +4 -1
- 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_search_spec.rb +0 -1
- 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 +89 -69
- data/spec/integration/braintree/payment_method_spec.rb +389 -389
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +150 -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 +225 -165
- data/spec/integration/braintree/transaction_spec.rb +1502 -1210
- 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 +11 -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 +9 -9
- 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/meta_checkout_card_details_spec.rb +60 -0
- data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
- data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
- data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
- 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 +39 -7
- 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 +12 -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 +16 -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 +11 -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
|