braintree 2.10.0 → 4.26.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 +7 -0
- data/LICENSE +1 -1
- data/braintree.gemspec +24 -0
- data/lib/braintree/account_updater_daily_report.rb +20 -0
- data/lib/braintree/ach_mandate.rb +14 -0
- data/lib/braintree/add_on.rb +4 -0
- data/lib/braintree/add_on_gateway.rb +17 -0
- data/lib/braintree/address/country_names.rb +4 -1
- data/lib/braintree/address.rb +35 -43
- data/lib/braintree/address_gateway.rb +24 -11
- data/lib/braintree/advanced_search.rb +26 -11
- data/lib/braintree/apple_pay.rb +29 -0
- data/lib/braintree/apple_pay_card.rb +66 -0
- data/lib/braintree/apple_pay_gateway.rb +37 -0
- data/lib/braintree/apple_pay_options.rb +19 -0
- data/lib/braintree/authorization_adjustment.rb +23 -0
- data/lib/braintree/base_module.rb +11 -1
- data/lib/braintree/bin_data.rb +34 -0
- data/lib/braintree/client_token.rb +11 -0
- data/lib/braintree/client_token_gateway.rb +45 -0
- data/lib/braintree/configuration.rb +231 -39
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +22 -0
- data/lib/braintree/connected_merchant_status_transitioned.rb +22 -0
- data/lib/braintree/credentials_parser.rb +44 -0
- data/lib/braintree/credit_card.rb +107 -132
- data/lib/braintree/credit_card_gateway.rb +90 -41
- data/lib/braintree/credit_card_verification.rb +90 -17
- data/lib/braintree/credit_card_verification_gateway.rb +87 -0
- data/lib/braintree/credit_card_verification_search.rb +20 -0
- data/lib/braintree/customer.rb +80 -118
- data/lib/braintree/customer_gateway.rb +66 -39
- data/lib/braintree/customer_search.rb +5 -2
- data/lib/braintree/customer_session_gateway.rb +194 -0
- data/lib/braintree/descriptor.rb +4 -2
- data/lib/braintree/digest.rb +16 -3
- data/lib/braintree/disbursement.rb +63 -0
- data/lib/braintree/discount.rb +4 -0
- data/lib/braintree/discount_gateway.rb +17 -0
- data/lib/braintree/dispute/evidence.rb +24 -0
- data/lib/braintree/dispute/paypal_message.rb +15 -0
- data/lib/braintree/dispute/status_history.rb +18 -0
- data/lib/braintree/dispute/transaction.rb +20 -0
- data/lib/braintree/dispute/transaction_details.rb +15 -0
- data/lib/braintree/dispute.rb +165 -0
- data/lib/braintree/dispute_gateway.rb +142 -0
- data/lib/braintree/dispute_search.rb +31 -0
- data/lib/braintree/document_upload.rb +37 -0
- data/lib/braintree/document_upload_gateway.rb +38 -0
- data/lib/braintree/enriched_customer_data.rb +21 -0
- data/lib/braintree/error_codes.rb +680 -15
- data/lib/braintree/error_result.rb +13 -6
- data/lib/braintree/errors.rb +5 -5
- data/lib/braintree/exceptions.rb +14 -20
- 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 +21 -0
- data/lib/braintree/facilitator_details.rb +20 -0
- data/lib/braintree/gateway.rb +104 -6
- data/lib/braintree/google_pay_card.rb +62 -0
- data/lib/braintree/granted_payment_instrument_update.rb +23 -0
- data/lib/braintree/graphql/enums/recommendations.rb +7 -0
- data/lib/braintree/graphql/enums/recommended_payment_option.rb +8 -0
- data/lib/braintree/graphql/inputs/create_customer_session_input.rb +35 -0
- data/lib/braintree/graphql/inputs/customer_recommendations_input.rb +41 -0
- data/lib/braintree/graphql/inputs/customer_session_input.rb +39 -0
- data/lib/braintree/graphql/inputs/phone_input.rb +32 -0
- data/lib/braintree/graphql/inputs/update_customer_session_input.rb +37 -0
- data/lib/braintree/graphql/types/customer_recommendations_payload.rb +32 -0
- data/lib/braintree/graphql/types/payment_options.rb +33 -0
- data/lib/braintree/graphql/unions/customer_recommendations.rb +34 -0
- data/lib/braintree/graphql_client.rb +50 -0
- data/lib/braintree/http.rb +119 -25
- data/lib/braintree/local_payment_completed/blik_alias.rb +23 -0
- data/lib/braintree/local_payment_completed.rb +28 -0
- 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 +34 -0
- data/lib/braintree/merchant_account/address_details.rb +16 -0
- data/lib/braintree/merchant_account/business_details.rb +17 -0
- data/lib/braintree/merchant_account/funding_details.rb +18 -0
- data/lib/braintree/merchant_account/individual_details.rb +20 -0
- data/lib/braintree/merchant_account.rb +76 -0
- data/lib/braintree/merchant_account_gateway.rb +130 -0
- data/lib/braintree/merchant_gateway.rb +38 -0
- data/lib/braintree/meta_checkout_card.rb +90 -0
- data/lib/braintree/meta_checkout_token.rb +89 -0
- data/lib/braintree/modification.rb +16 -5
- data/lib/braintree/oauth_credentials.rb +22 -0
- data/lib/braintree/oauth_gateway.rb +73 -0
- data/lib/braintree/paginated_collection.rb +25 -0
- data/lib/braintree/paginated_result.rb +15 -0
- data/lib/braintree/payment_instrument_type.rb +18 -0
- data/lib/braintree/payment_method.rb +37 -0
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +24 -0
- data/lib/braintree/payment_method_gateway.rb +221 -0
- data/lib/braintree/payment_method_nonce.rb +49 -0
- 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 +38 -0
- data/lib/braintree/payment_method_parser.rb +29 -0
- data/lib/braintree/paypal_account.rb +60 -0
- data/lib/braintree/paypal_account_gateway.rb +73 -0
- data/lib/braintree/paypal_payment_resource.rb +22 -0
- data/lib/braintree/paypal_payment_resource_gateway.rb +36 -0
- data/lib/braintree/plan.rb +62 -0
- data/lib/braintree/plan_gateway.rb +117 -0
- data/lib/braintree/processor_response_types.rb +7 -0
- data/lib/braintree/resource_collection.rb +12 -5
- data/lib/braintree/revoked_payment_method_metadata.rb +22 -0
- data/lib/braintree/risk_data/liability_shift.rb +22 -0
- data/lib/braintree/risk_data.rb +29 -0
- data/lib/braintree/samsung_pay_card.rb +85 -0
- 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 +25 -0
- data/lib/braintree/settlement_batch_summary_gateway.rb +27 -0
- data/lib/braintree/sha256_digest.rb +13 -0
- data/lib/braintree/signature_service.rb +19 -0
- data/lib/braintree/subscription/status_details.rb +20 -0
- data/lib/braintree/subscription.rb +67 -47
- data/lib/braintree/subscription_gateway.rb +43 -16
- data/lib/braintree/subscription_search.rb +2 -2
- data/lib/braintree/successful_result.rb +30 -10
- data/lib/braintree/test/authentication_id.rb +21 -0
- data/lib/braintree/test/credit_card.rb +76 -0
- data/lib/braintree/test/merchant_account.rb +12 -0
- data/lib/braintree/test/nonce.rb +81 -0
- data/lib/braintree/test/transaction_amounts.rb +3 -5
- data/lib/braintree/test/venmo_sdk.rb +21 -0
- data/lib/braintree/test_transaction.rb +19 -0
- data/lib/braintree/testing_gateway.rb +43 -0
- data/lib/braintree/three_d_secure_info.rb +53 -0
- data/lib/braintree/transaction/address_details.rb +27 -5
- data/lib/braintree/transaction/apple_pay_details.rb +35 -0
- data/lib/braintree/transaction/credit_card_details.rb +55 -4
- data/lib/braintree/transaction/customer_details.rb +11 -3
- data/lib/braintree/transaction/disbursement_details.rb +28 -0
- data/lib/braintree/transaction/google_pay_details.rb +42 -0
- 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 +27 -0
- data/lib/braintree/transaction/meta_checkout_card_details.rb +55 -0
- data/lib/braintree/transaction/meta_checkout_token_details.rb +58 -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 +40 -0
- data/lib/braintree/transaction/paypal_here_details.rb +23 -0
- data/lib/braintree/transaction/samsung_pay_card_details.rb +50 -0
- data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +27 -0
- data/lib/braintree/transaction/status_details.rb +6 -2
- data/lib/braintree/transaction/subscription_details.rb +5 -2
- data/lib/braintree/transaction/us_bank_account_details.rb +22 -0
- data/lib/braintree/transaction/venmo_account_details.rb +17 -0
- data/lib/braintree/transaction/visa_checkout_card_details.rb +51 -0
- data/lib/braintree/transaction.rb +293 -150
- data/lib/braintree/transaction_gateway.rb +303 -59
- data/lib/braintree/transaction_line_item.rb +43 -0
- data/lib/braintree/transaction_line_item_gateway.rb +19 -0
- data/lib/braintree/transaction_review.rb +18 -0
- data/lib/braintree/transaction_search.rb +17 -9
- data/lib/braintree/unknown_payment_method.rb +26 -0
- data/lib/braintree/us_bank_account.rb +57 -0
- data/lib/braintree/us_bank_account_gateway.rb +17 -0
- data/lib/braintree/us_bank_account_verification.rb +89 -0
- data/lib/braintree/us_bank_account_verification_gateway.rb +51 -0
- data/lib/braintree/us_bank_account_verification_search.rb +19 -0
- data/lib/braintree/util.rb +91 -11
- data/lib/braintree/validation_error.rb +14 -5
- data/lib/braintree/validation_error_collection.rb +5 -5
- data/lib/braintree/venmo_account.rb +34 -0
- data/lib/braintree/venmo_profile_data.rb +25 -0
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/visa_checkout_card.rb +90 -0
- data/lib/braintree/webhook_notification.rb +146 -0
- data/lib/braintree/webhook_notification_gateway.rb +46 -0
- data/lib/braintree/webhook_testing.rb +7 -0
- data/lib/braintree/webhook_testing_gateway.rb +1239 -0
- data/lib/braintree/xml/generator.rb +18 -10
- data/lib/braintree/xml/libxml.rb +1 -1
- data/lib/braintree/xml/parser.rb +24 -36
- data/lib/braintree/xml/rexml.rb +6 -7
- data/lib/braintree/xml.rb +1 -2
- data/lib/braintree.rb +186 -52
- data/lib/ssl/api_braintreegateway_com.ca.crt +474 -0
- data/spec/fixtures/files/bt_logo.png +0 -0
- data/spec/fixtures/files/gif_extension_bt_logo.gif +0 -0
- data/spec/fixtures/files/malformed_pdf.pdf +1 -0
- data/spec/fixtures/files/too_long.pdf +0 -0
- data/spec/integration/braintree/add_on_spec.rb +46 -0
- data/spec/integration/braintree/address_spec.rb +101 -178
- data/spec/integration/braintree/advanced_search_spec.rb +100 -97
- data/spec/integration/braintree/apple_pay_spec.rb +63 -0
- data/spec/integration/braintree/braintree_gateway_spec.rb +72 -0
- data/spec/integration/braintree/client_api/client_token_spec.rb +407 -0
- data/spec/integration/braintree/client_api/spec_helper.rb +300 -0
- data/spec/integration/braintree/credit_card_spec.rb +885 -654
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +193 -0
- data/spec/integration/braintree/credit_card_verification_spec.rb +473 -0
- data/spec/integration/braintree/customer_search_spec.rb +69 -21
- data/spec/integration/braintree/customer_session_spec.rb +143 -0
- data/spec/integration/braintree/customer_spec.rb +1437 -518
- data/spec/integration/braintree/disbursement_spec.rb +31 -0
- data/spec/integration/braintree/discount_spec.rb +34 -0
- data/spec/integration/braintree/dispute_search_spec.rb +165 -0
- data/spec/integration/braintree/dispute_spec.rb +333 -0
- data/spec/integration/braintree/document_upload_spec.rb +87 -0
- 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 +72 -0
- data/spec/integration/braintree/http_spec.rb +106 -56
- data/spec/integration/braintree/merchant_account_spec.rb +603 -0
- data/spec/integration/braintree/merchant_spec.rb +227 -0
- data/spec/integration/braintree/oauth_spec.rb +225 -0
- data/spec/integration/braintree/package_tracking_spec.rb +130 -0
- data/spec/integration/braintree/payment_method_nonce_spec.rb +345 -0
- data/spec/integration/braintree/payment_method_spec.rb +2146 -0
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +325 -0
- data/spec/integration/braintree/paypal_account_spec.rb +299 -0
- data/spec/integration/braintree/paypal_payment_resource_spec.rb +141 -0
- data/spec/integration/braintree/plan_spec.rb +136 -0
- data/spec/integration/braintree/samsung_pay_card_spec.rb +146 -0
- data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +194 -0
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +62 -0
- data/spec/integration/braintree/subscription_spec.rb +785 -431
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +4 -4
- data/spec/integration/braintree/test_transaction_spec.rb +145 -0
- data/spec/integration/braintree/transaction_line_item_spec.rb +44 -0
- data/spec/integration/braintree/transaction_search_spec.rb +745 -156
- data/spec/integration/braintree/transaction_spec.rb +7452 -1288
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +196 -0
- data/spec/integration/braintree/us_bank_account_spec.rb +113 -0
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +178 -0
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +240 -0
- data/spec/integration/braintree/visa_checkout_card_spec.rb +110 -0
- data/spec/integration/spec_helper.rb +61 -5
- data/spec/oauth_test_helper.rb +17 -0
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +77 -21
- data/spec/ssl/certificate.crt +17 -0
- data/spec/ssl/geotrust_global.crt +20 -0
- data/spec/ssl/privateKey.key +15 -0
- data/spec/unit/braintree/address_spec.rb +27 -16
- data/spec/unit/braintree/apple_pay_card_spec.rb +133 -0
- data/spec/unit/braintree/base_module_spec.rb +4 -4
- data/spec/unit/braintree/client_token_spec.rb +37 -0
- data/spec/unit/braintree/configuration_spec.rb +293 -43
- data/spec/unit/braintree/credentials_parser_spec.rb +81 -0
- data/spec/unit/braintree/credit_card_spec.rb +138 -47
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +56 -0
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +79 -0
- data/spec/unit/braintree/credit_card_verification_spec.rb +132 -6
- data/spec/unit/braintree/customer_session_gateway_spec.rb +120 -0
- data/spec/unit/braintree/customer_spec.rb +196 -40
- data/spec/unit/braintree/digest_spec.rb +16 -3
- data/spec/unit/braintree/disbursement_spec.rb +131 -0
- data/spec/unit/braintree/dispute_search_spec.rb +66 -0
- data/spec/unit/braintree/dispute_spec.rb +479 -0
- data/spec/unit/braintree/document_upload_spec.rb +35 -0
- 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/google_pay_card_spec.rb +8 -0
- data/spec/unit/braintree/graphql/create_customer_session_input_spec.rb +81 -0
- data/spec/unit/braintree/graphql/customer_recommendations_input_spec.rb +110 -0
- data/spec/unit/braintree/graphql/customer_session_input_spec.rb +81 -0
- data/spec/unit/braintree/graphql/phone_input_spec.rb +51 -0
- data/spec/unit/braintree/graphql/update_customer_session_input_spec.rb +93 -0
- data/spec/unit/braintree/graphql_client_spec.rb +37 -0
- data/spec/unit/braintree/http_spec.rb +164 -2
- data/spec/unit/braintree/local_payment_completed_spec.rb +90 -0
- 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 +33 -0
- data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
- data/spec/unit/braintree/meta_checkout_card_spec.rb +62 -0
- data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
- data/spec/unit/braintree/meta_checkout_token_spec.rb +65 -0
- data/spec/unit/braintree/modification_spec.rb +7 -0
- 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 +43 -0
- data/spec/unit/braintree/payment_method_spec.rb +135 -0
- data/spec/unit/braintree/paypal_account_spec.rb +53 -0
- data/spec/unit/braintree/paypal_payment_resource_spec.rb +125 -0
- data/spec/unit/braintree/resource_collection_spec.rb +44 -3
- data/spec/unit/braintree/risk_data/liability_shift.rb +26 -0
- data/spec/unit/braintree/risk_data_spec.rb +55 -0
- 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 +11 -0
- data/spec/unit/braintree/signature_service_spec.rb +23 -0
- data/spec/unit/braintree/subscription_search_spec.rb +25 -18
- data/spec/unit/braintree/subscription_spec.rb +34 -7
- data/spec/unit/braintree/successful_result_spec.rb +9 -9
- data/spec/unit/braintree/three_d_secure_info_spec.rb +69 -0
- data/spec/unit/braintree/transaction/apple_pay_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +34 -6
- data/spec/unit/braintree/transaction/customer_details_spec.rb +3 -2
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +18 -0
- data/spec/unit/braintree/transaction/google_pay_details_spec.rb +8 -0
- 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/meta_checkout_card_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/meta_checkout_token_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/payment_receipt_spec.rb +73 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +68 -0
- data/spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb +33 -0
- data/spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb +8 -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 +366 -52
- data/spec/unit/braintree/unknown_payment_method_spec.rb +33 -0
- data/spec/unit/braintree/us_bank_account_spec.rb +13 -0
- data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +60 -0
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +98 -0
- data/spec/unit/braintree/util_spec.rb +199 -39
- data/spec/unit/braintree/validation_error_collection_spec.rb +336 -133
- 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/visa_checkout_card_spec.rb +8 -0
- data/spec/unit/braintree/webhook_notification_spec.rb +977 -0
- data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
- data/spec/unit/braintree/xml/parser_spec.rb +39 -5
- data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
- data/spec/unit/braintree/xml_spec.rb +39 -32
- data/spec/unit/braintree_spec.rb +3 -2
- data/spec/unit/credit_card_details_spec.rb +8 -0
- metadata +314 -73
- data/README.rdoc +0 -80
- data/lib/braintree/test/credit_card_numbers.rb +0 -52
- data/lib/braintree/transparent_redirect.rb +0 -51
- data/lib/braintree/transparent_redirect_gateway.rb +0 -105
- data/lib/ssl/sandbox_braintreegateway_com.ca.crt +0 -19
- data/lib/ssl/www_braintreegateway_com.ca.crt +0 -202
- data/spec/hacks/tcp_socket.rb +0 -18
- data/spec/integration/braintree/transparent_redirect_spec.rb +0 -236
- data/spec/unit/braintree/transparent_redirect_spec.rb +0 -160
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class TestingGateway
|
|
3
|
+
|
|
4
|
+
def initialize(gateway)
|
|
5
|
+
@gateway = gateway
|
|
6
|
+
@config = gateway.config
|
|
7
|
+
@config.assert_has_access_token_or_keys
|
|
8
|
+
@transaction_gateway = TransactionGateway.new(gateway)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def settle(transaction_id)
|
|
12
|
+
check_environment
|
|
13
|
+
|
|
14
|
+
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/settle")
|
|
15
|
+
@transaction_gateway._handle_transaction_response(response)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def settlement_confirm(transaction_id)
|
|
19
|
+
check_environment
|
|
20
|
+
|
|
21
|
+
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/settlement_confirm")
|
|
22
|
+
@transaction_gateway._handle_transaction_response(response)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def settlement_decline(transaction_id)
|
|
26
|
+
check_environment
|
|
27
|
+
|
|
28
|
+
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/settlement_decline")
|
|
29
|
+
@transaction_gateway._handle_transaction_response(response)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def settlement_pending(transaction_id)
|
|
33
|
+
check_environment
|
|
34
|
+
|
|
35
|
+
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/settlement_pending")
|
|
36
|
+
@transaction_gateway._handle_transaction_response(response)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def check_environment
|
|
40
|
+
raise TestOperationPerformedInProduction if @config.environment == :production
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class ThreeDSecureInfo
|
|
3
|
+
include BaseModule
|
|
4
|
+
|
|
5
|
+
attr_reader :acs_transaction_id
|
|
6
|
+
attr_reader :cavv
|
|
7
|
+
attr_reader :ds_transaction_id
|
|
8
|
+
attr_reader :eci_flag
|
|
9
|
+
attr_reader :enrolled
|
|
10
|
+
attr_reader :liability_shift_possible
|
|
11
|
+
attr_reader :liability_shifted
|
|
12
|
+
attr_reader :pares_status
|
|
13
|
+
attr_reader :status
|
|
14
|
+
attr_reader :three_d_secure_authentication_id
|
|
15
|
+
attr_reader :three_d_secure_transaction_id
|
|
16
|
+
attr_reader :three_d_secure_version
|
|
17
|
+
attr_reader :xid
|
|
18
|
+
attr_reader :lookup
|
|
19
|
+
attr_reader :authentication
|
|
20
|
+
|
|
21
|
+
alias_method :liability_shifted?, :liability_shifted
|
|
22
|
+
alias_method :liability_shift_possible?, :liability_shift_possible
|
|
23
|
+
|
|
24
|
+
def initialize(attributes)
|
|
25
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def inspect
|
|
29
|
+
attr_order = [
|
|
30
|
+
:acs_transaction_id,
|
|
31
|
+
:authentication,
|
|
32
|
+
:cavv,
|
|
33
|
+
:ds_transaction_id,
|
|
34
|
+
:eci_flag,
|
|
35
|
+
:enrolled,
|
|
36
|
+
:liability_shift_possible,
|
|
37
|
+
:liability_shifted,
|
|
38
|
+
:lookup,
|
|
39
|
+
:pares_status,
|
|
40
|
+
:status,
|
|
41
|
+
:three_d_secure_authentication_id,
|
|
42
|
+
:three_d_secure_transaction_id,
|
|
43
|
+
:three_d_secure_version,
|
|
44
|
+
:xid
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
formatted_attrs = attr_order.map do |attr|
|
|
48
|
+
"#{attr}: #{send(attr).inspect}"
|
|
49
|
+
end
|
|
50
|
+
"#<ThreeDSecureInfo #{formatted_attrs.join(", ")}>"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
module Braintree
|
|
2
2
|
class Transaction
|
|
3
|
-
class AddressDetails
|
|
3
|
+
class AddressDetails
|
|
4
4
|
include BaseModule
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
module ShippingMethod
|
|
7
|
+
SameDay = "same_day"
|
|
8
|
+
NextDay = "next_day"
|
|
9
|
+
Priority = "priority"
|
|
10
|
+
Ground = "ground"
|
|
11
|
+
Electronic = "electronic"
|
|
12
|
+
ShipToStore = "ship_to_store"
|
|
13
|
+
PickupInStore = "pickup_in_store"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
attr_reader :company
|
|
17
|
+
attr_reader :country_code_alpha2
|
|
18
|
+
attr_reader :country_code_alpha3
|
|
19
|
+
attr_reader :country_code_numeric
|
|
20
|
+
attr_reader :country_name
|
|
21
|
+
attr_reader :extended_address
|
|
22
|
+
attr_reader :first_name
|
|
23
|
+
attr_reader :id
|
|
24
|
+
attr_reader :international_phone
|
|
25
|
+
attr_reader :last_name
|
|
26
|
+
attr_reader :locality
|
|
27
|
+
attr_reader :phone_number
|
|
28
|
+
attr_reader :postal_code
|
|
29
|
+
attr_reader :region
|
|
30
|
+
attr_reader :shipping_method
|
|
31
|
+
attr_reader :street_address
|
|
10
32
|
|
|
11
33
|
def initialize(attributes)
|
|
12
34
|
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class ApplePayDetails
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :card_type
|
|
8
|
+
attr_reader :cardholder_name
|
|
9
|
+
attr_reader :commercial
|
|
10
|
+
attr_reader :country_of_issuance
|
|
11
|
+
attr_reader :debit
|
|
12
|
+
attr_reader :durbin_regulated
|
|
13
|
+
attr_reader :expiration_month
|
|
14
|
+
attr_reader :expiration_year
|
|
15
|
+
attr_reader :global_id
|
|
16
|
+
attr_reader :healthcare
|
|
17
|
+
attr_reader :image_url
|
|
18
|
+
attr_reader :issuing_bank
|
|
19
|
+
attr_reader :last_4
|
|
20
|
+
attr_reader :merchant_token_identifier
|
|
21
|
+
attr_reader :payment_instrument_name
|
|
22
|
+
attr_reader :payroll
|
|
23
|
+
attr_reader :prepaid
|
|
24
|
+
attr_reader :prepaid_reloadable
|
|
25
|
+
attr_reader :product_id
|
|
26
|
+
attr_reader :source_card_last4
|
|
27
|
+
attr_reader :source_description
|
|
28
|
+
attr_reader :token
|
|
29
|
+
|
|
30
|
+
def initialize(attributes)
|
|
31
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
module Braintree
|
|
2
2
|
class Transaction
|
|
3
|
-
class CreditCardDetails
|
|
3
|
+
class CreditCardDetails
|
|
4
4
|
include BaseModule
|
|
5
5
|
|
|
6
|
-
attr_reader :
|
|
7
|
-
|
|
6
|
+
attr_reader :account_type
|
|
7
|
+
attr_reader :bin
|
|
8
|
+
attr_reader :card_type
|
|
9
|
+
attr_reader :cardholder_name
|
|
10
|
+
attr_reader :commercial
|
|
11
|
+
attr_reader :country_of_issuance
|
|
12
|
+
attr_reader :customer_location
|
|
13
|
+
attr_reader :debit
|
|
14
|
+
attr_reader :durbin_regulated
|
|
15
|
+
attr_reader :expiration_month
|
|
16
|
+
attr_reader :expiration_year
|
|
17
|
+
attr_reader :healthcare
|
|
18
|
+
attr_reader :image_url
|
|
19
|
+
attr_reader :issuing_bank
|
|
20
|
+
attr_reader :last_4
|
|
21
|
+
attr_reader :payroll
|
|
22
|
+
attr_reader :prepaid
|
|
23
|
+
attr_reader :prepaid_reloadable
|
|
24
|
+
attr_reader :product_id
|
|
25
|
+
attr_reader :token
|
|
26
|
+
attr_reader :unique_number_identifier
|
|
8
27
|
|
|
9
28
|
def initialize(attributes)
|
|
10
29
|
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
@@ -15,7 +34,28 @@ module Braintree
|
|
|
15
34
|
end
|
|
16
35
|
|
|
17
36
|
def inspect
|
|
18
|
-
attr_order = [
|
|
37
|
+
attr_order = [
|
|
38
|
+
:bin,
|
|
39
|
+
:card_type,
|
|
40
|
+
:cardholder_name,
|
|
41
|
+
:commercial,
|
|
42
|
+
:country_of_issuance,
|
|
43
|
+
:customer_location,
|
|
44
|
+
:debit,
|
|
45
|
+
:durbin_regulated,
|
|
46
|
+
:expiration_date,
|
|
47
|
+
:healthcare,
|
|
48
|
+
:image_url,
|
|
49
|
+
:issuing_bank,
|
|
50
|
+
:last_4,
|
|
51
|
+
:payroll,
|
|
52
|
+
:prepaid,
|
|
53
|
+
:prepaid_reloadable,
|
|
54
|
+
:product_id,
|
|
55
|
+
:token,
|
|
56
|
+
:unique_number_identifier,
|
|
57
|
+
]
|
|
58
|
+
|
|
19
59
|
formatted_attrs = attr_order.map do |attr|
|
|
20
60
|
"#{attr}: #{send(attr).inspect}"
|
|
21
61
|
end
|
|
@@ -25,6 +65,17 @@ module Braintree
|
|
|
25
65
|
def masked_number
|
|
26
66
|
"#{bin}******#{last_4}"
|
|
27
67
|
end
|
|
68
|
+
|
|
69
|
+
# NEXT_MAJOR_VERSION Remove this method
|
|
70
|
+
# The old venmo SDK class has been deprecated
|
|
71
|
+
def venmo_sdk?
|
|
72
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
|
73
|
+
@venmo_sdk
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def is_network_tokenized?
|
|
77
|
+
@is_network_tokenized
|
|
78
|
+
end
|
|
28
79
|
end
|
|
29
80
|
end
|
|
30
81
|
end
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
module Braintree
|
|
2
2
|
class Transaction
|
|
3
|
-
class CustomerDetails
|
|
3
|
+
class CustomerDetails
|
|
4
4
|
include BaseModule
|
|
5
5
|
|
|
6
|
-
attr_reader :company
|
|
6
|
+
attr_reader :company
|
|
7
|
+
attr_reader :email
|
|
8
|
+
attr_reader :fax
|
|
9
|
+
attr_reader :first_name
|
|
10
|
+
attr_reader :id
|
|
11
|
+
attr_reader :international_phone
|
|
12
|
+
attr_reader :last_name
|
|
13
|
+
attr_reader :phone
|
|
14
|
+
attr_reader :website
|
|
7
15
|
|
|
8
16
|
def initialize(attributes)
|
|
9
17
|
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
10
18
|
end
|
|
11
19
|
|
|
12
20
|
def inspect
|
|
13
|
-
attr_order = [:id, :first_name, :last_name, :email, :company, :website, :phone, :fax]
|
|
21
|
+
attr_order = [:id, :first_name, :last_name, :email, :company, :website, :phone, :international_phone, :fax]
|
|
14
22
|
formatted_attrs = attr_order.map do |attr|
|
|
15
23
|
"#{attr}: #{send(attr).inspect}"
|
|
16
24
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class DisbursementDetails
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :disbursement_date
|
|
7
|
+
attr_reader :settlement_amount
|
|
8
|
+
attr_reader :settlement_currency_exchange_rate
|
|
9
|
+
attr_reader :settlement_currency_iso_code
|
|
10
|
+
attr_reader :success
|
|
11
|
+
|
|
12
|
+
alias_method :success?, :success
|
|
13
|
+
|
|
14
|
+
def initialize(attributes)
|
|
15
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
16
|
+
@disbursement_date = Date.parse(disbursement_date) unless disbursement_date.nil?
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def funds_held?
|
|
20
|
+
@funds_held
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def valid?
|
|
24
|
+
!disbursement_date.nil?
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class GooglePayDetails
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :card_type
|
|
8
|
+
attr_reader :commercial
|
|
9
|
+
attr_reader :country_of_issuance
|
|
10
|
+
attr_reader :debit
|
|
11
|
+
attr_reader :durbin_regulated
|
|
12
|
+
attr_reader :expiration_month
|
|
13
|
+
attr_reader :expiration_year
|
|
14
|
+
attr_reader :global_id
|
|
15
|
+
attr_reader :google_transaction_id
|
|
16
|
+
attr_reader :healthcare
|
|
17
|
+
attr_reader :image_url
|
|
18
|
+
attr_reader :issuing_bank
|
|
19
|
+
attr_reader :last_4
|
|
20
|
+
attr_reader :payroll
|
|
21
|
+
attr_reader :prepaid
|
|
22
|
+
attr_reader :prepaid_reloadable
|
|
23
|
+
attr_reader :product_id
|
|
24
|
+
attr_reader :source_card_last_4
|
|
25
|
+
attr_reader :source_card_type
|
|
26
|
+
attr_reader :source_description
|
|
27
|
+
attr_reader :token
|
|
28
|
+
attr_reader :virtual_card_last_4
|
|
29
|
+
attr_reader :virtual_card_type
|
|
30
|
+
|
|
31
|
+
def initialize(attributes)
|
|
32
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
33
|
+
@card_type = @virtual_card_type
|
|
34
|
+
@last_4 = @virtual_card_last_4
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def is_network_tokenized?
|
|
38
|
+
@is_network_tokenized
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class Installment
|
|
4
|
+
class Adjustment
|
|
5
|
+
include BaseModule
|
|
6
|
+
|
|
7
|
+
module Kind
|
|
8
|
+
Refund = "REFUND"
|
|
9
|
+
Dispute = "DISPUTE"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attr_reader :amount
|
|
13
|
+
attr_reader :kind
|
|
14
|
+
attr_reader :projected_disbursement_date
|
|
15
|
+
attr_reader :actual_disbursement_date
|
|
16
|
+
|
|
17
|
+
def initialize(attributes)
|
|
18
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
19
|
+
@amount = Util.to_big_decimal(amount)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def inspect
|
|
23
|
+
attrs = [:amount, :kind, :projected_disbursement_date, :actual_disbursement_date]
|
|
24
|
+
formatted_attrs = attrs.map do |attr|
|
|
25
|
+
"#{attr}: #{send(attr).inspect}"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class Installment
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :amount
|
|
8
|
+
attr_reader :projected_disbursement_date
|
|
9
|
+
attr_reader :actual_disbursement_date
|
|
10
|
+
attr_reader :adjustments
|
|
11
|
+
|
|
12
|
+
def initialize(attributes)
|
|
13
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
14
|
+
@amount = Util.to_big_decimal(amount)
|
|
15
|
+
adjustments.map! { |attrs| Adjustment.new(attrs) } if adjustments
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def inspect
|
|
19
|
+
attrs = [:id, :amount, :projected_disbursement_date, :actual_disbursement_date, :adjustments]
|
|
20
|
+
formatted_attrs = attrs.map do |attr|
|
|
21
|
+
"#{attr}: #{send(attr).inspect}"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class LocalPaymentDetails
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :blik_aliases
|
|
7
|
+
attr_reader :capture_id
|
|
8
|
+
attr_reader :custom_field
|
|
9
|
+
attr_reader :debug_id
|
|
10
|
+
attr_reader :description
|
|
11
|
+
attr_reader :funding_source
|
|
12
|
+
attr_reader :implicitly_vaulted_payment_method_global_id
|
|
13
|
+
attr_reader :implicitly_vaulted_payment_method_token
|
|
14
|
+
attr_reader :payer_id
|
|
15
|
+
attr_reader :payment_id
|
|
16
|
+
attr_reader :refund_from_transaction_fee_amount
|
|
17
|
+
attr_reader :refund_from_transaction_fee_currency_iso_code
|
|
18
|
+
attr_reader :refund_id
|
|
19
|
+
attr_reader :transaction_fee_amount
|
|
20
|
+
attr_reader :transaction_fee_currency_iso_code
|
|
21
|
+
|
|
22
|
+
def initialize(attributes)
|
|
23
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class MetaCheckoutCardDetails # :nodoc:
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :card_type
|
|
8
|
+
attr_reader :cardholder_name
|
|
9
|
+
attr_reader :commercial
|
|
10
|
+
attr_reader :container_id
|
|
11
|
+
attr_reader :country_of_issuance
|
|
12
|
+
attr_reader :created_at
|
|
13
|
+
attr_reader :customer_location
|
|
14
|
+
attr_reader :debit
|
|
15
|
+
attr_reader :durbin_regulated
|
|
16
|
+
attr_reader :expiration_month
|
|
17
|
+
attr_reader :expiration_year
|
|
18
|
+
attr_reader :healthcare
|
|
19
|
+
attr_reader :image_url
|
|
20
|
+
attr_reader :is_network_tokenized
|
|
21
|
+
attr_reader :issuing_bank
|
|
22
|
+
attr_reader :last_4
|
|
23
|
+
attr_reader :payroll
|
|
24
|
+
attr_reader :prepaid
|
|
25
|
+
attr_reader :prepaid_reloadable
|
|
26
|
+
attr_reader :product_id
|
|
27
|
+
attr_reader :token
|
|
28
|
+
attr_reader :unique_number_identifier
|
|
29
|
+
attr_reader :updated_at
|
|
30
|
+
|
|
31
|
+
def initialize(attributes)
|
|
32
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def expiration_date
|
|
36
|
+
"#{expiration_month}/#{expiration_year}"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def inspect
|
|
40
|
+
attr_order = [
|
|
41
|
+
:bin, :card_type, :cardholder_name, :commercial, :container_id, :country_of_issuance,
|
|
42
|
+
:customer_location, :debit, :durbin_regulated, :expiration_date, :healthcare, :image_url,
|
|
43
|
+
:issuing_bank, :last_4, :payroll, :prepaid, :prepaid_reloadable, :product_id, :token]
|
|
44
|
+
formatted_attrs = attr_order.map do |attr|
|
|
45
|
+
"#{attr}: #{send(attr).inspect}"
|
|
46
|
+
end
|
|
47
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def masked_number
|
|
51
|
+
"#{bin}******#{last_4}"
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class MetaCheckoutTokenDetails # :nodoc:
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :container_id
|
|
8
|
+
attr_reader :card_type
|
|
9
|
+
attr_reader :cardholder_name
|
|
10
|
+
attr_reader :commercial
|
|
11
|
+
attr_reader :country_of_issuance
|
|
12
|
+
attr_reader :created_at
|
|
13
|
+
attr_reader :cryptogram
|
|
14
|
+
attr_reader :customer_location
|
|
15
|
+
attr_reader :debit
|
|
16
|
+
attr_reader :durbin_regulated
|
|
17
|
+
attr_reader :ecommerce_indicator
|
|
18
|
+
attr_reader :expiration_month
|
|
19
|
+
attr_reader :expiration_year
|
|
20
|
+
attr_reader :healthcare
|
|
21
|
+
attr_reader :image_url
|
|
22
|
+
attr_reader :issuing_bank
|
|
23
|
+
attr_reader :is_network_tokenized
|
|
24
|
+
attr_reader :last_4
|
|
25
|
+
attr_reader :payroll
|
|
26
|
+
attr_reader :prepaid
|
|
27
|
+
attr_reader :prepaid_reloadable
|
|
28
|
+
attr_reader :product_id
|
|
29
|
+
attr_reader :token
|
|
30
|
+
attr_reader :unique_number_identifier
|
|
31
|
+
attr_reader :updated_at
|
|
32
|
+
|
|
33
|
+
def initialize(attributes)
|
|
34
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def expiration_date
|
|
38
|
+
"#{expiration_month}/#{expiration_year}"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def inspect
|
|
42
|
+
attr_order = [
|
|
43
|
+
:bin, :card_type, :cardholder_name, :commercial, :container_id, :country_of_issuance,
|
|
44
|
+
:cryptogram, :customer_location, :debit, :durbin_regulated, :ecommerce_indicator,
|
|
45
|
+
:expiration_date, :healthcare, :image_url, :is_network_tokenized, :issuing_bank, :last_4,
|
|
46
|
+
:payroll, :prepaid, :prepaid_reloadable, :product_id, :token]
|
|
47
|
+
formatted_attrs = attr_order.map do |attr|
|
|
48
|
+
"#{attr}: #{send(attr).inspect}"
|
|
49
|
+
end
|
|
50
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def masked_number
|
|
54
|
+
"#{bin}******#{last_4}"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class PackageDetails
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :carrier
|
|
7
|
+
attr_reader :id
|
|
8
|
+
# NEXT_MAJOR_VERSION Remove this method
|
|
9
|
+
# use paypal_tracker_id going forward
|
|
10
|
+
attr_reader :paypal_tracking_id
|
|
11
|
+
attr_reader :paypal_tracker_id
|
|
12
|
+
attr_reader :tracking_number
|
|
13
|
+
|
|
14
|
+
def initialize(attributes)
|
|
15
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class PaymentReceipt
|
|
4
|
+
class CardPresentData
|
|
5
|
+
include BaseModule
|
|
6
|
+
|
|
7
|
+
attr_reader :application_cryptogram
|
|
8
|
+
attr_reader :application_identifier
|
|
9
|
+
attr_reader :application_interchange_profile
|
|
10
|
+
attr_reader :application_name
|
|
11
|
+
attr_reader :application_transaction_counter
|
|
12
|
+
attr_reader :application_usage_control
|
|
13
|
+
attr_reader :authorization_mode
|
|
14
|
+
attr_reader :authorization_response_code
|
|
15
|
+
attr_reader :card_entry_method
|
|
16
|
+
attr_reader :card_sequence_number
|
|
17
|
+
attr_reader :cardholder_verification_method_results
|
|
18
|
+
attr_reader :cashback_amount
|
|
19
|
+
attr_reader :cryptogram_information_data
|
|
20
|
+
attr_reader :issuer_action_code_default
|
|
21
|
+
attr_reader :issuer_action_code_denial
|
|
22
|
+
attr_reader :issuer_action_code_online
|
|
23
|
+
attr_reader :issuer_authentication_data
|
|
24
|
+
attr_reader :terminal_country_code
|
|
25
|
+
attr_reader :terminal_transaction_date
|
|
26
|
+
attr_reader :terminal_transaction_type
|
|
27
|
+
attr_reader :terminal_verification_result
|
|
28
|
+
attr_reader :unpredictable_number
|
|
29
|
+
|
|
30
|
+
def initialize(attributes)
|
|
31
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class PaymentReceipt
|
|
4
|
+
class MerchantAddress
|
|
5
|
+
include BaseModule
|
|
6
|
+
|
|
7
|
+
attr_reader :locality
|
|
8
|
+
attr_reader :phone
|
|
9
|
+
attr_reader :postal_code
|
|
10
|
+
attr_reader :region
|
|
11
|
+
attr_reader :street_address
|
|
12
|
+
|
|
13
|
+
def initialize(attributes)
|
|
14
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class PaymentReceipt
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :account_balance
|
|
7
|
+
attr_reader :amount
|
|
8
|
+
attr_reader :card_last_4
|
|
9
|
+
attr_reader :card_present_data
|
|
10
|
+
attr_reader :card_type
|
|
11
|
+
attr_reader :currency_iso_code
|
|
12
|
+
attr_reader :global_id
|
|
13
|
+
attr_reader :id
|
|
14
|
+
attr_reader :merchant_address
|
|
15
|
+
attr_reader :merchant_identification_number
|
|
16
|
+
attr_reader :merchant_name
|
|
17
|
+
attr_reader :pin_verified
|
|
18
|
+
attr_reader :processor_authorization_code
|
|
19
|
+
attr_reader :processor_response_code
|
|
20
|
+
attr_reader :processor_response_text
|
|
21
|
+
attr_reader :terminal_identification_number
|
|
22
|
+
attr_reader :type
|
|
23
|
+
|
|
24
|
+
def initialize(attributes)
|
|
25
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
26
|
+
@card_present_data = CardPresentData.new(attributes[:card_present_date]) if attributes[:card_present_data]
|
|
27
|
+
@merchant_address = MerchantAddress.new(attributes[:merchant_address]) if attributes[:merchant_address]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|