braintree 4.14.0 → 4.18.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_gateway.rb +28 -11
- 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_codes.rb +4 -0
- 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 +5 -5
- 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 +2 -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/package_details.rb +16 -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 +37 -20
- data/lib/braintree/transaction_gateway.rb +44 -15
- data/lib/braintree/transaction_line_item.rb +13 -10
- 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 +4 -4
- 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 +3 -3
- data/lib/braintree/xml/rexml.rb +2 -2
- data/lib/braintree/xml.rb +1 -1
- data/lib/braintree.rb +5 -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/client_api/spec_helper.rb +2 -2
- data/spec/integration/braintree/credit_card_spec.rb +227 -228
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
- data/spec/integration/braintree/credit_card_verification_spec.rb +98 -53
- data/spec/integration/braintree/customer_search_spec.rb +20 -20
- data/spec/integration/braintree/customer_spec.rb +317 -317
- 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/package_tracking_spec.rb +111 -0
- data/spec/integration/braintree/payment_method_nonce_spec.rb +89 -69
- data/spec/integration/braintree/payment_method_spec.rb +391 -391
- 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 +12 -6
- data/spec/integration/braintree/transaction_search_spec.rb +225 -165
- data/spec/integration/braintree/transaction_spec.rb +1606 -1230
- 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 +33 -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/package_tracking_spec.rb +74 -0
- 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 +41 -9
- 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 +14 -2
@@ -21,42 +21,42 @@ describe Braintree::SamsungPayCard do
|
|
21
21
|
:country_name => "United States of America"
|
22
22
|
},
|
23
23
|
)
|
24
|
-
result.
|
24
|
+
expect(result).to be_success
|
25
25
|
|
26
26
|
samsung_pay_card = result.payment_method
|
27
|
-
samsung_pay_card.
|
28
|
-
samsung_pay_card.billing_address.
|
29
|
-
samsung_pay_card.bin.
|
30
|
-
samsung_pay_card.cardholder_name.
|
31
|
-
samsung_pay_card.card_type.
|
32
|
-
samsung_pay_card.commercial.
|
33
|
-
samsung_pay_card.country_of_issuance.
|
34
|
-
samsung_pay_card.created_at.
|
35
|
-
samsung_pay_card.customer_id.
|
36
|
-
samsung_pay_card.customer_location.
|
37
|
-
samsung_pay_card.debit.
|
38
|
-
samsung_pay_card.default
|
39
|
-
samsung_pay_card.durbin_regulated.
|
40
|
-
samsung_pay_card.expiration_date.
|
41
|
-
samsung_pay_card.expiration_month.
|
42
|
-
samsung_pay_card.expiration_year.
|
43
|
-
samsung_pay_card.expired
|
44
|
-
samsung_pay_card.healthcare.
|
45
|
-
samsung_pay_card.image_url.
|
46
|
-
samsung_pay_card.issuing_bank.
|
47
|
-
samsung_pay_card.last_4.
|
48
|
-
samsung_pay_card.payroll.
|
49
|
-
samsung_pay_card.prepaid.
|
50
|
-
samsung_pay_card.product_id.
|
51
|
-
samsung_pay_card.source_card_last_4.
|
52
|
-
samsung_pay_card.subscriptions.
|
53
|
-
samsung_pay_card.token.
|
54
|
-
samsung_pay_card.unique_number_identifier.
|
55
|
-
samsung_pay_card.updated_at.
|
27
|
+
expect(samsung_pay_card).to be_a(Braintree::SamsungPayCard)
|
28
|
+
expect(samsung_pay_card.billing_address).not_to be_nil
|
29
|
+
expect(samsung_pay_card.bin).not_to be_nil
|
30
|
+
expect(samsung_pay_card.cardholder_name).not_to be_nil
|
31
|
+
expect(samsung_pay_card.card_type).not_to be_nil
|
32
|
+
expect(samsung_pay_card.commercial).not_to be_nil
|
33
|
+
expect(samsung_pay_card.country_of_issuance).not_to be_nil
|
34
|
+
expect(samsung_pay_card.created_at).not_to be_nil
|
35
|
+
expect(samsung_pay_card.customer_id).not_to be_nil
|
36
|
+
expect(samsung_pay_card.customer_location).not_to be_nil
|
37
|
+
expect(samsung_pay_card.debit).not_to be_nil
|
38
|
+
expect(samsung_pay_card.default?).not_to be_nil
|
39
|
+
expect(samsung_pay_card.durbin_regulated).not_to be_nil
|
40
|
+
expect(samsung_pay_card.expiration_date).not_to be_nil
|
41
|
+
expect(samsung_pay_card.expiration_month).not_to be_nil
|
42
|
+
expect(samsung_pay_card.expiration_year).not_to be_nil
|
43
|
+
expect(samsung_pay_card.expired?).not_to be_nil
|
44
|
+
expect(samsung_pay_card.healthcare).not_to be_nil
|
45
|
+
expect(samsung_pay_card.image_url).not_to be_nil
|
46
|
+
expect(samsung_pay_card.issuing_bank).not_to be_nil
|
47
|
+
expect(samsung_pay_card.last_4).not_to be_nil
|
48
|
+
expect(samsung_pay_card.payroll).not_to be_nil
|
49
|
+
expect(samsung_pay_card.prepaid).not_to be_nil
|
50
|
+
expect(samsung_pay_card.product_id).not_to be_nil
|
51
|
+
expect(samsung_pay_card.source_card_last_4).not_to be_nil
|
52
|
+
expect(samsung_pay_card.subscriptions).not_to be_nil
|
53
|
+
expect(samsung_pay_card.token).not_to be_nil
|
54
|
+
expect(samsung_pay_card.unique_number_identifier).not_to be_nil
|
55
|
+
expect(samsung_pay_card.updated_at).not_to be_nil
|
56
56
|
|
57
57
|
customer = Braintree::Customer.find(customer.id)
|
58
|
-
customer.samsung_pay_cards.size.
|
59
|
-
customer.samsung_pay_cards.first.
|
58
|
+
expect(customer.samsung_pay_cards.size).to eq(1)
|
59
|
+
expect(customer.samsung_pay_cards.first).to eq(samsung_pay_card)
|
60
60
|
end
|
61
61
|
|
62
62
|
it "returns cardholder_name and billing_address" do
|
@@ -79,18 +79,18 @@ describe Braintree::SamsungPayCard do
|
|
79
79
|
},
|
80
80
|
)
|
81
81
|
|
82
|
-
result.
|
83
|
-
result.payment_method.cardholder_name.
|
82
|
+
expect(result).to be_success
|
83
|
+
expect(result.payment_method.cardholder_name).to eq("Jenny Block")
|
84
84
|
|
85
85
|
address = result.payment_method.billing_address
|
86
|
-
address.first_name.
|
87
|
-
address.last_name.
|
88
|
-
address.company.
|
89
|
-
address.street_address.
|
90
|
-
address.extended_address.
|
91
|
-
address.locality.
|
92
|
-
address.region.
|
93
|
-
address.postal_code.
|
86
|
+
expect(address.first_name).to eq("New First Name")
|
87
|
+
expect(address.last_name).to eq("New Last Name")
|
88
|
+
expect(address.company).to eq("New Company")
|
89
|
+
expect(address.street_address).to eq("123 New St")
|
90
|
+
expect(address.extended_address).to eq("Apt New")
|
91
|
+
expect(address.locality).to eq("New City")
|
92
|
+
expect(address.region).to eq("New State")
|
93
|
+
expect(address.postal_code).to eq("56789")
|
94
94
|
end
|
95
95
|
|
96
96
|
it "can search for transactions" do
|
@@ -98,14 +98,14 @@ describe Braintree::SamsungPayCard do
|
|
98
98
|
:payment_method_nonce => Braintree::Test::Nonce::SamsungPayDiscover,
|
99
99
|
:amount => "47.00",
|
100
100
|
)
|
101
|
-
transaction_create_result.
|
101
|
+
expect(transaction_create_result).to be_success
|
102
102
|
transaction_id = transaction_create_result.transaction.id
|
103
103
|
|
104
104
|
search_results = Braintree::Transaction.search do |search|
|
105
105
|
search.id.is transaction_id
|
106
106
|
search.payment_instrument_type.is Braintree::PaymentInstrumentType::SamsungPayCard
|
107
107
|
end
|
108
|
-
search_results.first.id.
|
108
|
+
expect(search_results.first.id).to eq(transaction_id)
|
109
109
|
end
|
110
110
|
|
111
111
|
it "can create transaction from nonce and vault" do
|
@@ -117,28 +117,28 @@ describe Braintree::SamsungPayCard do
|
|
117
117
|
:amount => "47.00",
|
118
118
|
:options => {:store_in_vault => true},
|
119
119
|
)
|
120
|
-
result.
|
120
|
+
expect(result).to be_success
|
121
121
|
|
122
122
|
samsung_pay_card_details = result.transaction.samsung_pay_card_details
|
123
|
-
samsung_pay_card_details.bin.
|
124
|
-
samsung_pay_card_details.card_type.
|
125
|
-
samsung_pay_card_details.commercial.
|
126
|
-
samsung_pay_card_details.country_of_issuance.
|
127
|
-
samsung_pay_card_details.customer_location.
|
128
|
-
samsung_pay_card_details.debit.
|
129
|
-
samsung_pay_card_details.durbin_regulated.
|
130
|
-
samsung_pay_card_details.expiration_date.
|
131
|
-
samsung_pay_card_details.expiration_month.
|
132
|
-
samsung_pay_card_details.expiration_year.
|
133
|
-
samsung_pay_card_details.healthcare.
|
134
|
-
samsung_pay_card_details.image_url.
|
135
|
-
samsung_pay_card_details.issuing_bank.
|
136
|
-
samsung_pay_card_details.last_4.
|
137
|
-
samsung_pay_card_details.payroll.
|
138
|
-
samsung_pay_card_details.prepaid.
|
139
|
-
samsung_pay_card_details.product_id.
|
140
|
-
samsung_pay_card_details.source_card_last_4.
|
141
|
-
samsung_pay_card_details.source_card_last_4.
|
142
|
-
samsung_pay_card_details.token.
|
123
|
+
expect(samsung_pay_card_details.bin).not_to be_nil
|
124
|
+
expect(samsung_pay_card_details.card_type).not_to be_nil
|
125
|
+
expect(samsung_pay_card_details.commercial).not_to be_nil
|
126
|
+
expect(samsung_pay_card_details.country_of_issuance).not_to be_nil
|
127
|
+
expect(samsung_pay_card_details.customer_location).not_to be_nil
|
128
|
+
expect(samsung_pay_card_details.debit).not_to be_nil
|
129
|
+
expect(samsung_pay_card_details.durbin_regulated).not_to be_nil
|
130
|
+
expect(samsung_pay_card_details.expiration_date).not_to be_nil
|
131
|
+
expect(samsung_pay_card_details.expiration_month).not_to be_nil
|
132
|
+
expect(samsung_pay_card_details.expiration_year).not_to be_nil
|
133
|
+
expect(samsung_pay_card_details.healthcare).not_to be_nil
|
134
|
+
expect(samsung_pay_card_details.image_url).not_to be_nil
|
135
|
+
expect(samsung_pay_card_details.issuing_bank).not_to be_nil
|
136
|
+
expect(samsung_pay_card_details.last_4).not_to be_nil
|
137
|
+
expect(samsung_pay_card_details.payroll).not_to be_nil
|
138
|
+
expect(samsung_pay_card_details.prepaid).not_to be_nil
|
139
|
+
expect(samsung_pay_card_details.product_id).not_to be_nil
|
140
|
+
expect(samsung_pay_card_details.source_card_last_4).not_to be_nil
|
141
|
+
expect(samsung_pay_card_details.source_card_last_4).to eq("3333")
|
142
|
+
expect(samsung_pay_card_details.token).not_to be_nil
|
143
143
|
end
|
144
144
|
end
|
@@ -25,19 +25,19 @@ describe Braintree::SepaDirectDebitAccount do
|
|
25
25
|
context "when payment method exists" do
|
26
26
|
it "returns a payment method" do
|
27
27
|
sepa_direct_debit_account = subject
|
28
|
-
sepa_direct_debit_account.
|
29
|
-
sepa_direct_debit_account.last_4.
|
30
|
-
sepa_direct_debit_account.default.
|
31
|
-
sepa_direct_debit_account.customer_id.
|
32
|
-
sepa_direct_debit_account.global_id.
|
33
|
-
sepa_direct_debit_account.customer_global_id.
|
34
|
-
sepa_direct_debit_account.bank_reference_token.
|
35
|
-
sepa_direct_debit_account.mandate_type.
|
36
|
-
sepa_direct_debit_account.merchant_or_partner_customer_id.
|
37
|
-
sepa_direct_debit_account.token.
|
38
|
-
sepa_direct_debit_account.image_url.
|
39
|
-
sepa_direct_debit_account.created_at.
|
40
|
-
sepa_direct_debit_account.updated_at.
|
28
|
+
expect(sepa_direct_debit_account).to be_a(Braintree::SepaDirectDebitAccount)
|
29
|
+
expect(sepa_direct_debit_account.last_4).to eq("1234")
|
30
|
+
expect(sepa_direct_debit_account.default).to eq(true)
|
31
|
+
expect(sepa_direct_debit_account.customer_id).to eq(customer.id)
|
32
|
+
expect(sepa_direct_debit_account.global_id).not_to be_empty
|
33
|
+
expect(sepa_direct_debit_account.customer_global_id).not_to be_empty
|
34
|
+
expect(sepa_direct_debit_account.bank_reference_token).to eq("a-fake-bank-reference-token")
|
35
|
+
expect(sepa_direct_debit_account.mandate_type).to eq("RECURRENT")
|
36
|
+
expect(sepa_direct_debit_account.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
|
37
|
+
expect(sepa_direct_debit_account.token).not_to be_empty
|
38
|
+
expect(sepa_direct_debit_account.image_url).not_to be_empty
|
39
|
+
expect(sepa_direct_debit_account.created_at).to be_a Time
|
40
|
+
expect(sepa_direct_debit_account.updated_at).to be_a Time
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -79,7 +79,7 @@ describe Braintree::SepaDirectDebitAccount do
|
|
79
79
|
|
80
80
|
context "when payment method exists" do
|
81
81
|
it "deletes a payment method" do
|
82
|
-
|
82
|
+
is_expected.to be_success
|
83
83
|
|
84
84
|
expect {
|
85
85
|
described_class.find(token)
|
@@ -111,28 +111,28 @@ describe Braintree::SepaDirectDebitAccount do
|
|
111
111
|
|
112
112
|
context "when payment method exists" do
|
113
113
|
it "creates a transaction" do
|
114
|
-
|
114
|
+
is_expected.to be_success
|
115
115
|
|
116
116
|
transaction = subject.transaction
|
117
|
-
transaction.amount.
|
118
|
-
transaction.status.
|
117
|
+
expect(transaction.amount).to eq(1.23)
|
118
|
+
expect(transaction.status).to eq("settling")
|
119
119
|
sepa_direct_debit_account_details = transaction.sepa_direct_debit_account_details
|
120
|
-
sepa_direct_debit_account_details.
|
121
|
-
sepa_direct_debit_account_details.bank_reference_token.
|
122
|
-
sepa_direct_debit_account_details.capture_id.
|
123
|
-
sepa_direct_debit_account_details.debug_id.
|
124
|
-
sepa_direct_debit_account_details.global_id.
|
125
|
-
sepa_direct_debit_account_details.last_4.
|
126
|
-
sepa_direct_debit_account_details.mandate_type.
|
127
|
-
sepa_direct_debit_account_details.merchant_or_partner_customer_id.
|
128
|
-
sepa_direct_debit_account_details.paypal_v2_order_id.
|
129
|
-
sepa_direct_debit_account_details.refund_from_transaction_fee_amount.
|
130
|
-
sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code.
|
131
|
-
sepa_direct_debit_account_details.refund_id.
|
132
|
-
sepa_direct_debit_account_details.settlement_type.
|
133
|
-
sepa_direct_debit_account_details.token.
|
134
|
-
sepa_direct_debit_account_details.transaction_fee_amount.
|
135
|
-
sepa_direct_debit_account_details.transaction_fee_currency_iso_code.
|
120
|
+
expect(sepa_direct_debit_account_details).to be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
|
121
|
+
expect(sepa_direct_debit_account_details.bank_reference_token).to eq("a-fake-bank-reference-token")
|
122
|
+
expect(sepa_direct_debit_account_details.capture_id).not_to be_empty
|
123
|
+
expect(sepa_direct_debit_account_details.debug_id).to be_nil
|
124
|
+
expect(sepa_direct_debit_account_details.global_id).not_to be_empty
|
125
|
+
expect(sepa_direct_debit_account_details.last_4).to eq("1234")
|
126
|
+
expect(sepa_direct_debit_account_details.mandate_type).to eq("RECURRENT")
|
127
|
+
expect(sepa_direct_debit_account_details.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
|
128
|
+
expect(sepa_direct_debit_account_details.paypal_v2_order_id).to be_nil
|
129
|
+
expect(sepa_direct_debit_account_details.refund_from_transaction_fee_amount).to be_nil
|
130
|
+
expect(sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code).to be_nil
|
131
|
+
expect(sepa_direct_debit_account_details.refund_id).to be_nil
|
132
|
+
expect(sepa_direct_debit_account_details.settlement_type).to be_nil
|
133
|
+
expect(sepa_direct_debit_account_details.token).to eq(token)
|
134
|
+
expect(sepa_direct_debit_account_details.transaction_fee_amount).to eq("0.01")
|
135
|
+
expect(sepa_direct_debit_account_details.transaction_fee_currency_iso_code).to eq("USD")
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
@@ -161,25 +161,25 @@ describe Braintree::SepaDirectDebitAccount do
|
|
161
161
|
context "when payment method exists" do
|
162
162
|
it "creates a transaction" do
|
163
163
|
transaction = subject
|
164
|
-
transaction.amount.
|
165
|
-
transaction.status.
|
164
|
+
expect(transaction.amount).to eq(1.23)
|
165
|
+
expect(transaction.status).to eq("settling")
|
166
166
|
sepa_direct_debit_account_details = transaction.sepa_direct_debit_account_details
|
167
|
-
sepa_direct_debit_account_details.
|
168
|
-
sepa_direct_debit_account_details.bank_reference_token.
|
169
|
-
sepa_direct_debit_account_details.capture_id.
|
170
|
-
sepa_direct_debit_account_details.debug_id.
|
171
|
-
sepa_direct_debit_account_details.global_id.
|
172
|
-
sepa_direct_debit_account_details.last_4.
|
173
|
-
sepa_direct_debit_account_details.mandate_type.
|
174
|
-
sepa_direct_debit_account_details.merchant_or_partner_customer_id.
|
175
|
-
sepa_direct_debit_account_details.paypal_v2_order_id.
|
176
|
-
sepa_direct_debit_account_details.refund_from_transaction_fee_amount.
|
177
|
-
sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code.
|
178
|
-
sepa_direct_debit_account_details.refund_id.
|
179
|
-
sepa_direct_debit_account_details.settlement_type.
|
180
|
-
sepa_direct_debit_account_details.token.
|
181
|
-
sepa_direct_debit_account_details.transaction_fee_amount.
|
182
|
-
sepa_direct_debit_account_details.transaction_fee_currency_iso_code.
|
167
|
+
expect(sepa_direct_debit_account_details).to be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
|
168
|
+
expect(sepa_direct_debit_account_details.bank_reference_token).to eq("a-fake-bank-reference-token")
|
169
|
+
expect(sepa_direct_debit_account_details.capture_id).not_to be_empty
|
170
|
+
expect(sepa_direct_debit_account_details.debug_id).to be_nil
|
171
|
+
expect(sepa_direct_debit_account_details.global_id).not_to be_empty
|
172
|
+
expect(sepa_direct_debit_account_details.last_4).to eq("1234")
|
173
|
+
expect(sepa_direct_debit_account_details.mandate_type).to eq("RECURRENT")
|
174
|
+
expect(sepa_direct_debit_account_details.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
|
175
|
+
expect(sepa_direct_debit_account_details.paypal_v2_order_id).to be_nil
|
176
|
+
expect(sepa_direct_debit_account_details.refund_from_transaction_fee_amount).to be_nil
|
177
|
+
expect(sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code).to be_nil
|
178
|
+
expect(sepa_direct_debit_account_details.refund_id).to be_nil
|
179
|
+
expect(sepa_direct_debit_account_details.settlement_type).to be_nil
|
180
|
+
expect(sepa_direct_debit_account_details.token).to eq(token)
|
181
|
+
expect(sepa_direct_debit_account_details.transaction_fee_amount).to eq("0.01")
|
182
|
+
expect(sepa_direct_debit_account_details.transaction_fee_currency_iso_code).to eq("USD")
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
@@ -5,14 +5,14 @@ describe Braintree::SettlementBatchSummary do
|
|
5
5
|
describe "self.generate" do
|
6
6
|
it "returns an empty collection if there is not data" do
|
7
7
|
result = Braintree::SettlementBatchSummary.generate("1979-01-01")
|
8
|
-
result.
|
9
|
-
result.settlement_batch_summary.records.size.
|
8
|
+
expect(result).to be_success
|
9
|
+
expect(result.settlement_batch_summary.records.size).to be_zero
|
10
10
|
end
|
11
11
|
|
12
12
|
it "returns an error response if the date cannot be parsed" do
|
13
13
|
result = Braintree::SettlementBatchSummary.generate("NOT A DATE :(")
|
14
|
-
result.
|
15
|
-
result.errors.for(:settlement_batch_summary).on(:settlement_date).map { |e| e.code }.
|
14
|
+
expect(result).not_to be_success
|
15
|
+
expect(result.errors.for(:settlement_batch_summary).on(:settlement_date).map { |e| e.code }).to include(Braintree::ErrorCodes::SettlementBatchSummary::SettlementDateIsInvalid)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "returns transactions settled on a given day" do
|
@@ -29,10 +29,10 @@ describe Braintree::SettlementBatchSummary do
|
|
29
29
|
settlement_date = result[:transaction][:settlement_batch_id].split("_").first
|
30
30
|
result = Braintree::SettlementBatchSummary.generate(settlement_date)
|
31
31
|
|
32
|
-
result.
|
32
|
+
expect(result).to be_success
|
33
33
|
amex_records = result.settlement_batch_summary.records.select { |row| row[:card_type] == Braintree::CreditCard::CardType::AmEx }
|
34
|
-
amex_records.first[:count].to_i.
|
35
|
-
amex_records.first[:amount_settled].to_i.
|
34
|
+
expect(amex_records.first[:count].to_i).to be >= 1
|
35
|
+
expect(amex_records.first[:amount_settled].to_i).to be >= Braintree::Test::TransactionAmounts::Authorize.to_i
|
36
36
|
end
|
37
37
|
|
38
38
|
it "can be grouped by a custom field" do
|
@@ -52,11 +52,11 @@ describe Braintree::SettlementBatchSummary do
|
|
52
52
|
settlement_date = result[:transaction][:settlement_batch_id].split("_").first
|
53
53
|
result = Braintree::SettlementBatchSummary.generate(settlement_date, "store_me")
|
54
54
|
|
55
|
-
result.
|
55
|
+
expect(result).to be_success
|
56
56
|
amex_records = result.settlement_batch_summary.records.select { |row| row[:store_me] == "1" }
|
57
|
-
amex_records.
|
58
|
-
amex_records.first[:count].to_i.
|
59
|
-
amex_records.first[:amount_settled].to_i.
|
57
|
+
expect(amex_records).not_to be_empty
|
58
|
+
expect(amex_records.first[:count].to_i).to be >= 1
|
59
|
+
expect(amex_records.first[:amount_settled].to_i).to be >= Braintree::Test::TransactionAmounts::Authorize.to_i
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|