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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80f9d00b4dec8e85066f61cecaf04c5863399c8c6552d5158d0fe69f8b81a64f
|
4
|
+
data.tar.gz: 4664e8431f59bf1293d6cafbaf3623b6fe2069aa81af17520384b5e85c34a0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73131e462a1c99744d967f82cecdda88dc2780e04c3bb69f51cd7149fc8e747d7e487e31cc5e5e3fe7f4440d6da3ef42a90ee7e027c7fa0f567ad2b84a6119dd
|
7
|
+
data.tar.gz: a17216eb8f219f33af17d79accae60eccc23e059753ac159aed34063ec7f8abb0566c6268097647bb1a657fabf507d4f9d1d90c39e3c73b0e66f9d4c1a29c8bc
|
data/LICENSE
CHANGED
data/braintree.gemspec
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
|
-
require
|
2
|
+
require "braintree/version"
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "braintree"
|
6
|
-
s.summary = "Braintree
|
7
|
-
s.description = "
|
6
|
+
s.summary = "Braintree Ruby Server SDK"
|
7
|
+
s.description = "Resources and tools for developers to integrate Braintree's global payments platform."
|
8
8
|
s.version = Braintree::Version::String
|
9
9
|
s.license = "MIT"
|
10
10
|
s.author = "Braintree"
|
11
11
|
s.email = "code@getbraintree.com"
|
12
12
|
s.homepage = "https://www.braintreepayments.com/"
|
13
13
|
s.files = Dir.glob ["README.rdoc", "LICENSE", "lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
|
14
|
-
s.add_dependency "builder", ">= 2.
|
14
|
+
s.add_dependency "builder", ">= 3.2.4"
|
15
|
+
s.add_dependency "rexml", ">= 3.1.9" # Use rexml version associated with minimum supported Ruby version
|
16
|
+
s.required_ruby_version = ">=2.6.0"
|
15
17
|
s.metadata = {
|
16
18
|
"bug_tracker_uri" => "https://github.com/braintree/braintree_ruby/issues",
|
17
19
|
"changelog_uri" => "https://github.com/braintree/braintree_ruby/blob/master/CHANGELOG.md",
|
18
20
|
"source_code_uri" => "https://github.com/braintree/braintree_ruby",
|
21
|
+
"documentation_uri" => "https://developer.paypal.com/braintree/docs"
|
19
22
|
}
|
20
23
|
end
|
21
24
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Braintree
|
2
|
-
class AccountUpdaterDailyReport
|
2
|
+
class AccountUpdaterDailyReport
|
3
3
|
include BaseModule
|
4
4
|
|
5
5
|
attr_reader :report_date
|
@@ -7,12 +7,12 @@ module Braintree
|
|
7
7
|
|
8
8
|
class << self
|
9
9
|
protected :new
|
10
|
-
def _new(*args)
|
11
|
-
self.new
|
10
|
+
def _new(*args)
|
11
|
+
self.new(*args)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def initialize(attributes)
|
15
|
+
def initialize(attributes)
|
16
16
|
set_instance_variables_from_hash(attributes)
|
17
17
|
@report_date = Date.parse(report_date)
|
18
18
|
end
|
data/lib/braintree/address.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Braintree
|
2
2
|
class Address
|
3
|
-
include BaseModule
|
3
|
+
include BaseModule
|
4
4
|
|
5
5
|
attr_reader :company
|
6
6
|
attr_reader :country_code_alpha2
|
@@ -12,8 +12,10 @@ module Braintree
|
|
12
12
|
attr_reader :extended_address
|
13
13
|
attr_reader :first_name
|
14
14
|
attr_reader :id
|
15
|
+
attr_reader :international_phone
|
15
16
|
attr_reader :last_name
|
16
17
|
attr_reader :locality
|
18
|
+
attr_reader :phone_number
|
17
19
|
attr_reader :postal_code
|
18
20
|
attr_reader :region
|
19
21
|
attr_reader :street_address
|
@@ -43,44 +45,22 @@ module Braintree
|
|
43
45
|
Configuration.gateway.address.update!(*args)
|
44
46
|
end
|
45
47
|
|
46
|
-
def initialize(gateway, attributes)
|
48
|
+
def initialize(gateway, attributes)
|
47
49
|
@gateway = gateway
|
48
50
|
set_instance_variables_from_hash(attributes)
|
49
51
|
end
|
50
52
|
|
51
|
-
def ==(other)
|
53
|
+
def ==(other)
|
52
54
|
return false unless other.is_a?(Address)
|
53
55
|
id == other.id && customer_id == other.customer_id
|
54
56
|
end
|
55
57
|
|
56
|
-
# Deprecated. Use Braintree::Address.delete
|
57
|
-
def delete
|
58
|
-
warn "[DEPRECATED] delete as an instance method is deprecated. Please use Address.delete"
|
59
|
-
@gateway.address.delete(customer_id, self.id)
|
60
|
-
end
|
61
|
-
|
62
|
-
# Deprecated. Use Braintree::Address.update
|
63
|
-
def update(attributes)
|
64
|
-
warn "[DEPRECATED] update as an instance method is deprecated. Please use Address.update"
|
65
|
-
result = @gateway.address.update(customer_id, id, attributes)
|
66
|
-
if result.success?
|
67
|
-
copy_instance_variables_from_object result.address
|
68
|
-
end
|
69
|
-
result
|
70
|
-
end
|
71
|
-
|
72
|
-
# Deprecated. Use Braintree::Address.update!
|
73
|
-
def update!(attributes)
|
74
|
-
warn "[DEPRECATED] update! as an instance method is deprecated. Please use Address.update!"
|
75
|
-
return_object_or_raise(:address) { update(attributes) }
|
76
|
-
end
|
77
|
-
|
78
58
|
class << self
|
79
59
|
protected :new
|
80
60
|
end
|
81
61
|
|
82
|
-
def self._new(*args)
|
83
|
-
self.new
|
62
|
+
def self._new(*args)
|
63
|
+
self.new(*args)
|
84
64
|
end
|
85
65
|
end
|
86
66
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Braintree
|
2
|
-
class AddressGateway
|
2
|
+
class AddressGateway
|
3
3
|
include BaseModule
|
4
4
|
|
5
5
|
def initialize(gateway)
|
@@ -62,7 +62,7 @@ module Braintree
|
|
62
62
|
return_object_or_raise(:address) { update(*args) }
|
63
63
|
end
|
64
64
|
|
65
|
-
def _determine_customer_id(customer_or_customer_id)
|
65
|
+
def _determine_customer_id(customer_or_customer_id)
|
66
66
|
customer_id = customer_or_customer_id.is_a?(Customer) ? customer_or_customer_id.id : customer_or_customer_id
|
67
67
|
unless customer_id =~ /\A[\w_-]+\z/
|
68
68
|
raise ArgumentError, "customer_id contains invalid characters"
|
@@ -70,17 +70,18 @@ module Braintree
|
|
70
70
|
customer_id
|
71
71
|
end
|
72
72
|
|
73
|
-
def self._create_signature
|
73
|
+
def self._create_signature
|
74
74
|
_shared_signature + [:customer_id]
|
75
75
|
end
|
76
76
|
|
77
|
-
def self._shared_signature
|
77
|
+
def self._shared_signature
|
78
78
|
[:company, :country_code_alpha2, :country_code_alpha3, :country_code_numeric,
|
79
|
-
|
80
|
-
|
79
|
+
:country_name, :extended_address, :first_name,
|
80
|
+
{:international_phone => [:country_code, :national_number]},
|
81
|
+
:last_name, :locality, :phone_number, :postal_code, :region, :street_address]
|
81
82
|
end
|
82
83
|
|
83
|
-
def self._update_signature
|
84
|
+
def self._update_signature
|
84
85
|
_create_signature
|
85
86
|
end
|
86
87
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Braintree
|
2
|
-
class AdvancedSearch
|
3
|
-
class SearchNode
|
2
|
+
class AdvancedSearch
|
3
|
+
class SearchNode
|
4
4
|
def self.operators(*operator_names)
|
5
5
|
operator_names.each do |operator|
|
6
6
|
define_method(operator) do |value|
|
@@ -14,29 +14,29 @@ module Braintree
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
class IsNode < SearchNode
|
17
|
+
class IsNode < SearchNode
|
18
18
|
operators :is
|
19
19
|
end
|
20
20
|
|
21
|
-
class EqualityNode < IsNode
|
21
|
+
class EqualityNode < IsNode
|
22
22
|
operators :is_not
|
23
23
|
end
|
24
24
|
|
25
|
-
class PartialMatchNode < EqualityNode
|
25
|
+
class PartialMatchNode < EqualityNode
|
26
26
|
operators :ends_with, :starts_with
|
27
27
|
end
|
28
28
|
|
29
|
-
class TextNode < PartialMatchNode
|
29
|
+
class TextNode < PartialMatchNode
|
30
30
|
operators :contains
|
31
31
|
end
|
32
32
|
|
33
|
-
class KeyValueNode < SearchNode
|
33
|
+
class KeyValueNode < SearchNode
|
34
34
|
def is(value)
|
35
35
|
@parent.add_criteria(@node_name, value)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
class MultipleValueNode < SearchNode
|
39
|
+
class MultipleValueNode < SearchNode
|
40
40
|
def in(*values)
|
41
41
|
values.flatten!
|
42
42
|
|
@@ -62,7 +62,7 @@ module Braintree
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
class EndsWithNode < SearchNode
|
65
|
+
class EndsWithNode < SearchNode
|
66
66
|
operators :ends_with
|
67
67
|
end
|
68
68
|
|
@@ -76,12 +76,11 @@ module Braintree
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
class RangeNode < SearchNode
|
79
|
+
class RangeNode < SearchNode
|
80
80
|
operators :is
|
81
81
|
|
82
82
|
def between(min, max)
|
83
|
-
self >= min
|
84
|
-
self <= max
|
83
|
+
self >= min && self <= max
|
85
84
|
end
|
86
85
|
|
87
86
|
def >=(min)
|
data/lib/braintree/apple_pay.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Braintree
|
2
2
|
class ApplePay
|
3
|
-
include BaseModule
|
3
|
+
include BaseModule
|
4
4
|
|
5
|
-
def initialize(gateway, attributes)
|
5
|
+
def initialize(gateway, attributes)
|
6
6
|
set_instance_variables_from_hash(attributes)
|
7
7
|
end
|
8
8
|
|
@@ -10,8 +10,8 @@ module Braintree
|
|
10
10
|
protected :new
|
11
11
|
end
|
12
12
|
|
13
|
-
def self._new(*args)
|
14
|
-
self.new
|
13
|
+
def self._new(*args)
|
14
|
+
self.new(*args)
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.register_domain(domain)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Braintree
|
2
2
|
class ApplePayCard
|
3
|
-
include BaseModule
|
3
|
+
include BaseModule
|
4
4
|
|
5
5
|
module CardType
|
6
6
|
AmEx = "Apple Pay - American Express"
|
@@ -10,25 +10,39 @@ module Braintree
|
|
10
10
|
All = constants.map { |c| const_get(c) }
|
11
11
|
end
|
12
12
|
|
13
|
+
attr_reader :billing_address
|
13
14
|
attr_reader :bin
|
14
15
|
attr_reader :card_type
|
16
|
+
attr_reader :cardholder_name
|
17
|
+
attr_reader :commercial
|
18
|
+
attr_reader :country_of_issuance
|
15
19
|
attr_reader :created_at
|
16
20
|
attr_reader :customer_id
|
21
|
+
attr_reader :debit
|
17
22
|
attr_reader :default
|
23
|
+
attr_reader :durbin_regulated
|
18
24
|
attr_reader :expiration_month
|
19
25
|
attr_reader :expiration_year
|
20
26
|
attr_reader :expired
|
27
|
+
attr_reader :healthcare
|
21
28
|
attr_reader :image_url
|
29
|
+
attr_reader :issuing_bank
|
22
30
|
attr_reader :last_4
|
31
|
+
attr_reader :merchant_token_identifier
|
23
32
|
attr_reader :payment_instrument_name
|
33
|
+
attr_reader :payroll
|
34
|
+
attr_reader :prepaid
|
35
|
+
attr_reader :product_id
|
36
|
+
attr_reader :source_card_last4
|
24
37
|
attr_reader :source_description
|
25
38
|
attr_reader :subscriptions
|
26
39
|
attr_reader :token
|
27
40
|
attr_reader :updated_at
|
28
41
|
|
29
|
-
def initialize(gateway, attributes)
|
42
|
+
def initialize(gateway, attributes)
|
30
43
|
@gateway = gateway
|
31
44
|
set_instance_variables_from_hash(attributes)
|
45
|
+
@billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
|
32
46
|
@subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
|
33
47
|
end
|
34
48
|
|
@@ -44,8 +58,8 @@ module Braintree
|
|
44
58
|
protected :new
|
45
59
|
end
|
46
60
|
|
47
|
-
def self._new(*args)
|
48
|
-
self.new
|
61
|
+
def self._new(*args)
|
62
|
+
self.new(*args)
|
49
63
|
end
|
50
64
|
end
|
51
65
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Braintree
|
2
2
|
class ApplePayOptions
|
3
|
-
include BaseModule
|
3
|
+
include BaseModule
|
4
4
|
|
5
5
|
attr_reader :domains
|
6
6
|
|
7
|
-
def initialize(attributes)
|
7
|
+
def initialize(attributes)
|
8
8
|
set_instance_variables_from_hash(attributes)
|
9
9
|
end
|
10
10
|
|
@@ -12,8 +12,8 @@ module Braintree
|
|
12
12
|
protected :new
|
13
13
|
end
|
14
14
|
|
15
|
-
def self._new(*args)
|
16
|
-
self.new
|
15
|
+
def self._new(*args)
|
16
|
+
self.new(*args)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Braintree
|
2
|
-
class AuthorizationAdjustment
|
2
|
+
class AuthorizationAdjustment
|
3
3
|
include BaseModule
|
4
4
|
|
5
5
|
attr_reader :amount
|
@@ -11,12 +11,12 @@ module Braintree
|
|
11
11
|
|
12
12
|
class << self
|
13
13
|
protected :new
|
14
|
-
def _new(*args)
|
15
|
-
self.new
|
14
|
+
def _new(*args)
|
15
|
+
self.new(*args)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def initialize(attributes)
|
19
|
+
def initialize(attributes)
|
20
20
|
set_instance_variables_from_hash(attributes)
|
21
21
|
end
|
22
22
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Braintree
|
2
|
-
module BaseModule
|
2
|
+
module BaseModule
|
3
3
|
module Methods
|
4
4
|
def return_object_or_raise(object_to_return)
|
5
5
|
result = yield
|
@@ -18,6 +18,16 @@ module Braintree
|
|
18
18
|
|
19
19
|
def set_instance_variables_from_hash(hash)
|
20
20
|
hash.each do |key, value|
|
21
|
+
if key == :global_id
|
22
|
+
instance_variable_set "@graphql_id", value
|
23
|
+
elsif key == :android_pay_cards
|
24
|
+
instance_variable_set "@google_pay_cards", value
|
25
|
+
elsif key == :android_pay_card
|
26
|
+
instance_variable_set "@google_pay_card", value
|
27
|
+
elsif key == :android_pay_details
|
28
|
+
instance_variable_set "@google_pay_details", value
|
29
|
+
end
|
30
|
+
|
21
31
|
instance_variable_set "@#{key}", value
|
22
32
|
end
|
23
33
|
end
|
data/lib/braintree/bin_data.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Braintree
|
2
|
-
class BinData
|
2
|
+
class BinData
|
3
3
|
include BaseModule
|
4
4
|
|
5
5
|
attr_reader :commercial
|
@@ -17,10 +17,17 @@ module Braintree
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def inspect
|
20
|
-
|
20
|
+
formatted_attributes = self.class._attributes.map do |attr|
|
21
21
|
"#{attr}: #{send(attr).inspect}"
|
22
22
|
end
|
23
|
-
"
|
23
|
+
"#<#{self.class} #{formatted_attributes.join(", ")}>"
|
24
|
+
end
|
25
|
+
|
26
|
+
def self._attributes
|
27
|
+
[
|
28
|
+
:commercial, :country_of_issuance, :debit, :durbin_regulated, :healthcare,
|
29
|
+
:issuing_bank, :payroll, :prepaid, :product_id
|
30
|
+
]
|
24
31
|
end
|
25
32
|
end
|
26
33
|
end
|
@@ -25,16 +25,17 @@ module Braintree
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
def self._generate_signature
|
28
|
+
def self._generate_signature
|
29
29
|
[
|
30
30
|
:address_id, :customer_id, :proxy_merchant_id, :merchant_account_id,
|
31
31
|
:version,
|
32
|
-
{:
|
32
|
+
{:domains => [:_any_key_]},
|
33
|
+
{:options => [:fail_on_duplicate_payment_method, :fail_on_duplicate_payment_method_for_customer, :make_default, :verify_card]}
|
33
34
|
]
|
34
35
|
end
|
35
36
|
|
36
37
|
def _validate_options(options)
|
37
|
-
[:
|
38
|
+
[:fail_on_duplicate_payment_method, :fail_on_duplicate_payment_method_for_customer, :make_default, :verify_card].each do |credit_card_option|
|
38
39
|
if options[credit_card_option]
|
39
40
|
raise ArgumentError.new("cannot specify #{credit_card_option} without a customer_id") unless options[:customer_id]
|
40
41
|
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module Braintree
|
2
2
|
class Configuration
|
3
|
-
API_VERSION = "
|
4
|
-
DEFAULT_ENDPOINT = "api"
|
5
|
-
|
3
|
+
API_VERSION = "6"
|
4
|
+
DEFAULT_ENDPOINT = "api"
|
5
|
+
# NEXT_MAJOR_VERSION update to the latest version of GraphQL API
|
6
|
+
GRAPHQL_API_VERSION = "2018-09-10"
|
6
7
|
|
7
8
|
READABLE_ATTRIBUTES = [
|
8
9
|
:merchant_id,
|
@@ -40,25 +41,24 @@ module Braintree
|
|
40
41
|
]
|
41
42
|
|
42
43
|
class << self
|
43
|
-
attr_writer
|
44
|
-
attr_reader
|
44
|
+
attr_writer(*WRITABLE_ATTRIBUTES)
|
45
|
+
attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
|
45
46
|
end
|
46
|
-
attr_reader
|
47
|
-
attr_reader
|
48
|
-
attr_writer
|
47
|
+
attr_reader(*READABLE_ATTRIBUTES)
|
48
|
+
attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
|
49
|
+
attr_writer(*WRITABLE_ATTRIBUTES)
|
49
50
|
|
50
|
-
def self.expectant_reader(*attributes)
|
51
|
+
def self.expectant_reader(*attributes)
|
51
52
|
attributes.each do |attribute|
|
52
53
|
(class << self; self; end).send(:define_method, attribute) do
|
53
54
|
attribute_value = instance_variable_get("@#{attribute}")
|
54
|
-
raise ConfigurationError.new("Braintree::Configuration.#{attribute
|
55
|
+
raise ConfigurationError.new("Braintree::Configuration.#{attribute} needs to be set") if attribute_value.nil? || attribute_value.to_s.empty?
|
55
56
|
attribute_value
|
56
57
|
end
|
57
58
|
end
|
58
59
|
end
|
59
|
-
expectant_reader
|
60
|
+
expectant_reader(*READABLE_ATTRIBUTES)
|
60
61
|
|
61
|
-
# Sets the Braintree environment to use. Valid values are <tt>:sandbox</tt> and <tt>:production</tt>
|
62
62
|
def self.environment=(env)
|
63
63
|
env = env.to_sym
|
64
64
|
unless [:development, :qa, :sandbox, :production].include?(env)
|
@@ -67,12 +67,12 @@ module Braintree
|
|
67
67
|
@environment = env
|
68
68
|
end
|
69
69
|
|
70
|
-
def self.gateway
|
70
|
+
def self.gateway
|
71
71
|
Braintree::Gateway.new(instantiate)
|
72
72
|
end
|
73
73
|
|
74
|
-
def self.instantiate
|
75
|
-
|
74
|
+
def self.instantiate
|
75
|
+
new(
|
76
76
|
:custom_user_agent => @custom_user_agent,
|
77
77
|
:endpoint => @endpoint,
|
78
78
|
:environment => environment,
|
@@ -86,7 +86,7 @@ module Braintree
|
|
86
86
|
:proxy_port => proxy_port,
|
87
87
|
:proxy_user => proxy_user,
|
88
88
|
:proxy_pass => proxy_pass,
|
89
|
-
:ssl_version => ssl_version
|
89
|
+
:ssl_version => ssl_version,
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
@@ -158,15 +158,15 @@ module Braintree
|
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
|
-
def api_version
|
161
|
+
def api_version
|
162
162
|
API_VERSION
|
163
163
|
end
|
164
164
|
|
165
|
-
def graphql_api_version
|
165
|
+
def graphql_api_version
|
166
166
|
GRAPHQL_API_VERSION
|
167
167
|
end
|
168
168
|
|
169
|
-
def base_merchant_path
|
169
|
+
def base_merchant_path
|
170
170
|
"/merchants/#{merchant_id}"
|
171
171
|
end
|
172
172
|
|
@@ -178,11 +178,11 @@ module Braintree
|
|
178
178
|
"#{protocol}://#{graphql_server}:#{graphql_port}/graphql"
|
179
179
|
end
|
180
180
|
|
181
|
-
def base_merchant_url
|
181
|
+
def base_merchant_url
|
182
182
|
"#{base_url}#{base_merchant_path}"
|
183
183
|
end
|
184
184
|
|
185
|
-
def ca_file
|
185
|
+
def ca_file
|
186
186
|
File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "api_braintreegateway_com.ca.crt"))
|
187
187
|
end
|
188
188
|
|
@@ -190,7 +190,7 @@ module Braintree
|
|
190
190
|
@endpoint || DEFAULT_ENDPOINT
|
191
191
|
end
|
192
192
|
|
193
|
-
def http
|
193
|
+
def http
|
194
194
|
Http.new(self)
|
195
195
|
end
|
196
196
|
|
@@ -202,25 +202,25 @@ module Braintree
|
|
202
202
|
@logger ||= self.class._default_logger
|
203
203
|
end
|
204
204
|
|
205
|
-
def port
|
205
|
+
def port
|
206
206
|
case @environment
|
207
207
|
when :development, :integration
|
208
|
-
ENV[
|
208
|
+
ENV["GATEWAY_PORT"] || 3000
|
209
209
|
when :production, :qa, :sandbox
|
210
210
|
443
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
|
-
def graphql_port
|
214
|
+
def graphql_port
|
215
215
|
case @environment
|
216
216
|
when :development, :integration
|
217
|
-
ENV[
|
217
|
+
ENV["GRAPHQL_PORT"] || 8080
|
218
218
|
when :production, :qa, :sandbox
|
219
219
|
443
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
223
|
-
def protocol
|
223
|
+
def protocol
|
224
224
|
ssl? ? "https" : "http"
|
225
225
|
end
|
226
226
|
|
@@ -232,23 +232,23 @@ module Braintree
|
|
232
232
|
@http_read_timeout
|
233
233
|
end
|
234
234
|
|
235
|
-
def server
|
235
|
+
def server
|
236
236
|
case @environment
|
237
237
|
when :development, :integration
|
238
|
-
ENV[
|
238
|
+
ENV["GATEWAY_HOST"] || "localhost"
|
239
239
|
when :production
|
240
240
|
"#{endpoint}.braintreegateway.com"
|
241
241
|
when :qa
|
242
|
-
"gateway.
|
242
|
+
"gateway.qa2.braintreepayments.com"
|
243
243
|
when :sandbox
|
244
244
|
"api.sandbox.braintreegateway.com"
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
248
|
-
def graphql_server
|
248
|
+
def graphql_server
|
249
249
|
case @environment
|
250
250
|
when :development, :integration
|
251
|
-
ENV[
|
251
|
+
ENV["GRAPHQL_HOST"] || "graphql.bt.local"
|
252
252
|
when :production
|
253
253
|
"payments.braintree-api.com"
|
254
254
|
when :qa
|
@@ -271,7 +271,7 @@ module Braintree
|
|
271
271
|
end
|
272
272
|
end
|
273
273
|
|
274
|
-
def ssl?
|
274
|
+
def ssl?
|
275
275
|
case @environment
|
276
276
|
when :development, :integration
|
277
277
|
false
|
@@ -280,12 +280,12 @@ module Braintree
|
|
280
280
|
end
|
281
281
|
end
|
282
282
|
|
283
|
-
def user_agent
|
283
|
+
def user_agent
|
284
284
|
base_user_agent = "Braintree Ruby Gem #{Braintree::Version::String}"
|
285
285
|
@custom_user_agent ? "#{base_user_agent} (#{@custom_user_agent})" : base_user_agent
|
286
286
|
end
|
287
287
|
|
288
|
-
def self._default_logger
|
288
|
+
def self._default_logger
|
289
289
|
logger = Logger.new(STDOUT)
|
290
290
|
logger.level = Logger::INFO
|
291
291
|
logger
|