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
@@ -7,7 +7,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
7
7
|
search.account_holder_name.is "thisnameisnotreal"
|
8
8
|
end
|
9
9
|
|
10
|
-
collection.maximum_size.
|
10
|
+
expect(collection.maximum_size).to eq(0)
|
11
11
|
end
|
12
12
|
|
13
13
|
let(:nonce) { generate_non_plaid_us_bank_account_nonce }
|
@@ -21,7 +21,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
21
21
|
:customer_id => customer.id,
|
22
22
|
:options => {
|
23
23
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
24
|
-
}
|
24
|
+
},
|
25
25
|
).payment_method
|
26
26
|
verification = payment_method.verifications.first
|
27
27
|
|
@@ -40,14 +40,14 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
40
40
|
search.id.is verification.id
|
41
41
|
search.send(criterion).is value
|
42
42
|
end
|
43
|
-
collection.maximum_size.
|
44
|
-
collection.first.id.
|
43
|
+
expect(collection.maximum_size).to eq(1)
|
44
|
+
expect(collection.first.id).to eq(verification.id)
|
45
45
|
|
46
46
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
47
47
|
search.id.is verification.id
|
48
48
|
search.send(criterion).is "invalid_attribute"
|
49
49
|
end
|
50
|
-
collection.
|
50
|
+
expect(collection).to be_empty
|
51
51
|
end
|
52
52
|
|
53
53
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
@@ -57,8 +57,8 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
collection.maximum_size.
|
61
|
-
collection.first.id.
|
60
|
+
expect(collection.maximum_size).to eq(1)
|
61
|
+
expect(collection.first.id).to eq(verification.id)
|
62
62
|
end
|
63
63
|
|
64
64
|
describe "multiple value fields" do
|
@@ -70,7 +70,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
70
70
|
:customer_id => customer.id,
|
71
71
|
:options => {
|
72
72
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
73
|
-
}
|
73
|
+
},
|
74
74
|
).payment_method
|
75
75
|
verification1 = payment_method1.verifications.first
|
76
76
|
|
@@ -79,7 +79,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
79
79
|
:customer_id => customer.id,
|
80
80
|
:options => {
|
81
81
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
82
|
-
}
|
82
|
+
},
|
83
83
|
).payment_method
|
84
84
|
verification2 = payment_method2.verifications.first
|
85
85
|
|
@@ -87,7 +87,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
87
87
|
search.ids.in verification1.id, verification2.id
|
88
88
|
end
|
89
89
|
|
90
|
-
collection.maximum_size.
|
90
|
+
expect(collection.maximum_size).to eq(2)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
@@ -100,7 +100,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
100
100
|
:customer_id => customer.id,
|
101
101
|
:options => {
|
102
102
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
103
|
-
}
|
103
|
+
},
|
104
104
|
).payment_method
|
105
105
|
verification = payment_method.verifications.first
|
106
106
|
|
@@ -110,46 +110,46 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
110
110
|
search.id.is verification.id
|
111
111
|
search.created_at.between(
|
112
112
|
created_at - 60,
|
113
|
-
created_at + 60
|
113
|
+
created_at + 60,
|
114
114
|
)
|
115
115
|
end
|
116
116
|
|
117
|
-
collection.maximum_size.
|
118
|
-
collection.first.id.
|
117
|
+
expect(collection.maximum_size).to eq(1)
|
118
|
+
expect(collection.first.id).to eq(verification.id)
|
119
119
|
|
120
120
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
121
121
|
search.id.is verification.id
|
122
122
|
search.created_at >= created_at - 1
|
123
123
|
end
|
124
124
|
|
125
|
-
collection.maximum_size.
|
126
|
-
collection.first.id.
|
125
|
+
expect(collection.maximum_size).to eq(1)
|
126
|
+
expect(collection.first.id).to eq(verification.id)
|
127
127
|
|
128
128
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
129
129
|
search.id.is verification.id
|
130
130
|
search.created_at <= created_at + 1
|
131
131
|
end
|
132
132
|
|
133
|
-
collection.maximum_size.
|
134
|
-
collection.first.id.
|
133
|
+
expect(collection.maximum_size).to eq(1)
|
134
|
+
expect(collection.first.id).to eq(verification.id)
|
135
135
|
|
136
136
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
137
137
|
search.id.is verification.id
|
138
138
|
search.created_at.between(
|
139
139
|
created_at - 300,
|
140
|
-
created_at - 100
|
140
|
+
created_at - 100,
|
141
141
|
)
|
142
142
|
end
|
143
143
|
|
144
|
-
collection.maximum_size.
|
144
|
+
expect(collection.maximum_size).to eq(0)
|
145
145
|
|
146
146
|
collection = Braintree::UsBankAccountVerification.search do |search|
|
147
147
|
search.id.is verification.id
|
148
148
|
search.created_at.is created_at
|
149
149
|
end
|
150
150
|
|
151
|
-
collection.maximum_size.
|
152
|
-
collection.first.id.
|
151
|
+
expect(collection.maximum_size).to eq(1)
|
152
|
+
expect(collection.first.id).to eq(verification.id)
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
@@ -162,7 +162,7 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
162
162
|
:customer_id => customer.id,
|
163
163
|
:options => {
|
164
164
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
165
|
-
}
|
165
|
+
},
|
166
166
|
).payment_method
|
167
167
|
verification = payment_method.verifications.first
|
168
168
|
|
@@ -171,8 +171,8 @@ describe Braintree::UsBankAccountVerification, "search" do
|
|
171
171
|
search.account_number.ends_with "0000"
|
172
172
|
end
|
173
173
|
|
174
|
-
collection.maximum_size.
|
175
|
-
collection.first.id.
|
174
|
+
expect(collection.maximum_size).to eq(1)
|
175
|
+
expect(collection.first.id).to eq(verification.id)
|
176
176
|
end
|
177
177
|
end
|
178
178
|
end
|
@@ -36,23 +36,23 @@ describe Braintree::UsBankAccountVerification do
|
|
36
36
|
:options => {
|
37
37
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
38
38
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
|
39
|
-
}
|
39
|
+
},
|
40
40
|
)
|
41
41
|
|
42
|
-
result.
|
42
|
+
expect(result).to be_success
|
43
43
|
|
44
44
|
verification = result.payment_method.verifications.first
|
45
|
-
verification.verification_method.
|
46
|
-
verification.status.
|
45
|
+
expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
|
46
|
+
expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
|
47
47
|
|
48
48
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [17, 29])
|
49
49
|
|
50
|
-
response.
|
51
|
-
response.us_bank_account_verification.status.
|
50
|
+
expect(response).to be_success
|
51
|
+
expect(response.us_bank_account_verification.status).to eq(Braintree::UsBankAccountVerification::Status::Verified)
|
52
52
|
|
53
53
|
us_bank_account = Braintree::UsBankAccount.find(response.us_bank_account_verification.us_bank_account[:token])
|
54
54
|
|
55
|
-
us_bank_account.verified.
|
55
|
+
expect(us_bank_account.verified).to be_truthy
|
56
56
|
end
|
57
57
|
|
58
58
|
it "successfully confirms not-yet-settled amounts" do
|
@@ -64,19 +64,19 @@ describe Braintree::UsBankAccountVerification do
|
|
64
64
|
:options => {
|
65
65
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
66
66
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
|
67
|
-
}
|
67
|
+
},
|
68
68
|
)
|
69
69
|
|
70
|
-
result.
|
70
|
+
expect(result).to be_success
|
71
71
|
|
72
72
|
verification = result.payment_method.verifications.first
|
73
|
-
verification.verification_method.
|
74
|
-
verification.status.
|
73
|
+
expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
|
74
|
+
expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
|
75
75
|
|
76
76
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [17, 29])
|
77
77
|
|
78
|
-
response.
|
79
|
-
response.us_bank_account_verification.status.
|
78
|
+
expect(response).to be_success
|
79
|
+
expect(response.us_bank_account_verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
|
80
80
|
end
|
81
81
|
|
82
82
|
it "attempts to confirm" do
|
@@ -86,19 +86,19 @@ describe Braintree::UsBankAccountVerification do
|
|
86
86
|
:options => {
|
87
87
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
88
88
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
|
89
|
-
}
|
89
|
+
},
|
90
90
|
)
|
91
91
|
|
92
|
-
result.
|
92
|
+
expect(result).to be_success
|
93
93
|
|
94
94
|
verification = result.payment_method.verifications.first
|
95
|
-
verification.verification_method.
|
96
|
-
verification.status.
|
95
|
+
expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
|
96
|
+
expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
|
97
97
|
|
98
98
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
|
99
99
|
|
100
|
-
response.
|
101
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
100
|
+
expect(response).not_to be_success
|
101
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch)
|
102
102
|
end
|
103
103
|
|
104
104
|
it "exceeds the confirmation attempt threshold" do
|
@@ -108,10 +108,10 @@ describe Braintree::UsBankAccountVerification do
|
|
108
108
|
:options => {
|
109
109
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
110
110
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
|
111
|
-
}
|
111
|
+
},
|
112
112
|
)
|
113
113
|
|
114
|
-
result.
|
114
|
+
expect(result).to be_success
|
115
115
|
|
116
116
|
verification = result.payment_method.verifications.first
|
117
117
|
|
@@ -119,17 +119,17 @@ describe Braintree::UsBankAccountVerification do
|
|
119
119
|
4.times do
|
120
120
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
|
121
121
|
|
122
|
-
response.
|
123
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
122
|
+
expect(response).not_to be_success
|
123
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch)
|
124
124
|
end
|
125
125
|
|
126
126
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
|
127
|
-
response.
|
128
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
127
|
+
expect(response).not_to be_success
|
128
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts)
|
129
129
|
|
130
130
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
|
131
|
-
response.
|
132
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
131
|
+
expect(response).not_to be_success
|
132
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts)
|
133
133
|
end
|
134
134
|
|
135
135
|
it "returns an error for invalid deposit amounts" do
|
@@ -139,16 +139,16 @@ describe Braintree::UsBankAccountVerification do
|
|
139
139
|
:options => {
|
140
140
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
141
141
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
|
142
|
-
}
|
142
|
+
},
|
143
143
|
)
|
144
144
|
|
145
|
-
result.
|
145
|
+
expect(result).to be_success
|
146
146
|
|
147
147
|
verification = result.payment_method.verifications.first
|
148
148
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, ["abc"])
|
149
149
|
|
150
|
-
response.
|
151
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
150
|
+
expect(response).not_to be_success
|
151
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::InvalidDepositAmounts)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -160,16 +160,16 @@ describe Braintree::UsBankAccountVerification do
|
|
160
160
|
:options => {
|
161
161
|
:verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
|
162
162
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
|
163
|
-
}
|
163
|
+
},
|
164
164
|
)
|
165
165
|
|
166
|
-
result.
|
166
|
+
expect(result).to be_success
|
167
167
|
|
168
168
|
verification = result.payment_method.verifications.first
|
169
169
|
response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
|
170
170
|
|
171
|
-
response.
|
172
|
-
response.errors.for(:us_bank_account_verification)[0].code.
|
171
|
+
expect(response).not_to be_success
|
172
|
+
expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::MustBeMicroTransfersVerification)
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|
@@ -182,15 +182,15 @@ describe Braintree::UsBankAccountVerification do
|
|
182
182
|
:options => {
|
183
183
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
184
184
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
|
185
|
-
}
|
185
|
+
},
|
186
186
|
)
|
187
187
|
|
188
|
-
result.
|
188
|
+
expect(result).to be_success
|
189
189
|
|
190
190
|
created_verification = result.payment_method.verifications.first
|
191
191
|
found_verification = Braintree::UsBankAccountVerification.find(created_verification.id)
|
192
192
|
|
193
|
-
found_verification.
|
193
|
+
expect(found_verification).to eq(created_verification)
|
194
194
|
end
|
195
195
|
|
196
196
|
it "raises a NotFoundError exception if verification cannot be found" do
|
@@ -208,7 +208,7 @@ describe Braintree::UsBankAccountVerification do
|
|
208
208
|
:options => {
|
209
209
|
:verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
210
210
|
:us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
|
211
|
-
}
|
211
|
+
},
|
212
212
|
).payment_method
|
213
213
|
end
|
214
214
|
|
@@ -224,7 +224,7 @@ describe Braintree::UsBankAccountVerification do
|
|
224
224
|
search.verification_method.in created_verification.verification_method
|
225
225
|
end
|
226
226
|
|
227
|
-
found_verifications.
|
227
|
+
expect(found_verifications).to include(created_verification)
|
228
228
|
end
|
229
229
|
|
230
230
|
it "searches and finds verifications using customer fields" do
|
@@ -234,7 +234,7 @@ describe Braintree::UsBankAccountVerification do
|
|
234
234
|
search.payment_method_token.is payment_method.token
|
235
235
|
end
|
236
236
|
|
237
|
-
found_verifications.count.
|
237
|
+
expect(found_verifications.count).to eq(1)
|
238
238
|
end
|
239
239
|
end
|
240
240
|
end
|
@@ -7,44 +7,44 @@ describe Braintree::VisaCheckoutCard do
|
|
7
7
|
|
8
8
|
result = Braintree::PaymentMethod.create(
|
9
9
|
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
10
|
-
:customer_id => customer.id
|
10
|
+
:customer_id => customer.id,
|
11
11
|
)
|
12
|
-
result.
|
12
|
+
expect(result).to be_success
|
13
13
|
|
14
14
|
visa_checkout_card = result.payment_method
|
15
|
-
visa_checkout_card.
|
16
|
-
visa_checkout_card.call_id.
|
17
|
-
visa_checkout_card.billing_address.
|
18
|
-
visa_checkout_card.bin.
|
19
|
-
visa_checkout_card.card_type.
|
20
|
-
visa_checkout_card.cardholder_name.
|
21
|
-
visa_checkout_card.commercial.
|
22
|
-
visa_checkout_card.country_of_issuance.
|
23
|
-
visa_checkout_card.created_at.
|
24
|
-
visa_checkout_card.customer_id.
|
25
|
-
visa_checkout_card.customer_location.
|
26
|
-
visa_checkout_card.debit.
|
27
|
-
visa_checkout_card.default
|
28
|
-
visa_checkout_card.durbin_regulated.
|
29
|
-
visa_checkout_card.expiration_date.
|
30
|
-
visa_checkout_card.expiration_month.
|
31
|
-
visa_checkout_card.expiration_year.
|
32
|
-
visa_checkout_card.expired
|
33
|
-
visa_checkout_card.healthcare.
|
34
|
-
visa_checkout_card.image_url.
|
35
|
-
visa_checkout_card.issuing_bank.
|
36
|
-
visa_checkout_card.last_4.
|
37
|
-
visa_checkout_card.payroll.
|
38
|
-
visa_checkout_card.prepaid.
|
39
|
-
visa_checkout_card.product_id.
|
40
|
-
visa_checkout_card.subscriptions.
|
41
|
-
visa_checkout_card.token.
|
42
|
-
visa_checkout_card.unique_number_identifier.
|
43
|
-
visa_checkout_card.updated_at.
|
15
|
+
expect(visa_checkout_card).to be_a(Braintree::VisaCheckoutCard)
|
16
|
+
expect(visa_checkout_card.call_id).to eq("abc123")
|
17
|
+
expect(visa_checkout_card.billing_address).not_to be_nil
|
18
|
+
expect(visa_checkout_card.bin).not_to be_nil
|
19
|
+
expect(visa_checkout_card.card_type).not_to be_nil
|
20
|
+
expect(visa_checkout_card.cardholder_name).not_to be_nil
|
21
|
+
expect(visa_checkout_card.commercial).not_to be_nil
|
22
|
+
expect(visa_checkout_card.country_of_issuance).not_to be_nil
|
23
|
+
expect(visa_checkout_card.created_at).not_to be_nil
|
24
|
+
expect(visa_checkout_card.customer_id).not_to be_nil
|
25
|
+
expect(visa_checkout_card.customer_location).not_to be_nil
|
26
|
+
expect(visa_checkout_card.debit).not_to be_nil
|
27
|
+
expect(visa_checkout_card.default?).not_to be_nil
|
28
|
+
expect(visa_checkout_card.durbin_regulated).not_to be_nil
|
29
|
+
expect(visa_checkout_card.expiration_date).not_to be_nil
|
30
|
+
expect(visa_checkout_card.expiration_month).not_to be_nil
|
31
|
+
expect(visa_checkout_card.expiration_year).not_to be_nil
|
32
|
+
expect(visa_checkout_card.expired?).not_to be_nil
|
33
|
+
expect(visa_checkout_card.healthcare).not_to be_nil
|
34
|
+
expect(visa_checkout_card.image_url).not_to be_nil
|
35
|
+
expect(visa_checkout_card.issuing_bank).not_to be_nil
|
36
|
+
expect(visa_checkout_card.last_4).not_to be_nil
|
37
|
+
expect(visa_checkout_card.payroll).not_to be_nil
|
38
|
+
expect(visa_checkout_card.prepaid).not_to be_nil
|
39
|
+
expect(visa_checkout_card.product_id).not_to be_nil
|
40
|
+
expect(visa_checkout_card.subscriptions).not_to be_nil
|
41
|
+
expect(visa_checkout_card.token).not_to be_nil
|
42
|
+
expect(visa_checkout_card.unique_number_identifier).not_to be_nil
|
43
|
+
expect(visa_checkout_card.updated_at).not_to be_nil
|
44
44
|
|
45
45
|
customer = Braintree::Customer.find(customer.id)
|
46
|
-
customer.visa_checkout_cards.size.
|
47
|
-
customer.visa_checkout_cards.first.
|
46
|
+
expect(customer.visa_checkout_cards.size).to eq(1)
|
47
|
+
expect(customer.visa_checkout_cards.first).to eq(visa_checkout_card)
|
48
48
|
end
|
49
49
|
|
50
50
|
it "can create with verification" do
|
@@ -53,25 +53,25 @@ describe Braintree::VisaCheckoutCard do
|
|
53
53
|
result = Braintree::PaymentMethod.create(
|
54
54
|
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
55
55
|
:customer_id => customer.id,
|
56
|
-
:options => {
|
56
|
+
:options => {:verify_card => true},
|
57
57
|
)
|
58
|
-
result.
|
59
|
-
result.payment_method.verification.status.
|
58
|
+
expect(result).to be_success
|
59
|
+
expect(result.payment_method.verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
60
60
|
end
|
61
61
|
|
62
62
|
it "can search for transactions" do
|
63
63
|
transaction_create_result = Braintree::Transaction.sale(
|
64
64
|
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
65
|
-
:amount =>
|
65
|
+
:amount => "47.00",
|
66
66
|
)
|
67
|
-
transaction_create_result.
|
67
|
+
expect(transaction_create_result).to be_success
|
68
68
|
transaction_id = transaction_create_result.transaction.id
|
69
69
|
|
70
70
|
search_results = Braintree::Transaction.search do |search|
|
71
71
|
search.id.is transaction_id
|
72
72
|
search.payment_instrument_type.is Braintree::PaymentInstrumentType::VisaCheckoutCard
|
73
73
|
end
|
74
|
-
search_results.first.id.
|
74
|
+
expect(search_results.first.id).to eq(transaction_id)
|
75
75
|
end
|
76
76
|
|
77
77
|
it "can create transaction from nonce and vault" do
|
@@ -80,31 +80,31 @@ describe Braintree::VisaCheckoutCard do
|
|
80
80
|
result = Braintree::Transaction.sale(
|
81
81
|
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
82
82
|
:customer_id => customer.id,
|
83
|
-
:amount =>
|
84
|
-
:options => {
|
83
|
+
:amount => "47.00",
|
84
|
+
:options => {:store_in_vault => true},
|
85
85
|
)
|
86
|
-
result.
|
86
|
+
expect(result).to be_success
|
87
87
|
|
88
88
|
visa_checkout_card_details = result.transaction.visa_checkout_card_details
|
89
|
-
visa_checkout_card_details.call_id.
|
90
|
-
visa_checkout_card_details.bin.
|
91
|
-
visa_checkout_card_details.card_type.
|
92
|
-
visa_checkout_card_details.cardholder_name.
|
93
|
-
visa_checkout_card_details.commercial.
|
94
|
-
visa_checkout_card_details.country_of_issuance.
|
95
|
-
visa_checkout_card_details.customer_location.
|
96
|
-
visa_checkout_card_details.debit.
|
97
|
-
visa_checkout_card_details.durbin_regulated.
|
98
|
-
visa_checkout_card_details.expiration_date.
|
99
|
-
visa_checkout_card_details.expiration_month.
|
100
|
-
visa_checkout_card_details.expiration_year.
|
101
|
-
visa_checkout_card_details.healthcare.
|
102
|
-
visa_checkout_card_details.image_url.
|
103
|
-
visa_checkout_card_details.issuing_bank.
|
104
|
-
visa_checkout_card_details.last_4.
|
105
|
-
visa_checkout_card_details.payroll.
|
106
|
-
visa_checkout_card_details.prepaid.
|
107
|
-
visa_checkout_card_details.product_id.
|
108
|
-
visa_checkout_card_details.token.
|
89
|
+
expect(visa_checkout_card_details.call_id).to eq("abc123")
|
90
|
+
expect(visa_checkout_card_details.bin).not_to be_nil
|
91
|
+
expect(visa_checkout_card_details.card_type).not_to be_nil
|
92
|
+
expect(visa_checkout_card_details.cardholder_name).not_to be_nil
|
93
|
+
expect(visa_checkout_card_details.commercial).not_to be_nil
|
94
|
+
expect(visa_checkout_card_details.country_of_issuance).not_to be_nil
|
95
|
+
expect(visa_checkout_card_details.customer_location).not_to be_nil
|
96
|
+
expect(visa_checkout_card_details.debit).not_to be_nil
|
97
|
+
expect(visa_checkout_card_details.durbin_regulated).not_to be_nil
|
98
|
+
expect(visa_checkout_card_details.expiration_date).not_to be_nil
|
99
|
+
expect(visa_checkout_card_details.expiration_month).not_to be_nil
|
100
|
+
expect(visa_checkout_card_details.expiration_year).not_to be_nil
|
101
|
+
expect(visa_checkout_card_details.healthcare).not_to be_nil
|
102
|
+
expect(visa_checkout_card_details.image_url).not_to be_nil
|
103
|
+
expect(visa_checkout_card_details.issuing_bank).not_to be_nil
|
104
|
+
expect(visa_checkout_card_details.last_4).not_to be_nil
|
105
|
+
expect(visa_checkout_card_details.payroll).not_to be_nil
|
106
|
+
expect(visa_checkout_card_details.prepaid).not_to be_nil
|
107
|
+
expect(visa_checkout_card_details.product_id).not_to be_nil
|
108
|
+
expect(visa_checkout_card_details.token).not_to be_nil
|
109
109
|
end
|
110
110
|
end
|
@@ -2,10 +2,9 @@ require "securerandom"
|
|
2
2
|
|
3
3
|
unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
|
4
4
|
INTEGRATION_SPEC_HELPER_LOADED = true
|
5
|
-
SSL_TEST_PORT = ENV[
|
5
|
+
SSL_TEST_PORT = ENV["SSL_TEST_PORT"] || 8444
|
6
6
|
|
7
7
|
require File.dirname(__FILE__) + "/../spec_helper"
|
8
|
-
require File.dirname(__FILE__) + "/../hacks/tcp_socket"
|
9
8
|
|
10
9
|
def start_ssl_server
|
11
10
|
web_server_pid_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "httpsd.pid"))
|
@@ -13,11 +12,9 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
|
|
13
12
|
FileUtils.rm(web_server_pid_file) if File.exist?(web_server_pid_file)
|
14
13
|
command = File.expand_path(File.join(File.dirname(__FILE__), "..", "script", "httpsd.rb"))
|
15
14
|
`#{command} #{web_server_pid_file}`
|
16
|
-
TCPSocket.
|
15
|
+
TCPSocket.new("127.0.0.1",SSL_TEST_PORT)
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
10.times { unless File.exists?(web_server_pid_file); sleep 1; end }
|
17
|
+
10.times { unless File.exist?(web_server_pid_file); sleep 1; end }
|
21
18
|
ensure
|
22
19
|
Process.kill "INT", File.read(web_server_pid_file).to_i
|
23
20
|
end
|
@@ -45,12 +42,24 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
|
|
45
42
|
end
|
46
43
|
end
|
47
44
|
|
48
|
-
def
|
45
|
+
def with_advanced_fraud_kount_integration_merchant(&block)
|
49
46
|
with_other_merchant("advanced_fraud_integration_merchant_id", "advanced_fraud_integration_public_key", "advanced_fraud_integration_private_key") do
|
50
47
|
block.call
|
51
48
|
end
|
52
49
|
end
|
53
50
|
|
51
|
+
def with_fraud_protection_enterprise_merchant(&block)
|
52
|
+
with_other_merchant("fraud_protection_enterprise_integration_merchant_id", "fraud_protection_enterprise_integration_public_key", "fraud_protection_enterprise_integration_private_key") do
|
53
|
+
block.call
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def with_chargeback_protection_merchant(&block)
|
58
|
+
with_other_merchant("fraud_protection_effortless_chargeback_protection_merchant_id", "effortless_chargeback_protection_public_key", "effortless_chargeback_protection_private_key") do
|
59
|
+
block.call
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
54
63
|
def with_altpay_merchant(&block)
|
55
64
|
with_other_merchant("altpay_merchant", "altpay_merchant_public_key", "altpay_merchant_private_key", &block)
|
56
65
|
end
|
@@ -58,4 +67,10 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
|
|
58
67
|
def random_payment_method_token
|
59
68
|
"payment-method-token-#{SecureRandom.hex(6)}"
|
60
69
|
end
|
70
|
+
|
71
|
+
def with_duplicate_checking_merchant(&block)
|
72
|
+
with_other_merchant("dup_checking_integration_merchant_id", "dup_checking_integration_public_key", "dup_checking_integration_private_key") do
|
73
|
+
block.call
|
74
|
+
end
|
75
|
+
end
|
61
76
|
end
|
data/spec/oauth_test_helper.rb
CHANGED
data/spec/script/httpsd.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
2
|
+
require "webrick"
|
3
|
+
require "webrick/https"
|
4
|
+
require "openssl"
|
5
5
|
|
6
6
|
private_key_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "privateKey.key"))
|
7
7
|
cert_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "certificate.crt"))
|
@@ -12,7 +12,7 @@ cert = OpenSSL::X509::Certificate.new(File.read(cert_file))
|
|
12
12
|
pid_file = ARGV[0]
|
13
13
|
|
14
14
|
s = WEBrick::HTTPServer.new(
|
15
|
-
:Port => (ENV[
|
15
|
+
:Port => (ENV["SSL_TEST_PORT"] || 8444),
|
16
16
|
:Logger => WEBrick::Log::new(nil, WEBrick::Log::ERROR),
|
17
17
|
:DocumentRoot => File.join(File.dirname(__FILE__)),
|
18
18
|
:ServerType => WEBrick::Daemon,
|
@@ -21,7 +21,7 @@ s = WEBrick::HTTPServer.new(
|
|
21
21
|
:SSLCertificate => cert,
|
22
22
|
:SSLPrivateKey => pkey,
|
23
23
|
:SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ],
|
24
|
-
:StartCallback => proc { File.open(pid_file, "w") { |f| f.write $$.to_s }}
|
24
|
+
:StartCallback => proc { File.open(pid_file, "w") { |f| f.write $$.to_s } },
|
25
25
|
)
|
26
|
-
trap("INT"){ s.shutdown }
|
26
|
+
trap("INT") { s.shutdown }
|
27
27
|
s.start
|