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
@@ -23,13 +23,13 @@ describe Braintree::ApplePayGateway do
|
|
23
23
|
describe "register_domain" do
|
24
24
|
it "registers an apple pay domain" do
|
25
25
|
result = @gateway.apple_pay.register_domain("www.example.com")
|
26
|
-
result.
|
26
|
+
expect(result).to be_success
|
27
27
|
end
|
28
28
|
|
29
29
|
it "gets a validation error when attempting to register no domains" do
|
30
30
|
result = @gateway.apple_pay.register_domain("")
|
31
|
-
result.
|
32
|
-
result.errors.for(:apple_pay)[0].message.
|
31
|
+
expect(result).not_to be_success
|
32
|
+
expect(result.errors.for(:apple_pay)[0].message).to eq("Domain name is required.")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -37,27 +37,27 @@ describe Braintree::ApplePayGateway do
|
|
37
37
|
it "unregisters an apple pay domain" do
|
38
38
|
domain = "example.org"
|
39
39
|
result = @gateway.apple_pay.unregister_domain(domain)
|
40
|
-
result.
|
40
|
+
expect(result).to be_success
|
41
41
|
end
|
42
42
|
|
43
43
|
it "unregisters an apple pay domain with scheme in url" do
|
44
44
|
domain = "http://example.org"
|
45
45
|
result = @gateway.apple_pay.unregister_domain(domain)
|
46
|
-
result.
|
46
|
+
expect(result).to be_success
|
47
47
|
end
|
48
48
|
|
49
49
|
it "escapes the unregistered domain query parameter" do
|
50
50
|
domain = "ex&mple.org"
|
51
51
|
result = @gateway.apple_pay.unregister_domain(domain)
|
52
|
-
result.
|
52
|
+
expect(result).to be_success
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
describe "registered_domains" do
|
57
57
|
it "returns stubbed registered domains" do
|
58
58
|
result = @gateway.apple_pay.registered_domains
|
59
|
-
result.
|
60
|
-
result.apple_pay_options.domains.
|
59
|
+
expect(result).to be_success
|
60
|
+
expect(result.apple_pay_options.domains).to eq(["www.example.com"])
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -17,7 +17,7 @@ describe Braintree::ClientToken do
|
|
17
17
|
|
18
18
|
response = http.get_payment_methods
|
19
19
|
|
20
|
-
response.code.
|
20
|
+
expect(response.code).to eq("200")
|
21
21
|
end
|
22
22
|
|
23
23
|
it "raises ArgumentError on invalid parameters (422)" do
|
@@ -31,14 +31,14 @@ describe Braintree::ClientToken do
|
|
31
31
|
config = Braintree::Configuration.instantiate
|
32
32
|
client_token_string = Braintree::ClientToken.generate(:version => 1)
|
33
33
|
client_token = JSON.parse(client_token_string)
|
34
|
-
client_token["version"].
|
34
|
+
expect(client_token["version"]).to eq(1)
|
35
35
|
end
|
36
36
|
|
37
37
|
it "defaults to 2" do
|
38
38
|
config = Braintree::Configuration.instantiate
|
39
39
|
client_token_string = Braintree::ClientToken.generate
|
40
40
|
client_token = decode_client_token(client_token_string)
|
41
|
-
client_token["version"].
|
41
|
+
expect(client_token["version"]).to eq(2)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -68,7 +68,7 @@ describe Braintree::ClientToken do
|
|
68
68
|
},
|
69
69
|
)
|
70
70
|
|
71
|
-
response.code.
|
71
|
+
expect(response.code).to eq("422")
|
72
72
|
end
|
73
73
|
|
74
74
|
it "can pass make_default" do
|
@@ -98,7 +98,7 @@ describe Braintree::ClientToken do
|
|
98
98
|
},
|
99
99
|
)
|
100
100
|
|
101
|
-
response.code.
|
101
|
+
expect(response.code).to eq("201")
|
102
102
|
|
103
103
|
response = http.add_payment_method(
|
104
104
|
:credit_card => {
|
@@ -108,10 +108,10 @@ describe Braintree::ClientToken do
|
|
108
108
|
},
|
109
109
|
)
|
110
110
|
|
111
|
-
response.code.
|
111
|
+
expect(response.code).to eq("201")
|
112
112
|
|
113
113
|
customer = Braintree::Customer.find(customer_id)
|
114
|
-
customer.credit_cards.select { |c| c.bin == "400551" }[0].
|
114
|
+
expect(customer.credit_cards.select { |c| c.bin == "400551" }[0]).to be_default
|
115
115
|
end
|
116
116
|
|
117
117
|
it "can pass fail_on_duplicate_payment_method" do
|
@@ -138,7 +138,7 @@ describe Braintree::ClientToken do
|
|
138
138
|
},
|
139
139
|
)
|
140
140
|
|
141
|
-
response.code.
|
141
|
+
expect(response.code).to eq("201")
|
142
142
|
|
143
143
|
second_raw_client_token = Braintree::ClientToken.generate(
|
144
144
|
:customer_id => customer_id,
|
@@ -158,7 +158,7 @@ describe Braintree::ClientToken do
|
|
158
158
|
},
|
159
159
|
)
|
160
160
|
|
161
|
-
response.code.
|
161
|
+
expect(response.code).to eq("422")
|
162
162
|
end
|
163
163
|
|
164
164
|
it "can pass merchant_account_id" do
|
@@ -169,7 +169,7 @@ describe Braintree::ClientToken do
|
|
169
169
|
)
|
170
170
|
client_token = decode_client_token(raw_client_token)
|
171
171
|
|
172
|
-
client_token["merchantAccountId"].
|
172
|
+
expect(client_token["merchantAccountId"]).to eq(merchant_account_id)
|
173
173
|
end
|
174
174
|
|
175
175
|
context "paypal" do
|
@@ -178,11 +178,11 @@ describe Braintree::ClientToken do
|
|
178
178
|
raw_client_token = Braintree::ClientToken.generate
|
179
179
|
client_token = decode_client_token(raw_client_token)
|
180
180
|
|
181
|
-
client_token["paypal"]["displayName"].
|
182
|
-
client_token["paypal"]["clientId"].
|
183
|
-
client_token["paypal"]["privacyUrl"].
|
184
|
-
client_token["paypal"]["userAgreementUrl"].
|
185
|
-
client_token["paypal"]["baseUrl"].
|
181
|
+
expect(client_token["paypal"]["displayName"]).to eq("merchant who has paypal and sepa enabled")
|
182
|
+
expect(client_token["paypal"]["clientId"]).to match(/.+/)
|
183
|
+
expect(client_token["paypal"]["privacyUrl"]).to match("http://www.example.com/privacy_policy")
|
184
|
+
expect(client_token["paypal"]["userAgreementUrl"]).to match("http://www.example.com/user_agreement")
|
185
|
+
expect(client_token["paypal"]["baseUrl"]).not_to be_nil
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|