braintree 2.98.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/braintree.gemspec +7 -4
- data/lib/braintree/account_updater_daily_report.rb +4 -4
- data/lib/braintree/ach_mandate.rb +1 -1
- data/lib/braintree/add_on_gateway.rb +1 -1
- data/lib/braintree/address.rb +7 -27
- data/lib/braintree/address_gateway.rb +8 -7
- data/lib/braintree/advanced_search.rb +11 -12
- data/lib/braintree/apple_pay.rb +4 -4
- data/lib/braintree/apple_pay_card.rb +18 -4
- data/lib/braintree/apple_pay_options.rb +4 -4
- data/lib/braintree/authorization_adjustment.rb +4 -4
- data/lib/braintree/base_module.rb +11 -1
- data/lib/braintree/bin_data.rb +10 -3
- data/lib/braintree/client_token.rb +1 -1
- data/lib/braintree/client_token_gateway.rb +4 -3
- data/lib/braintree/configuration.rb +35 -35
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +2 -2
- data/lib/braintree/connected_merchant_status_transitioned.rb +2 -2
- data/lib/braintree/credit_card.rb +40 -86
- data/lib/braintree/credit_card_gateway.rb +58 -44
- data/lib/braintree/credit_card_verification.rb +39 -20
- data/lib/braintree/credit_card_verification_gateway.rb +35 -5
- data/lib/braintree/credit_card_verification_search.rb +2 -2
- data/lib/braintree/customer.rb +23 -88
- data/lib/braintree/customer_gateway.rb +17 -32
- data/lib/braintree/customer_search.rb +2 -2
- data/lib/braintree/descriptor.rb +1 -1
- data/lib/braintree/digest.rb +1 -1
- data/lib/braintree/disbursement.rb +7 -7
- data/lib/braintree/discount_gateway.rb +1 -1
- data/lib/braintree/dispute/evidence.rb +1 -1
- data/lib/braintree/{transaction/coinbase_details.rb → dispute/paypal_message.rb} +5 -6
- data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
- data/lib/braintree/dispute/transaction.rb +3 -1
- data/lib/braintree/dispute/transaction_details.rb +1 -1
- data/lib/braintree/dispute.rb +47 -6
- data/lib/braintree/dispute_gateway.rb +5 -10
- data/lib/braintree/dispute_search.rb +8 -4
- data/lib/braintree/document_upload.rb +3 -3
- data/lib/braintree/document_upload_gateway.rb +3 -3
- data/lib/braintree/enriched_customer_data.rb +21 -0
- data/lib/braintree/error_codes.rb +217 -175
- data/lib/braintree/error_result.rb +2 -3
- data/lib/braintree/errors.rb +3 -3
- data/lib/braintree/exceptions.rb +6 -5
- data/lib/braintree/exchange_rate.rb +13 -0
- data/lib/braintree/exchange_rate_quote.rb +24 -0
- data/lib/braintree/exchange_rate_quote_gateway.rb +35 -0
- data/lib/braintree/exchange_rate_quote_input.rb +21 -0
- data/lib/braintree/exchange_rate_quote_request.rb +18 -0
- data/lib/braintree/exchange_rate_quote_response.rb +18 -0
- data/lib/braintree/facilitated_details.rb +1 -1
- data/lib/braintree/facilitator_details.rb +1 -1
- data/lib/braintree/gateway.rb +6 -12
- data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +18 -5
- data/lib/braintree/granted_payment_instrument_update.rb +2 -2
- data/lib/braintree/graphql_client.rb +14 -8
- data/lib/braintree/http.rb +9 -10
- data/lib/braintree/local_payment_completed/blik_alias.rb +23 -0
- data/lib/braintree/local_payment_completed.rb +10 -5
- data/lib/braintree/local_payment_expired.rb +21 -0
- data/lib/braintree/local_payment_funded.rb +22 -0
- data/lib/braintree/local_payment_reversed.rb +19 -0
- data/lib/braintree/merchant.rb +4 -4
- data/lib/braintree/merchant_account.rb +3 -3
- data/lib/braintree/merchant_account_gateway.rb +10 -8
- data/lib/braintree/merchant_gateway.rb +1 -1
- data/lib/braintree/meta_checkout_card.rb +89 -0
- data/lib/braintree/meta_checkout_token.rb +88 -0
- data/lib/braintree/modification.rb +4 -4
- data/lib/braintree/oauth_credentials.rb +4 -4
- data/lib/braintree/oauth_gateway.rb +5 -5
- data/lib/braintree/paginated_collection.rb +2 -2
- data/lib/braintree/paginated_result.rb +1 -1
- data/lib/braintree/payment_instrument_type.rb +14 -13
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +24 -0
- data/lib/braintree/payment_method_gateway.rb +52 -22
- data/lib/braintree/payment_method_nonce.rb +12 -7
- data/lib/braintree/payment_method_nonce_details.rb +40 -0
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
- data/lib/braintree/payment_method_nonce_gateway.rb +14 -3
- data/lib/braintree/payment_method_parser.rb +4 -7
- data/lib/braintree/paypal_account.rb +3 -2
- data/lib/braintree/paypal_account_gateway.rb +5 -5
- data/lib/braintree/plan.rb +22 -2
- data/lib/braintree/plan_gateway.rb +101 -1
- data/lib/braintree/processor_response_types.rb +3 -3
- data/lib/braintree/resource_collection.rb +10 -5
- data/lib/braintree/revoked_payment_method_metadata.rb +2 -2
- data/lib/braintree/risk_data/liability_shift.rb +22 -0
- data/lib/braintree/risk_data.rb +10 -3
- data/lib/braintree/samsung_pay_card.rb +8 -6
- data/lib/braintree/sepa_direct_debit_account.rb +60 -0
- data/lib/braintree/sepa_direct_debit_account_gateway.rb +25 -0
- data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +28 -0
- data/lib/braintree/settlement_batch_summary.rb +2 -2
- 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 +13 -13
- data/lib/braintree/subscription_gateway.rb +6 -6
- data/lib/braintree/subscription_search.rb +1 -1
- data/lib/braintree/successful_result.rb +5 -4
- data/lib/braintree/test/authentication_id.rb +21 -0
- data/lib/braintree/test/credit_card.rb +9 -10
- data/lib/braintree/test/merchant_account.rb +1 -1
- data/lib/braintree/test/nonce.rb +27 -20
- 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 +23 -11
- data/lib/braintree/transaction/address_details.rb +14 -1
- data/lib/braintree/transaction/apple_pay_details.rb +13 -10
- data/lib/braintree/transaction/credit_card_details.rb +8 -1
- data/lib/braintree/transaction/customer_details.rb +3 -2
- data/lib/braintree/transaction/disbursement_details.rb +2 -1
- data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +6 -1
- data/lib/braintree/transaction/installment/adjustment.rb +33 -0
- data/lib/braintree/transaction/installment.rb +28 -0
- data/lib/braintree/transaction/local_payment_details.rb +3 -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 +19 -0
- data/lib/braintree/transaction/payment_receipt/card_present_data.rb +36 -0
- data/lib/braintree/transaction/payment_receipt/merchant_address.rb +19 -0
- data/lib/braintree/transaction/payment_receipt.rb +31 -0
- data/lib/braintree/transaction/paypal_details.rb +5 -0
- data/lib/braintree/transaction/samsung_pay_card_details.rb +3 -1
- data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +27 -0
- data/lib/braintree/transaction/status_details.rb +1 -1
- data/lib/braintree/transaction/subscription_details.rb +3 -1
- data/lib/braintree/transaction/us_bank_account_details.rb +2 -1
- data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
- data/lib/braintree/transaction.rb +119 -128
- data/lib/braintree/transaction_gateway.rb +138 -64
- data/lib/braintree/transaction_line_item.rb +14 -11
- data/lib/braintree/transaction_line_item_gateway.rb +1 -1
- data/lib/braintree/transaction_review.rb +18 -0
- data/lib/braintree/transaction_search.rb +11 -7
- data/lib/braintree/unknown_payment_method.rb +2 -2
- data/lib/braintree/us_bank_account.rb +5 -5
- data/lib/braintree/us_bank_account_verification.rb +24 -16
- data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
- data/lib/braintree/us_bank_account_verification_search.rb +1 -1
- data/lib/braintree/util.rb +25 -10
- data/lib/braintree/validation_error.rb +1 -1
- data/lib/braintree/validation_error_collection.rb +3 -3
- data/lib/braintree/venmo_account.rb +4 -4
- data/lib/braintree/venmo_profile_data.rb +25 -0
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/visa_checkout_card.rb +8 -8
- data/lib/braintree/webhook_notification.rb +55 -33
- data/lib/braintree/webhook_notification_gateway.rb +9 -9
- data/lib/braintree/webhook_testing.rb +1 -1
- data/lib/braintree/webhook_testing_gateway.rb +569 -46
- data/lib/braintree/xml/generator.rb +6 -5
- data/lib/braintree/xml/libxml.rb +1 -1
- data/lib/braintree/xml/parser.rb +24 -37
- data/lib/braintree/xml/rexml.rb +6 -7
- data/lib/braintree/xml.rb +1 -1
- data/lib/braintree.rb +41 -24
- data/lib/ssl/api_braintreegateway_com.ca.crt +401 -168
- data/spec/integration/braintree/add_on_spec.rb +10 -10
- data/spec/integration/braintree/address_spec.rb +101 -178
- data/spec/integration/braintree/advanced_search_spec.rb +93 -93
- data/spec/integration/braintree/apple_pay_spec.rb +12 -12
- data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +279 -62
- data/spec/integration/braintree/client_api/spec_helper.rb +99 -73
- data/spec/integration/braintree/credit_card_spec.rb +522 -821
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +18 -18
- data/spec/integration/braintree/credit_card_verification_spec.rb +219 -30
- data/spec/integration/braintree/customer_search_spec.rb +28 -28
- data/spec/integration/braintree/customer_spec.rb +840 -757
- 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 +45 -9
- data/spec/integration/braintree/dispute_spec.rb +109 -82
- data/spec/integration/braintree/document_upload_spec.rb +29 -17
- data/spec/integration/braintree/error_codes_spec.rb +3 -3
- data/spec/integration/braintree/exchange_rate_quote_spec.rb +97 -0
- data/spec/integration/braintree/graphql_client_spec.rb +0 -2
- data/spec/integration/braintree/http_spec.rb +31 -33
- data/spec/integration/braintree/merchant_account_spec.rb +155 -156
- data/spec/integration/braintree/merchant_spec.rb +71 -192
- data/spec/integration/braintree/oauth_spec.rb +72 -72
- data/spec/integration/braintree/package_tracking_spec.rb +130 -0
- data/spec/integration/braintree/payment_method_nonce_spec.rb +173 -78
- data/spec/integration/braintree/payment_method_spec.rb +953 -501
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +147 -234
- data/spec/integration/braintree/paypal_account_spec.rb +74 -72
- data/spec/integration/braintree/plan_spec.rb +96 -15
- data/spec/integration/braintree/samsung_pay_card_spec.rb +75 -73
- data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +194 -0
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +18 -18
- data/spec/integration/braintree/subscription_spec.rb +507 -513
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +4 -4
- data/spec/integration/braintree/test_transaction_spec.rb +29 -29
- data/spec/integration/braintree/transaction_line_item_spec.rb +12 -6
- data/spec/integration/braintree/transaction_search_spec.rb +410 -217
- data/spec/integration/braintree/transaction_spec.rb +3252 -2102
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +42 -278
- data/spec/integration/braintree/us_bank_account_spec.rb +36 -36
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +25 -25
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +41 -41
- data/spec/integration/braintree/visa_checkout_card_spec.rb +62 -62
- data/spec/integration/spec_helper.rb +22 -7
- data/spec/oauth_test_helper.rb +1 -1
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec_helper.rb +15 -20
- data/spec/unit/braintree/address_spec.rb +9 -17
- data/spec/unit/braintree/apple_pay_card_spec.rb +110 -7
- data/spec/unit/braintree/base_module_spec.rb +4 -4
- data/spec/unit/braintree/client_token_spec.rb +6 -6
- data/spec/unit/braintree/configuration_spec.rb +84 -84
- data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
- data/spec/unit/braintree/credit_card_spec.rb +91 -58
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +56 -0
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +10 -10
- data/spec/unit/braintree/credit_card_verification_spec.rb +40 -18
- data/spec/unit/braintree/customer_spec.rb +102 -57
- data/spec/unit/braintree/digest_spec.rb +5 -6
- data/spec/unit/braintree/disbursement_spec.rb +14 -14
- data/spec/unit/braintree/dispute_search_spec.rb +6 -2
- data/spec/unit/braintree/dispute_spec.rb +144 -66
- data/spec/unit/braintree/document_upload_spec.rb +8 -8
- data/spec/unit/braintree/enriched_customer_data_spec.rb +41 -0
- data/spec/unit/braintree/error_result_spec.rb +11 -11
- data/spec/unit/braintree/errors_spec.rb +17 -17
- data/spec/unit/braintree/exchange_rate_quote_input_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_quote_request_spec.rb +82 -0
- data/spec/unit/braintree/exchange_rate_quote_response_spec.rb +52 -0
- data/spec/unit/braintree/exchange_rate_quote_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_spec.rb +23 -0
- data/spec/unit/braintree/http_spec.rb +19 -17
- data/spec/unit/braintree/local_payment_completed_spec.rb +62 -8
- data/spec/unit/braintree/local_payment_expired_spec.rb +24 -0
- data/spec/unit/braintree/local_payment_funded_spec.rb +34 -0
- data/spec/unit/braintree/merchant_account_spec.rb +5 -5
- 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 +77 -0
- data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +45 -0
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +51 -0
- data/spec/unit/braintree/payment_method_nonce_spec.rb +40 -0
- data/spec/unit/braintree/payment_method_spec.rb +20 -20
- data/spec/unit/braintree/paypal_account_spec.rb +16 -7
- data/spec/unit/braintree/resource_collection_spec.rb +34 -5
- data/spec/unit/braintree/risk_data/liability_shift.rb +26 -0
- data/spec/unit/braintree/risk_data_spec.rb +38 -8
- data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +29 -0
- data/spec/unit/braintree/sepa_debit_account_spec.rb +86 -0
- 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 +18 -18
- data/spec/unit/braintree/subscription_spec.rb +8 -8
- data/spec/unit/braintree/successful_result_spec.rb +6 -6
- data/spec/unit/braintree/three_d_secure_info_spec.rb +37 -17
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +22 -6
- data/spec/unit/braintree/transaction/customer_details_spec.rb +3 -2
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +4 -4
- data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
- data/spec/unit/braintree/transaction/local_payment_details_spec.rb +36 -0
- data/spec/unit/braintree/transaction/payment_receipt_spec.rb +73 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +63 -0
- data/spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb +33 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +150 -0
- data/spec/unit/braintree/transaction_search_spec.rb +12 -12
- data/spec/unit/braintree/transaction_spec.rb +221 -124
- 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 +78 -44
- data/spec/unit/braintree/validation_error_collection_spec.rb +62 -62
- data/spec/unit/braintree/validation_error_spec.rb +4 -4
- data/spec/unit/braintree/venmo_profile_data_spec.rb +43 -0
- data/spec/unit/braintree/webhook_notification_spec.rb +434 -197
- data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
- data/spec/unit/braintree/xml/parser_spec.rb +27 -22
- data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
- data/spec/unit/braintree/xml_spec.rb +38 -38
- data/spec/unit/braintree_spec.rb +2 -2
- metadata +91 -30
- data/lib/braintree/amex_express_checkout_card.rb +0 -38
- data/lib/braintree/coinbase_account.rb +0 -34
- data/lib/braintree/europe_bank_account.rb +0 -36
- data/lib/braintree/europe_bank_account_gateway.rb +0 -17
- data/lib/braintree/ideal_payment.rb +0 -61
- data/lib/braintree/ideal_payment_gateway.rb +0 -19
- data/lib/braintree/masterpass_card.rb +0 -81
- data/lib/braintree/settlement_batch.rb +0 -0
- data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
- data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
- data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
- data/lib/braintree/transparent_redirect.rb +0 -40
- data/lib/braintree/transparent_redirect_gateway.rb +0 -105
- data/spec/hacks/tcp_socket.rb +0 -18
- data/spec/integration/braintree/coinbase_spec.rb +0 -34
- data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
- data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
- data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
@@ -5,9 +5,9 @@ describe Braintree::Transaction::CreditCardDetails do
|
|
5
5
|
it "concats expiration_month and expiration_year" do
|
6
6
|
details = Braintree::Transaction::CreditCardDetails.new(
|
7
7
|
:expiration_month => "08",
|
8
|
-
:expiration_year => "2009"
|
8
|
+
:expiration_year => "2009",
|
9
9
|
)
|
10
|
-
details.expiration_date.
|
10
|
+
expect(details.expiration_date).to eq("08/2009")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -32,18 +32,34 @@ describe Braintree::Transaction::CreditCardDetails do
|
|
32
32
|
:country_of_issuance => "Lilliput",
|
33
33
|
:issuing_bank => "Gulliver Bank",
|
34
34
|
:image_url => "example.com/visa.png",
|
35
|
-
:unique_number_identifier => "abc123"
|
35
|
+
:unique_number_identifier => "abc123",
|
36
36
|
)
|
37
|
-
details.inspect.
|
37
|
+
expect(details.inspect).to eq(%(#<token: "token", bin: "123456", last_4: "6789", card_type: "Visa", expiration_date: "05/2012", cardholder_name: "The Cardholder", customer_location: "US", prepaid: "Yes", healthcare: "No", durbin_regulated: "No", debit: "Yes", commercial: "Unknown", payroll: "Unknown", product_id: "Unknown", country_of_issuance: "Lilliput", issuing_bank: "Gulliver Bank", image_url: "example.com/visa.png", unique_number_identifier: "abc123">))
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
describe "masked_number" do
|
42
42
|
it "concatenates the bin, some *'s, and the last_4" do
|
43
43
|
details = Braintree::Transaction::CreditCardDetails.new(
|
44
|
-
:bin => "510510", :last_4 => "5100"
|
44
|
+
:bin => "510510", :last_4 => "5100",
|
45
45
|
)
|
46
|
-
details.masked_number.
|
46
|
+
expect(details.masked_number).to eq("510510******5100")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe "is_network_tokenized" do
|
51
|
+
it "returns true if is_network_tokenized is true" do
|
52
|
+
details = Braintree::Transaction::CreditCardDetails.new(
|
53
|
+
:is_network_tokenized => true,
|
54
|
+
)
|
55
|
+
expect(details.is_network_tokenized?).to eq(true)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "returns false if is_network_tokenized is false" do
|
59
|
+
details = Braintree::Transaction::CreditCardDetails.new(
|
60
|
+
:is_network_tokenized => false,
|
61
|
+
)
|
62
|
+
expect(details.is_network_tokenized?).to eq(false)
|
47
63
|
end
|
48
64
|
end
|
49
65
|
end
|
@@ -11,9 +11,10 @@ describe Braintree::Transaction::CustomerDetails do
|
|
11
11
|
:company => "Smith Co.",
|
12
12
|
:website => "http://www.example.com",
|
13
13
|
:phone => "6145551234",
|
14
|
-
:
|
14
|
+
:international_phone => {:country_code=>"1", :national_number=>"3121234567"},
|
15
|
+
:fax => "3125551234",
|
15
16
|
)
|
16
|
-
details.inspect.
|
17
|
+
expect(details.inspect).to eq(%(#<id: "id", first_name: "Amy", last_name: "Smith", email: "amy.smith@example.com", company: "Smith Co.", website: "http://www.example.com", phone: "6145551234", international_phone: {:country_code=>\"1\", :national_number=>\"3121234567\"}, fax: "3125551234">))
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
@@ -4,15 +4,15 @@ describe Braintree::Transaction::DisbursementDetails do
|
|
4
4
|
describe "valid?" do
|
5
5
|
it "returns true if disbursement details are initialized" do
|
6
6
|
details = Braintree::Transaction::DisbursementDetails.new(
|
7
|
-
:disbursement_date => Date.new(2013, 4, 1)
|
7
|
+
:disbursement_date => Date.new(2013, 4, 1).to_s,
|
8
8
|
)
|
9
|
-
details.valid
|
9
|
+
expect(details.valid?).to eq(true)
|
10
10
|
end
|
11
11
|
it "returns true if disbursement details are initialized" do
|
12
12
|
details = Braintree::Transaction::DisbursementDetails.new(
|
13
|
-
:disbursement_date => nil
|
13
|
+
:disbursement_date => nil,
|
14
14
|
)
|
15
|
-
details.valid
|
15
|
+
expect(details.valid?).to eq(false)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::Transaction::Installment do
|
4
|
+
describe "inspect" do
|
5
|
+
it "assigns all fields" do
|
6
|
+
adjustment_attributes = {
|
7
|
+
:amount => "0.98",
|
8
|
+
:kind => "REFUND",
|
9
|
+
:projected_disbursement_date => "2020-01-03 01:02:03Z",
|
10
|
+
:actual_disbursement_date => "2020-01-04 01:02:03Z",
|
11
|
+
}
|
12
|
+
installment_attributes = {
|
13
|
+
:id => "abc123",
|
14
|
+
:amount => "1.23",
|
15
|
+
:projected_disbursement_date => "2020-01-01 01:02:03Z",
|
16
|
+
:actual_disbursement_date => "2020-01-02 01:02:03Z",
|
17
|
+
:adjustments => [adjustment_attributes],
|
18
|
+
}
|
19
|
+
|
20
|
+
installment = Braintree::Transaction::Installment.new(installment_attributes)
|
21
|
+
|
22
|
+
expect(installment.inspect).to eq('#<id: "abc123", amount: 0.123e1, projected_disbursement_date: "2020-01-01 01:02:03Z", actual_disbursement_date: "2020-01-02 01:02:03Z", adjustments: [#<amount: 0.98e0, kind: "REFUND", projected_disbursement_date: "2020-01-03 01:02:03Z", actual_disbursement_date: "2020-01-04 01:02:03Z">]>')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::Transaction::LocalPaymentDetails do
|
4
|
+
describe "initialize" do
|
5
|
+
let(:params) do
|
6
|
+
{
|
7
|
+
blik_aliases: [
|
8
|
+
{
|
9
|
+
key: "a-key",
|
10
|
+
label: "a-label"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
capture_id: "a-capture-id",
|
14
|
+
custom_field: "custom-field",
|
15
|
+
debug_id: "debug-id",
|
16
|
+
description: "description",
|
17
|
+
funding_source: "ideal",
|
18
|
+
implicitly_vaulted_payment_method_global_id: "global-id",
|
19
|
+
implicitly_vaulted_payment_method_token: "payment-method-token",
|
20
|
+
payer_id: "payer-id",
|
21
|
+
payment_id: "payment-id",
|
22
|
+
refund_from_transaction_fee_amount: "2.34",
|
23
|
+
refund_from_transaction_fee_currency_iso_code: "EUR",
|
24
|
+
refund_id: "a-refund-id",
|
25
|
+
transaction_fee_amount: "12.34",
|
26
|
+
transaction_fee_currency_iso_code: "EUR",
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
subject { described_class.new(params) }
|
31
|
+
|
32
|
+
it "sets all fields" do
|
33
|
+
is_expected.to have_attributes(**params)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::Transaction::PaymentReceipt do
|
4
|
+
describe "inspect" do
|
5
|
+
it "assigns all fields" do
|
6
|
+
details = Braintree::Transaction::PaymentReceipt.new(
|
7
|
+
:account_balance => "2.00",
|
8
|
+
:amount => "10.00",
|
9
|
+
:card_last_4 => "1111",
|
10
|
+
:card_present_data => {
|
11
|
+
:application_cryptogram => "application-cryptogram",
|
12
|
+
:application_identifier => "application-id",
|
13
|
+
:application_interchange_profile => "application-interchange",
|
14
|
+
:application_name => "application-name",
|
15
|
+
:application_transaction_counter => "application-transaction-counter",
|
16
|
+
:application_usage_control => "application-usage-control",
|
17
|
+
:authorization_mode => "Issuer",
|
18
|
+
:authorization_response_code => "auth-response-code",
|
19
|
+
:card_entry_method => "card-entry-method",
|
20
|
+
:card_sequence_number => "card-sequence-number",
|
21
|
+
:cardholder_verification_method_results => "cardholder-verification-method-results",
|
22
|
+
:cashback_amount => "20.00",
|
23
|
+
:cryptogram_information_data => "cryptogram-information-data",
|
24
|
+
:issuer_action_code_default => "issuer-action-code-default",
|
25
|
+
:issuer_action_code_denial => "issuer-action-code-denial",
|
26
|
+
:issuer_action_code_online => "issuer-action-code-online",
|
27
|
+
:issuer_authentication_data => "issuer-authentication-data",
|
28
|
+
:terminal_country_code => "USA",
|
29
|
+
:terminal_transaction_date => "2023-04-03",
|
30
|
+
:terminal_transaction_type => "terminal-transaction-type",
|
31
|
+
:terminal_verification_result => "terminal-verification-result",
|
32
|
+
:unpredictable_number => "unpredictable-number",
|
33
|
+
},
|
34
|
+
:card_type => "VISA",
|
35
|
+
:currency_iso_code => "USD",
|
36
|
+
:global_id => "global-id",
|
37
|
+
:id => "id",
|
38
|
+
:merchant_address => {
|
39
|
+
:locality => "Chicago",
|
40
|
+
:phone => "7708675309",
|
41
|
+
:postal_code => "60652",
|
42
|
+
:region => "IL",
|
43
|
+
:street_address => "123 Sesame St",
|
44
|
+
},
|
45
|
+
:merchant_identification_number => "merchant-id-number",
|
46
|
+
:merchant_name => "merchant-name",
|
47
|
+
:pin_verified => true,
|
48
|
+
:processor_authorization_code => "processor-auth-code",
|
49
|
+
:processor_response_code => "processor-response-code",
|
50
|
+
:processor_response_text => "processor-response-text",
|
51
|
+
:terminal_identification_number => "terminal-id",
|
52
|
+
:type => "sale",
|
53
|
+
)
|
54
|
+
|
55
|
+
expect(details.account_balance).to eq("2.00")
|
56
|
+
expect(details.amount).to eq("10.00")
|
57
|
+
expect(details.card_last_4).to eq("1111")
|
58
|
+
expect(details.card_present_data).to eq({application_cryptogram: "application-cryptogram", application_identifier: "application-id", application_interchange_profile: "application-interchange", application_name: "application-name", application_transaction_counter: "application-transaction-counter", application_usage_control: "application-usage-control", authorization_mode: "Issuer", authorization_response_code: "auth-response-code", card_entry_method: "card-entry-method", card_sequence_number: "card-sequence-number", cardholder_verification_method_results: "cardholder-verification-method-results", cashback_amount: "20.00", cryptogram_information_data: "cryptogram-information-data", issuer_action_code_default: "issuer-action-code-default", issuer_action_code_denial: "issuer-action-code-denial", issuer_action_code_online: "issuer-action-code-online", issuer_authentication_data: "issuer-authentication-data", terminal_country_code: "USA", terminal_transaction_date: "2023-04-03", terminal_transaction_type: "terminal-transaction-type", terminal_verification_result: "terminal-verification-result", unpredictable_number: "unpredictable-number"})
|
59
|
+
expect(details.card_type).to eq("VISA")
|
60
|
+
expect(details.currency_iso_code).to eq("USD")
|
61
|
+
expect(details.global_id).to eq("global-id")
|
62
|
+
expect(details.id).to eq("id")
|
63
|
+
expect(details.merchant_address).to eq({locality: "Chicago", phone: "7708675309", postal_code: "60652", region: "IL", street_address: "123 Sesame St"})
|
64
|
+
expect(details.merchant_identification_number).to eq("merchant-id-number")
|
65
|
+
expect(details.merchant_name).to eq("merchant-name")
|
66
|
+
expect(details.pin_verified).to be_truthy
|
67
|
+
expect(details.processor_authorization_code).to be("processor-auth-code")
|
68
|
+
expect(details.processor_response_text).to be("processor-response-text")
|
69
|
+
expect(details.terminal_identification_number).to be("terminal-id")
|
70
|
+
expect(details.type).to be("sale")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::Transaction::PayPalDetails do
|
4
|
+
describe "initialize" do
|
5
|
+
it "sets all fields" do
|
6
|
+
details = Braintree::Transaction::PayPalDetails.new(
|
7
|
+
:authorization_id => "id",
|
8
|
+
:billing_agreement_id => "billing-agreement-id",
|
9
|
+
:capture_id => "capture-id",
|
10
|
+
:custom_field => "custom-field",
|
11
|
+
:debug_id => "debug-id",
|
12
|
+
:description => "description",
|
13
|
+
:image_url => "www.image.com",
|
14
|
+
:implicitly_vaulted_payment_method_global_id => "global-id",
|
15
|
+
:implicitly_vaulted_payment_method_token => "payment-method-token",
|
16
|
+
:payee_email => "payee@example.com",
|
17
|
+
:payee_id => "payee-id",
|
18
|
+
:payer_email => "payer@example.com",
|
19
|
+
:payer_first_name => "Grace",
|
20
|
+
:payer_id => "payer-id",
|
21
|
+
:payer_last_name => "Hopper",
|
22
|
+
:payer_status =>"status",
|
23
|
+
:payment_id => "payment-id",
|
24
|
+
:refund_from_transaction_fee_amount => "1.00",
|
25
|
+
:refund_from_transaction_fee_currency_iso_code => "123",
|
26
|
+
:refund_id => "refund-id",
|
27
|
+
:seller_protection_status => "seller-protection-status",
|
28
|
+
:tax_id => "tax-id",
|
29
|
+
:tax_id_type => "tax-id-type",
|
30
|
+
:token => "token",
|
31
|
+
:transaction_fee_amount => "2.00",
|
32
|
+
:transaction_fee_currency_iso_code => "123",
|
33
|
+
)
|
34
|
+
|
35
|
+
expect(details.authorization_id).to eq("id")
|
36
|
+
expect(details.billing_agreement_id).to eq("billing-agreement-id")
|
37
|
+
expect(details.capture_id).to eq("capture-id")
|
38
|
+
expect(details.custom_field).to eq("custom-field")
|
39
|
+
expect(details.debug_id).to eq("debug-id")
|
40
|
+
expect(details.description).to eq("description")
|
41
|
+
expect(details.image_url).to eq("www.image.com")
|
42
|
+
expect(details.implicitly_vaulted_payment_method_global_id).to eq("global-id")
|
43
|
+
expect(details.implicitly_vaulted_payment_method_token).to eq("payment-method-token")
|
44
|
+
expect(details.payee_email).to eq("payee@example.com")
|
45
|
+
expect(details.payee_id).to eq("payee-id")
|
46
|
+
expect(details.payer_email).to eq("payer@example.com")
|
47
|
+
expect(details.payer_first_name).to eq("Grace")
|
48
|
+
expect(details.payer_id).to eq("payer-id")
|
49
|
+
expect(details.payer_last_name).to eq("Hopper")
|
50
|
+
expect(details.payer_status).to eq("status")
|
51
|
+
expect(details.payment_id).to eq("payment-id")
|
52
|
+
expect(details.refund_from_transaction_fee_amount).to eq("1.00")
|
53
|
+
expect(details.refund_from_transaction_fee_currency_iso_code).to eq("123")
|
54
|
+
expect(details.refund_id).to eq("refund-id")
|
55
|
+
expect(details.seller_protection_status).to eq("seller-protection-status")
|
56
|
+
expect(details.tax_id).to eq("tax-id")
|
57
|
+
expect(details.tax_id_type).to eq("tax-id-type")
|
58
|
+
expect(details.token).to eq("token")
|
59
|
+
expect(details.transaction_fee_amount).to eq("2.00")
|
60
|
+
expect(details.transaction_fee_currency_iso_code).to eq("123")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::Transaction::SepaDirectDebitAccountDetails do
|
4
|
+
describe "initialize" do
|
5
|
+
let(:params) do
|
6
|
+
{
|
7
|
+
bank_reference_token: "a-reference-token",
|
8
|
+
capture_id: "a-capture-id",
|
9
|
+
debug_id: "a-debug-id",
|
10
|
+
global_id: "a-global-id",
|
11
|
+
last_4: "1234",
|
12
|
+
mandate_type: "ONE_OFF",
|
13
|
+
merchant_or_partner_customer_id: "12312312343",
|
14
|
+
paypal_v2_order_id: "a-paypal-v2-order-id",
|
15
|
+
refund_from_transaction_fee_amount: "2.34",
|
16
|
+
refund_from_transaction_fee_currency_iso_code: "EUR",
|
17
|
+
refund_id: "a-refund-id",
|
18
|
+
settlement_type: "INSTANT",
|
19
|
+
token: "a-token",
|
20
|
+
transaction_fee_amount: "12.34",
|
21
|
+
transaction_fee_currency_iso_code: "EUR",
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
subject do
|
26
|
+
described_class.new(params)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "sets all fields" do
|
30
|
+
is_expected.to have_attributes(**params)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
|
+
|
3
|
+
describe Braintree::TransactionGateway do
|
4
|
+
describe "Transaction Gateway" do
|
5
|
+
let(:gateway) do
|
6
|
+
config = Braintree::Configuration.new(
|
7
|
+
:merchant_id => "merchant_id",
|
8
|
+
:public_key => "public_key",
|
9
|
+
:private_key => "private_key",
|
10
|
+
)
|
11
|
+
Braintree::Gateway.new(config)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "creates a transactionGateway gateway" do
|
15
|
+
result = Braintree::TransactionGateway.new(gateway)
|
16
|
+
|
17
|
+
expect(result.inspect).to include("merchant_id")
|
18
|
+
expect(result.inspect).to include("public_key")
|
19
|
+
expect(result.inspect).to include("private_key")
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "self.create" do
|
23
|
+
it "raises an exception if attributes contain an invalid key" do
|
24
|
+
expect do
|
25
|
+
transaction = Braintree::TransactionGateway.new(gateway)
|
26
|
+
transaction.create(:invalid_key => "val")
|
27
|
+
end.to raise_error(ArgumentError, "invalid keys: invalid_key")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# NEXT_MAJOR_VERSION Remove three_d_secure_token, venmo_sdk_payment_method_code, and venmo_sdk_session
|
32
|
+
# the old venmo SDK has been deprecated
|
33
|
+
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
34
|
+
it "creates a transaction gateway signature" do
|
35
|
+
expect(Braintree::TransactionGateway._create_signature).to match([
|
36
|
+
:amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
37
|
+
:discount_amount, :exchange_rate_quote_id, :foreign_retailer,
|
38
|
+
:merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token,
|
39
|
+
:product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
|
40
|
+
:shared_customer_id, :shared_payment_method_nonce, :shared_payment_method_token,
|
41
|
+
:shared_shipping_address_id, :shipping_address_id, :shipping_amount, :shipping_tax_amount,
|
42
|
+
:ships_from_postal_code, :tax_amount, :tax_exempt, :three_d_secure_authentication_id,:three_d_secure_token, #Deprecated
|
43
|
+
:transaction_source, :type, :venmo_sdk_payment_method_code, # Deprecated
|
44
|
+
:sca_exemption,
|
45
|
+
{:apple_pay_card => [:number, :cardholder_name, :cryptogram, :expiration_month, :expiration_year, :eci_indicator]},
|
46
|
+
{
|
47
|
+
:billing => Braintree::AddressGateway._shared_signature
|
48
|
+
},
|
49
|
+
{:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number, {:payment_reader_card_details => [:encrypted_card_data, :key_serial_number]}, {:network_tokenization_attributes => [:cryptogram, :ecommerce_indicator, :token_requestor_id]}]},
|
50
|
+
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
|
51
|
+
{:custom_fields => :_any_key_},
|
52
|
+
{:descriptor => [:name, :phone, :url]},
|
53
|
+
{:external_vault => [
|
54
|
+
:status,
|
55
|
+
:previous_network_transaction_id,
|
56
|
+
]},
|
57
|
+
{:google_pay_card => [:number, :cryptogram, :google_transaction_id, :expiration_month, :expiration_year, :source_card_type, :source_card_last_four, :eci_indicator]},
|
58
|
+
{:industry => [
|
59
|
+
:industry_type,
|
60
|
+
{:data => [
|
61
|
+
:country_code, :date_of_birth, :folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
62
|
+
:passenger_first_name, :passenger_last_name, :passenger_middle_initial, :passenger_title, :issued_date, :travel_agency_name, :travel_agency_code, :ticket_number,
|
63
|
+
:issuing_carrier_code, :customer_code, :fare_amount, :fee_amount, :tax_amount, :restricted_ticket, :no_show, :advanced_deposit, :fire_safe, :property_phone, :ticket_issuer_address, :arrival_date,
|
64
|
+
{:legs => [
|
65
|
+
:conjunction_ticket, :exchange_ticket, :coupon_number, :service_class, :carrier_code, :fare_basis_code, :flight_number, :departure_date, :departure_airport_code, :departure_time,
|
66
|
+
:arrival_airport_code, :arrival_time, :stopover_permitted, :fare_amount, :fee_amount, :tax_amount, :endorsement_or_restrictions,
|
67
|
+
]},
|
68
|
+
{:additional_charges => [
|
69
|
+
:kind, :amount,
|
70
|
+
]},
|
71
|
+
]},
|
72
|
+
]},
|
73
|
+
{:installments => [:count]},
|
74
|
+
{:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]},
|
75
|
+
{:options => [
|
76
|
+
:hold_in_escrow,
|
77
|
+
:store_in_vault,
|
78
|
+
:store_in_vault_on_success,
|
79
|
+
:submit_for_settlement,
|
80
|
+
:add_billing_address_to_payment_method,
|
81
|
+
:store_shipping_address_in_vault,
|
82
|
+
:venmo_sdk_session, # Deprecated
|
83
|
+
:payee_id,
|
84
|
+
:payee_email,
|
85
|
+
:skip_advanced_fraud_checking,
|
86
|
+
:skip_avs,
|
87
|
+
:skip_cvv,
|
88
|
+
{:paypal => [:custom_field, :payee_id, :payee_email, :description, {:supplementary_data => :_any_key_}]},
|
89
|
+
{:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]},
|
90
|
+
{:three_d_secure => [:required]},
|
91
|
+
{:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
|
92
|
+
{:venmo => [:profile_id]},
|
93
|
+
{:credit_card => [:account_type, :process_debit_as_credit]},
|
94
|
+
]
|
95
|
+
},
|
96
|
+
{:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
|
97
|
+
{:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
|
98
|
+
{
|
99
|
+
:shipping => Braintree::AddressGateway._shared_signature + [:shipping_method],
|
100
|
+
},
|
101
|
+
{
|
102
|
+
:three_d_secure_pass_thru => [
|
103
|
+
:eci_flag,
|
104
|
+
:cavv,
|
105
|
+
:xid,
|
106
|
+
:three_d_secure_version,
|
107
|
+
:authentication_response,
|
108
|
+
:directory_response,
|
109
|
+
:cavv_algorithm,
|
110
|
+
:ds_transaction_id,
|
111
|
+
]
|
112
|
+
},
|
113
|
+
])
|
114
|
+
end
|
115
|
+
|
116
|
+
it "creates a transaction gateway submit for settlement signature" do
|
117
|
+
expect(Braintree::TransactionGateway._submit_for_settlement_signature).to match([
|
118
|
+
:order_id,
|
119
|
+
{:descriptor => [:name, :phone, :url]},
|
120
|
+
{:industry => [
|
121
|
+
:industry_type,
|
122
|
+
{:data => [
|
123
|
+
:country_code, :date_of_birth, :folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
124
|
+
:passenger_first_name, :passenger_last_name, :passenger_middle_initial, :passenger_title, :issued_date, :travel_agency_name, :travel_agency_code, :ticket_number,
|
125
|
+
:issuing_carrier_code, :customer_code, :fare_amount, :fee_amount, :tax_amount, :restricted_ticket, :no_show, :advanced_deposit, :fire_safe, :property_phone, :ticket_issuer_address, :arrival_date,
|
126
|
+
{:legs => [
|
127
|
+
:conjunction_ticket, :exchange_ticket, :coupon_number, :service_class, :carrier_code, :fare_basis_code, :flight_number, :departure_date, :departure_airport_code, :departure_time,
|
128
|
+
:arrival_airport_code, :arrival_time, :stopover_permitted, :fare_amount, :fee_amount, :tax_amount, :endorsement_or_restrictions,
|
129
|
+
]},
|
130
|
+
{:additional_charges => [
|
131
|
+
:kind, :amount,
|
132
|
+
]},
|
133
|
+
]},
|
134
|
+
]},
|
135
|
+
:purchase_order_number,
|
136
|
+
:tax_amount,
|
137
|
+
:tax_exempt,
|
138
|
+
:discount_amount,
|
139
|
+
:shipping_amount,
|
140
|
+
:shipping_tax_amount,
|
141
|
+
:ships_from_postal_code,
|
142
|
+
:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url],
|
143
|
+
])
|
144
|
+
end
|
145
|
+
|
146
|
+
it "creates transaction gateway submit for partial settlement signature" do
|
147
|
+
expect(Braintree::TransactionGateway._submit_for_partial_settlement_signature).to include(:final_capture)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
2
|
|
3
3
|
describe Braintree::TransactionSearch do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
it "overrides previous 'is' with new 'is' for the same field" do
|
5
|
+
search = Braintree::TransactionSearch.new
|
6
|
+
search.billing_company.is "one"
|
7
|
+
search.billing_company.is "two"
|
8
|
+
expect(search.to_hash).to eq({:billing_company => {:is => "two"}})
|
9
|
+
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
it "overrides previous 'in' with new 'in' for the same field" do
|
12
|
+
search = Braintree::TransactionSearch.new
|
13
|
+
search.status.in Braintree::Transaction::Status::Authorized
|
14
|
+
search.status.in Braintree::Transaction::Status::SubmittedForSettlement
|
15
|
+
expect(search.to_hash).to eq({:status => [Braintree::Transaction::Status::SubmittedForSettlement]})
|
16
|
+
end
|
17
17
|
|
18
18
|
it "raises if the operator 'is' is left off" do
|
19
19
|
search = Braintree::TransactionSearch.new
|