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
@@ -21,19 +21,19 @@ describe Braintree::PaymentMethodNonce do
|
|
21
21
|
:customer_id => customer.id,
|
22
22
|
)
|
23
23
|
|
24
|
-
result.
|
25
|
-
result.payment_method.
|
24
|
+
expect(result).to be_success
|
25
|
+
expect(result.payment_method).to be_a(Braintree::CreditCard)
|
26
26
|
token = result.payment_method.token
|
27
27
|
|
28
28
|
found_credit_card = Braintree::CreditCard.find(token)
|
29
|
-
found_credit_card.
|
29
|
+
expect(found_credit_card).not_to be_nil
|
30
30
|
|
31
31
|
result = Braintree::PaymentMethodNonce.create(found_credit_card.token)
|
32
|
-
result.
|
33
|
-
result.payment_method_nonce.
|
34
|
-
result.payment_method_nonce.nonce.
|
35
|
-
result.payment_method_nonce.details.
|
36
|
-
result.payment_method_nonce.default
|
32
|
+
expect(result).to be_success
|
33
|
+
expect(result.payment_method_nonce).not_to be_nil
|
34
|
+
expect(result.payment_method_nonce.nonce).not_to be_nil
|
35
|
+
expect(result.payment_method_nonce.details).not_to be_nil
|
36
|
+
expect(result.payment_method_nonce.default?).to be_truthy
|
37
37
|
end
|
38
38
|
|
39
39
|
it "correctly raises and exception for a non existent token" do
|
@@ -59,17 +59,17 @@ describe Braintree::PaymentMethodNonce do
|
|
59
59
|
:customer_id => customer.id,
|
60
60
|
)
|
61
61
|
|
62
|
-
payment_method.
|
62
|
+
expect(payment_method).to be_a(Braintree::CreditCard)
|
63
63
|
token = payment_method.token
|
64
64
|
|
65
65
|
found_credit_card = Braintree::CreditCard.find(token)
|
66
|
-
found_credit_card.
|
66
|
+
expect(found_credit_card).not_to be_nil
|
67
67
|
|
68
68
|
payment_method_nonce = Braintree::PaymentMethodNonce.create!(found_credit_card.token)
|
69
|
-
payment_method_nonce.
|
70
|
-
payment_method_nonce.nonce.
|
71
|
-
payment_method_nonce.details.
|
72
|
-
payment_method_nonce.default
|
69
|
+
expect(payment_method_nonce).not_to be_nil
|
70
|
+
expect(payment_method_nonce.nonce).not_to be_nil
|
71
|
+
expect(payment_method_nonce.details).not_to be_nil
|
72
|
+
expect(payment_method_nonce.default?).to be_truthy
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -79,27 +79,47 @@ describe Braintree::PaymentMethodNonce do
|
|
79
79
|
|
80
80
|
nonce = result.payment_method_nonce
|
81
81
|
|
82
|
-
result.
|
83
|
-
nonce.nonce.
|
84
|
-
nonce.type.
|
82
|
+
expect(result).to be_success
|
83
|
+
expect(nonce.nonce).to eq("fake-valid-nonce")
|
84
|
+
expect(nonce.type).to eq("CreditCard")
|
85
|
+
expect(nonce.details.bin).to eq("401288")
|
86
|
+
expect(nonce.details.card_type).to eq("Visa")
|
87
|
+
expect(nonce.details.expiration_month).to eq("12")
|
88
|
+
expect(nonce.details.expiration_year).to eq(Date.today.next_year.year.to_s)
|
89
|
+
expect(nonce.details.is_network_tokenized?).to be_nil
|
90
|
+
expect(nonce.details.last_two).to eq("81")
|
91
|
+
expect(nonce.details.payer_info).to be_nil
|
92
|
+
end
|
93
|
+
|
94
|
+
it "return meta_checkout_card_details nonce if exist" do
|
95
|
+
result = Braintree::PaymentMethodNonce.find(Braintree::Test::Nonce::MetaCheckoutCard)
|
96
|
+
nonce = result.payment_method_nonce
|
85
97
|
nonce.details.bin.should == "401288"
|
98
|
+
nonce.details.last_two.should == "81"
|
86
99
|
nonce.details.card_type.should == "Visa"
|
100
|
+
nonce.details.expiration_year.should == "2024"
|
87
101
|
nonce.details.expiration_month.should == "12"
|
88
|
-
|
89
|
-
|
102
|
+
end
|
103
|
+
|
104
|
+
it "return meta_checkout_token_details nonce if exist" do
|
105
|
+
result = Braintree::PaymentMethodNonce.find(Braintree::Test::Nonce::MetaCheckoutToken)
|
106
|
+
nonce = result.payment_method_nonce
|
107
|
+
nonce.details.bin.should == "401288"
|
90
108
|
nonce.details.last_two.should == "81"
|
91
|
-
nonce.details.
|
109
|
+
nonce.details.card_type.should == "Visa"
|
110
|
+
nonce.details.expiration_year.should == "2024"
|
111
|
+
nonce.details.expiration_month.should == "12"
|
92
112
|
end
|
93
113
|
|
94
114
|
it "return paypal details if details exist" do
|
95
115
|
result = Braintree::PaymentMethodNonce.find("fake-paypal-one-time-nonce")
|
96
116
|
nonce = result.payment_method_nonce
|
97
|
-
nonce.details.payer_info.billing_agreement_id.
|
98
|
-
nonce.details.payer_info.country_code.
|
99
|
-
nonce.details.payer_info.email.
|
100
|
-
nonce.details.payer_info.first_name.
|
101
|
-
nonce.details.payer_info.last_name.
|
102
|
-
nonce.details.payer_info.payer_id.
|
117
|
+
expect(nonce.details.payer_info.billing_agreement_id).to be_nil
|
118
|
+
expect(nonce.details.payer_info.country_code).to be_nil
|
119
|
+
expect(nonce.details.payer_info.email).not_to be_nil
|
120
|
+
expect(nonce.details.payer_info.first_name).not_to be_nil
|
121
|
+
expect(nonce.details.payer_info.last_name).not_to be_nil
|
122
|
+
expect(nonce.details.payer_info.payer_id).not_to be_nil
|
103
123
|
end
|
104
124
|
|
105
125
|
it "returns null 3ds_info if there isn't any" do
|
@@ -115,17 +135,17 @@ describe Braintree::PaymentMethodNonce do
|
|
115
135
|
|
116
136
|
nonce = result.payment_method_nonce
|
117
137
|
|
118
|
-
result.
|
119
|
-
nonce.three_d_secure_info.
|
138
|
+
expect(result).to be_success
|
139
|
+
expect(nonce.three_d_secure_info).to be_nil
|
120
140
|
end
|
121
141
|
|
122
142
|
it "returns the bin" do
|
123
143
|
result = Braintree::PaymentMethodNonce.find("fake-valid-visa-nonce")
|
124
144
|
|
125
145
|
nonce = result.payment_method_nonce
|
126
|
-
result.
|
127
|
-
nonce.details.
|
128
|
-
nonce.details.bin.
|
146
|
+
expect(result).to be_success
|
147
|
+
expect(nonce.details).not_to be_nil
|
148
|
+
expect(nonce.details.bin).to eq("401288")
|
129
149
|
end
|
130
150
|
|
131
151
|
it "returns bin_data with commercial set to Yes" do
|
@@ -133,9 +153,9 @@ describe Braintree::PaymentMethodNonce do
|
|
133
153
|
|
134
154
|
nonce = result.payment_method_nonce
|
135
155
|
|
136
|
-
result.
|
137
|
-
nonce.bin_data.
|
138
|
-
nonce.bin_data.commercial.
|
156
|
+
expect(result).to be_success
|
157
|
+
expect(nonce.bin_data).not_to be_nil
|
158
|
+
expect(nonce.bin_data.commercial).to eq(Braintree::CreditCard::Commercial::Yes)
|
139
159
|
end
|
140
160
|
|
141
161
|
it "returns bin_data with country_of_issuance set to CAN" do
|
@@ -143,9 +163,9 @@ describe Braintree::PaymentMethodNonce do
|
|
143
163
|
|
144
164
|
nonce = result.payment_method_nonce
|
145
165
|
|
146
|
-
result.
|
147
|
-
nonce.bin_data.
|
148
|
-
nonce.bin_data.country_of_issuance.
|
166
|
+
expect(result).to be_success
|
167
|
+
expect(nonce.bin_data).not_to be_nil
|
168
|
+
expect(nonce.bin_data.country_of_issuance).to eq("CAN")
|
149
169
|
end
|
150
170
|
|
151
171
|
it "returns bin_data with debit set to Yes" do
|
@@ -153,9 +173,9 @@ describe Braintree::PaymentMethodNonce do
|
|
153
173
|
|
154
174
|
nonce = result.payment_method_nonce
|
155
175
|
|
156
|
-
result.
|
157
|
-
nonce.bin_data.
|
158
|
-
nonce.bin_data.debit.
|
176
|
+
expect(result).to be_success
|
177
|
+
expect(nonce.bin_data).not_to be_nil
|
178
|
+
expect(nonce.bin_data.debit).to eq(Braintree::CreditCard::Debit::Yes)
|
159
179
|
end
|
160
180
|
|
161
181
|
it "returns bin_data with durbin_regulated set to Yes" do
|
@@ -163,9 +183,9 @@ describe Braintree::PaymentMethodNonce do
|
|
163
183
|
|
164
184
|
nonce = result.payment_method_nonce
|
165
185
|
|
166
|
-
result.
|
167
|
-
nonce.bin_data.
|
168
|
-
nonce.bin_data.durbin_regulated.
|
186
|
+
expect(result).to be_success
|
187
|
+
expect(nonce.bin_data).not_to be_nil
|
188
|
+
expect(nonce.bin_data.durbin_regulated).to eq(Braintree::CreditCard::DurbinRegulated::Yes)
|
169
189
|
end
|
170
190
|
|
171
191
|
it "returns bin_data with healthcare set to Yes" do
|
@@ -173,10 +193,10 @@ describe Braintree::PaymentMethodNonce do
|
|
173
193
|
|
174
194
|
nonce = result.payment_method_nonce
|
175
195
|
|
176
|
-
result.
|
177
|
-
nonce.bin_data.
|
178
|
-
nonce.bin_data.healthcare.
|
179
|
-
nonce.bin_data.product_id.
|
196
|
+
expect(result).to be_success
|
197
|
+
expect(nonce.bin_data).not_to be_nil
|
198
|
+
expect(nonce.bin_data.healthcare).to eq(Braintree::CreditCard::Healthcare::Yes)
|
199
|
+
expect(nonce.bin_data.product_id).to eq("J3")
|
180
200
|
end
|
181
201
|
|
182
202
|
it "returns bin_data with issuing_bank set to Network Only" do
|
@@ -184,9 +204,9 @@ describe Braintree::PaymentMethodNonce do
|
|
184
204
|
|
185
205
|
nonce = result.payment_method_nonce
|
186
206
|
|
187
|
-
result.
|
188
|
-
nonce.bin_data.
|
189
|
-
nonce.bin_data.issuing_bank.
|
207
|
+
expect(result).to be_success
|
208
|
+
expect(nonce.bin_data).not_to be_nil
|
209
|
+
expect(nonce.bin_data.issuing_bank).to eq("NETWORK ONLY")
|
190
210
|
end
|
191
211
|
|
192
212
|
it "returns bin_data with payroll set to Yes" do
|
@@ -194,10 +214,10 @@ describe Braintree::PaymentMethodNonce do
|
|
194
214
|
|
195
215
|
nonce = result.payment_method_nonce
|
196
216
|
|
197
|
-
result.
|
198
|
-
nonce.bin_data.
|
199
|
-
nonce.bin_data.payroll.
|
200
|
-
nonce.bin_data.product_id.
|
217
|
+
expect(result).to be_success
|
218
|
+
expect(nonce.bin_data).not_to be_nil
|
219
|
+
expect(nonce.bin_data.payroll).to eq(Braintree::CreditCard::Payroll::Yes)
|
220
|
+
expect(nonce.bin_data.product_id).to eq("MSA")
|
201
221
|
end
|
202
222
|
|
203
223
|
it "returns bin_data with prepaid set to Yes" do
|
@@ -205,9 +225,9 @@ describe Braintree::PaymentMethodNonce do
|
|
205
225
|
|
206
226
|
nonce = result.payment_method_nonce
|
207
227
|
|
208
|
-
result.
|
209
|
-
nonce.bin_data.
|
210
|
-
nonce.bin_data.prepaid.
|
228
|
+
expect(result).to be_success
|
229
|
+
expect(nonce.bin_data).not_to be_nil
|
230
|
+
expect(nonce.bin_data.prepaid).to eq(Braintree::CreditCard::Prepaid::Yes)
|
211
231
|
end
|
212
232
|
|
213
233
|
it "returns bin_data with unknown indicators" do
|
@@ -215,17 +235,17 @@ describe Braintree::PaymentMethodNonce do
|
|
215
235
|
|
216
236
|
nonce = result.payment_method_nonce
|
217
237
|
|
218
|
-
result.
|
219
|
-
nonce.bin_data.
|
220
|
-
nonce.bin_data.commercial.
|
221
|
-
nonce.bin_data.country_of_issuance.
|
222
|
-
nonce.bin_data.debit.
|
223
|
-
nonce.bin_data.durbin_regulated.
|
224
|
-
nonce.bin_data.healthcare.
|
225
|
-
nonce.bin_data.issuing_bank.
|
226
|
-
nonce.bin_data.payroll.
|
227
|
-
nonce.bin_data.prepaid.
|
228
|
-
nonce.bin_data.product_id.
|
238
|
+
expect(result).to be_success
|
239
|
+
expect(nonce.bin_data).not_to be_nil
|
240
|
+
expect(nonce.bin_data.commercial).to eq(Braintree::CreditCard::Commercial::Unknown)
|
241
|
+
expect(nonce.bin_data.country_of_issuance).to eq(Braintree::CreditCard::CountryOfIssuance::Unknown)
|
242
|
+
expect(nonce.bin_data.debit).to eq(Braintree::CreditCard::Debit::Unknown)
|
243
|
+
expect(nonce.bin_data.durbin_regulated).to eq(Braintree::CreditCard::DurbinRegulated::Unknown)
|
244
|
+
expect(nonce.bin_data.healthcare).to eq(Braintree::CreditCard::Healthcare::Unknown)
|
245
|
+
expect(nonce.bin_data.issuing_bank).to eq(Braintree::CreditCard::IssuingBank::Unknown)
|
246
|
+
expect(nonce.bin_data.payroll).to eq(Braintree::CreditCard::Payroll::Unknown)
|
247
|
+
expect(nonce.bin_data.prepaid).to eq(Braintree::CreditCard::Prepaid::Unknown)
|
248
|
+
expect(nonce.bin_data.product_id).to eq(Braintree::CreditCard::ProductId::Unknown)
|
229
249
|
end
|
230
250
|
|
231
251
|
it "correctly raises and exception for a non existent token" do
|
@@ -305,7 +325,7 @@ describe Braintree::PaymentMethodNonce do
|
|
305
325
|
payment_method_token,
|
306
326
|
payment_method_nonce: nonce_request,
|
307
327
|
)
|
308
|
-
result.
|
328
|
+
expect(result).to be_success
|
309
329
|
|
310
330
|
return result.payment_method_nonce.authentication_insight
|
311
331
|
end
|