braintree 2.101.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +6 -3
  4. data/lib/braintree.rb +3 -17
  5. data/lib/braintree/address.rb +0 -22
  6. data/lib/braintree/address_gateway.rb +2 -2
  7. data/lib/braintree/base_module.rb +6 -0
  8. data/lib/braintree/configuration.rb +1 -1
  9. data/lib/braintree/credit_card.rb +5 -76
  10. data/lib/braintree/credit_card_gateway.rb +16 -32
  11. data/lib/braintree/credit_card_verification.rb +14 -0
  12. data/lib/braintree/customer.rb +3 -72
  13. data/lib/braintree/customer_gateway.rb +0 -23
  14. data/lib/braintree/dispute.rb +1 -7
  15. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  16. data/lib/braintree/dispute/transaction.rb +2 -0
  17. data/lib/braintree/dispute_gateway.rb +2 -7
  18. data/lib/braintree/error_codes.rb +162 -157
  19. data/lib/braintree/exceptions.rb +5 -3
  20. data/lib/braintree/gateway.rb +0 -14
  21. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -1
  22. data/lib/braintree/local_payment_completed.rb +1 -1
  23. data/lib/braintree/merchant_account_gateway.rb +2 -0
  24. data/lib/braintree/payment_instrument_type.rb +1 -4
  25. data/lib/braintree/payment_method_gateway.rb +16 -8
  26. data/lib/braintree/payment_method_nonce.rb +2 -0
  27. data/lib/braintree/payment_method_nonce_gateway.rb +13 -2
  28. data/lib/braintree/payment_method_parser.rb +1 -7
  29. data/lib/braintree/risk_data.rb +4 -1
  30. data/lib/braintree/subscription.rb +5 -5
  31. data/lib/braintree/successful_result.rb +0 -1
  32. data/lib/braintree/test/authentication_id.rb +21 -0
  33. data/lib/braintree/test/credit_card.rb +1 -0
  34. data/lib/braintree/test/nonce.rb +19 -20
  35. data/lib/braintree/transaction.rb +8 -72
  36. data/lib/braintree/transaction/address_details.rb +11 -0
  37. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  38. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  39. data/lib/braintree/transaction/paypal_details.rb +2 -0
  40. data/lib/braintree/transaction/subscription_details.rb +2 -0
  41. data/lib/braintree/transaction_gateway.rb +14 -21
  42. data/lib/braintree/transaction_search.rb +0 -1
  43. data/lib/braintree/util.rb +17 -2
  44. data/lib/braintree/version.rb +3 -3
  45. data/lib/braintree/webhook_notification.rb +3 -10
  46. data/lib/braintree/webhook_testing_gateway.rb +243 -43
  47. data/lib/braintree/xml/libxml.rb +1 -0
  48. data/lib/braintree/xml/parser.rb +11 -34
  49. data/spec/integration/braintree/address_spec.rb +2 -89
  50. data/spec/integration/braintree/client_api/spec_helper.rb +100 -67
  51. data/spec/integration/braintree/credit_card_spec.rb +119 -467
  52. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -0
  53. data/spec/integration/braintree/customer_spec.rb +135 -362
  54. data/spec/integration/braintree/dispute_search_spec.rb +2 -2
  55. data/spec/integration/braintree/dispute_spec.rb +1 -2
  56. data/spec/integration/braintree/document_upload_spec.rb +12 -0
  57. data/spec/integration/braintree/merchant_spec.rb +2 -2
  58. data/spec/integration/braintree/payment_method_nonce_spec.rb +77 -0
  59. data/spec/integration/braintree/payment_method_spec.rb +186 -120
  60. data/spec/integration/braintree/paypal_account_spec.rb +1 -1
  61. data/spec/integration/braintree/subscription_spec.rb +11 -16
  62. data/spec/integration/braintree/transaction_search_spec.rb +3 -3
  63. data/spec/integration/braintree/transaction_spec.rb +252 -524
  64. data/spec/integration/spec_helper.rb +1 -4
  65. data/spec/spec_helper.rb +1 -11
  66. data/spec/unit/braintree/address_spec.rb +0 -8
  67. data/spec/unit/braintree/credit_card_spec.rb +50 -23
  68. data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
  69. data/spec/unit/braintree/customer_spec.rb +26 -14
  70. data/spec/unit/braintree/dispute_spec.rb +4 -12
  71. data/spec/unit/braintree/http_spec.rb +3 -3
  72. data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
  73. data/spec/unit/braintree/transaction/paypal_details_spec.rb +57 -0
  74. data/spec/unit/braintree/transaction_spec.rb +17 -37
  75. data/spec/unit/braintree/util_spec.rb +37 -3
  76. data/spec/unit/braintree/webhook_notification_spec.rb +49 -1
  77. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  78. metadata +29 -31
  79. data/lib/braintree/amex_express_checkout_card.rb +0 -38
  80. data/lib/braintree/coinbase_account.rb +0 -34
  81. data/lib/braintree/europe_bank_account.rb +0 -36
  82. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  83. data/lib/braintree/ideal_payment.rb +0 -61
  84. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  85. data/lib/braintree/masterpass_card.rb +0 -81
  86. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  87. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  88. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  89. data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
  90. data/lib/braintree/transparent_redirect.rb +0 -40
  91. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  92. data/lib/braintree/xml/rexml.rb +0 -71
  93. data/spec/hacks/tcp_socket.rb +0 -18
  94. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  95. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  96. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  97. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  98. data/spec/unit/braintree/xml/rexml_spec.rb +0 -51
@@ -8,9 +8,7 @@ module Braintree # :nodoc:
8
8
 
9
9
  class ConfigurationError < BraintreeError; end
10
10
 
11
- class DownForMaintenanceError < BraintreeError; end
12
-
13
- class ForgedQueryString < BraintreeError; end
11
+ class GatewayTimeoutError < BraintreeError; end
14
12
 
15
13
  class InvalidSignature < BraintreeError; end
16
14
 
@@ -18,8 +16,12 @@ module Braintree # :nodoc:
18
16
 
19
17
  class NotFoundError < BraintreeError; end
20
18
 
19
+ class RequestTimeoutError < BraintreeError; end
20
+
21
21
  class ServerError < BraintreeError; end
22
22
 
23
+ class ServiceUnavailableError < BraintreeError; end
24
+
23
25
  class SSLCertificateError < BraintreeError; end
24
26
 
25
27
  class TooManyRequestsError < BraintreeError; end
@@ -74,12 +74,6 @@ module Braintree
74
74
  UsBankAccountGateway.new(self)
75
75
  end
76
76
 
77
- # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
78
- # DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
79
- def ideal_payment
80
- IdealPaymentGateway.new(self)
81
- end
82
-
83
77
  def merchant
84
78
  MerchantGateway.new(self)
85
79
  end
@@ -88,10 +82,6 @@ module Braintree
88
82
  MerchantAccountGateway.new(self)
89
83
  end
90
84
 
91
- def europe_bank_account
92
- EuropeBankAccountGateway.new(self)
93
- end
94
-
95
85
  def settlement_batch_summary
96
86
  SettlementBatchSummaryGateway.new(self)
97
87
  end
@@ -100,10 +90,6 @@ module Braintree
100
90
  SubscriptionGateway.new(self)
101
91
  end
102
92
 
103
- def transparent_redirect
104
- TransparentRedirectGateway.new(self)
105
- end
106
-
107
93
  def transaction
108
94
  TransactionGateway.new(self)
109
95
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class AndroidPayCard
2
+ class GooglePayCard
3
3
  include BaseModule # :nodoc:
4
4
 
5
5
  attr_reader :bin
@@ -9,7 +9,7 @@ module Braintree
9
9
 
10
10
  def initialize(attributes) # :nodoc:
11
11
  set_instance_variables_from_hash(attributes)
12
- @transaction = Transaction._new(Configuration.gateway, transaction)
12
+ @transaction = Transaction._new(Configuration.gateway, transaction) unless transaction.nil?
13
13
  end
14
14
 
15
15
  class << self
@@ -83,6 +83,7 @@ module Braintree
83
83
  end
84
84
  end
85
85
 
86
+ # this is part of Marketplace and shouldn't be removed unless we're removing all Marketplace code
86
87
  def self._detect_signature(attributes)
87
88
  if attributes.has_key?(:applicant_details)
88
89
  warn "[DEPRECATED] Passing :applicant_details to create is deprecated. Please use :individual, :business, and :funding."
@@ -92,6 +93,7 @@ module Braintree
92
93
  end
93
94
  end
94
95
 
96
+ # this is part of Marketplace and shouldn't be removed unless we're removing all Marketplace code
95
97
  def self._deprecated_create_signature # :nodoc:
96
98
  [
97
99
  {:applicant_details => [
@@ -1,15 +1,12 @@
1
1
  module Braintree
2
2
  module PaymentInstrumentType
3
3
  PayPalAccount = 'paypal_account'
4
- EuropeBankAccount = 'europe_bank_account'
5
4
  CreditCard = 'credit_card'
6
- CoinbaseAccount = 'coinbase_account'
7
5
  ApplePayCard = 'apple_pay_card'
8
- AndroidPayCard = 'android_pay_card'
6
+ GooglePayCard = 'android_pay_card'
9
7
  VenmoAccount = 'venmo_account'
10
8
  UsBankAccount = 'us_bank_account'
11
9
  VisaCheckoutCard = 'visa_checkout_card'
12
- MasterpassCard = 'masterpass_card'
13
10
  SamsungPayCard = 'samsung_pay_card'
14
11
  LocalPayment = 'local_payment'
15
12
  PayPalHere = 'paypal_here'
@@ -43,16 +43,12 @@ module Braintree
43
43
  CreditCard._new(@gateway, response[:credit_card])
44
44
  elsif response.has_key?(:paypal_account)
45
45
  PayPalAccount._new(@gateway, response[:paypal_account])
46
- elsif response[:coinbase_account]
47
- SuccessfulResult.new(:payment_method => CoinbaseAccount._new(@gateway, response[:coinbase_account]))
48
46
  elsif response.has_key?(:us_bank_account)
49
47
  UsBankAccount._new(@gateway, response[:us_bank_account])
50
- elsif response.has_key?(:europe_bank_account)
51
- EuropeBankAccount._new(@gateway, response[:europe_bank_account])
52
48
  elsif response.has_key?(:apple_pay_card)
53
49
  ApplePayCard._new(@gateway, response[:apple_pay_card])
54
50
  elsif response.has_key?(:android_pay_card)
55
- AndroidPayCard._new(@gateway, response[:android_pay_card])
51
+ GooglePayCard._new(@gateway, response[:android_pay_card])
56
52
  elsif response.has_key?(:venmo_account)
57
53
  VenmoAccount._new(@gateway, response[:venmo_account])
58
54
  else
@@ -166,12 +162,24 @@ module Braintree
166
162
  ],
167
163
  ]
168
164
  signature = [
169
- :billing_address_id, :cardholder_name, :cvv, :device_session_id, :expiration_date,
170
- :expiration_month, :expiration_year, :number, :token, :venmo_sdk_payment_method_code,
171
- :device_data, :fraud_merchant_id, :payment_method_nonce,
165
+ :billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
166
+ :expiration_year, :number, :token, :venmo_sdk_payment_method_code, :device_data,
167
+ :payment_method_nonce,
172
168
  {:options => options},
173
169
  {:billing_address => billing_address_params}
174
170
  ]
171
+ signature << {
172
+ :three_d_secure_pass_thru => [
173
+ :eci_flag,
174
+ :cavv,
175
+ :xid,
176
+ :three_d_secure_version,
177
+ :authentication_response,
178
+ :directory_response,
179
+ :cavv_algorithm,
180
+ :ds_transaction_id,
181
+ ]
182
+ }
175
183
 
176
184
  case type
177
185
  when :create
@@ -19,12 +19,14 @@ module Braintree
19
19
  attr_reader :nonce
20
20
  attr_reader :three_d_secure_info
21
21
  attr_reader :type
22
+ attr_reader :authentication_insight
22
23
 
23
24
  def initialize(gateway, attributes) # :nodoc:
24
25
  @gateway = gateway
25
26
  @nonce = attributes.fetch(:nonce)
26
27
  @type = attributes.fetch(:type)
27
28
  @details = attributes.fetch(:details)
29
+ @authentication_insight = attributes.fetch(:authentication_insight, nil)
28
30
  @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
29
31
  @bin_data = BinData.new(attributes[:bin_data]) if attributes[:bin_data]
30
32
  end
@@ -8,12 +8,23 @@ module Braintree
8
8
  @config.assert_has_access_token_or_keys
9
9
  end
10
10
 
11
- def create(payment_method_token)
12
- response = @config.http.post("#{@config.base_merchant_path}/payment_methods/#{payment_method_token}/nonces")
11
+ def create(payment_method_token, args = { payment_method_nonce: {} })
12
+ Util.verify_keys(PaymentMethodNonceGateway._create_signature, args)
13
+
14
+ response = @config.http.post("#{@config.base_merchant_path}/payment_methods/#{payment_method_token}/nonces", args)
13
15
  payment_method_nonce = PaymentMethodNonce._new(@gateway, response.fetch(:payment_method_nonce))
14
16
  SuccessfulResult.new(:payment_method_nonce => payment_method_nonce)
15
17
  end
16
18
 
19
+ def self._create_signature
20
+ [ {
21
+ :payment_method_nonce=> [
22
+ :merchant_account_id, :authentication_insight,
23
+ {:authentication_insight_options => [:amount, :recurring_customer_consent, :recurring_max_amount]}
24
+ ]
25
+ }]
26
+ end
27
+
17
28
  def create!(*args)
18
29
  return_object_or_raise(:payment_method_nonce) { create(*args) }
19
30
  end
@@ -6,22 +6,16 @@ module Braintree
6
6
  CreditCard._new(gateway, attributes[:credit_card])
7
7
  elsif attributes[:paypal_account]
8
8
  PayPalAccount._new(gateway, attributes[:paypal_account])
9
- elsif attributes[:coinbase_account]
10
- CoinbaseAccount._new(gateway, attributes[:coinbase_account])
11
9
  elsif attributes[:us_bank_account]
12
10
  UsBankAccount._new(gateway, attributes[:us_bank_account])
13
11
  elsif attributes[:apple_pay_card]
14
12
  ApplePayCard._new(gateway, attributes[:apple_pay_card])
15
13
  elsif attributes[:android_pay_card]
16
- AndroidPayCard._new(gateway, attributes[:android_pay_card])
17
- elsif attributes[:amex_express_checkout_card]
18
- AmexExpressCheckoutCard._new(gateway, attributes[:amex_express_checkout_card])
14
+ GooglePayCard._new(gateway, attributes[:android_pay_card])
19
15
  elsif attributes[:venmo_account]
20
16
  VenmoAccount._new(gateway, attributes[:venmo_account])
21
17
  elsif attributes[:visa_checkout_card]
22
18
  VisaCheckoutCard._new(gateway, attributes[:visa_checkout_card])
23
- elsif attributes[:masterpass_card]
24
- MasterpassCard._new(gateway, attributes[:masterpass_card])
25
19
  elsif attributes[:samsung_pay_card]
26
20
  SamsungPayCard._new(gateway, attributes[:samsung_pay_card])
27
21
  else
@@ -2,10 +2,13 @@ module Braintree
2
2
  class RiskData # :nodoc:
3
3
  include BaseModule
4
4
 
5
+ attr_reader :customer_device_id
6
+ attr_reader :customer_location_zip
7
+ attr_reader :customer_tenure
5
8
  attr_reader :decision
6
9
  attr_reader :device_data_captured
7
- attr_reader :id
8
10
  attr_reader :fraud_service_provider
11
+ attr_reader :id
9
12
 
10
13
  def initialize(attributes)
11
14
  set_instance_variables_from_hash attributes unless attributes.nil?
@@ -101,11 +101,11 @@ module Braintree
101
101
  add_ons.map! { |attrs| AddOn._new(attrs) }
102
102
  discounts.map! { |attrs| Discount._new(attrs) }
103
103
  @status_history = attributes[:status_history] ? attributes[:status_history].map { |s| StatusDetails.new(s) } : []
104
- end
105
-
106
- def next_bill_amount
107
- warn "[DEPRECATED] Subscription.next_bill_amount is deprecated. Please use Subscription.next_billing_period_amount"
108
- @next_bill_amount
104
+ @first_billing_date = Date.parse(first_billing_date) unless first_billing_date.nil?
105
+ @next_billing_date = Date.parse(next_billing_date) unless next_billing_date.nil?
106
+ @billing_period_start_date = Date.parse(billing_period_start_date) unless billing_period_start_date.nil?
107
+ @billing_period_end_date = Date.parse(billing_period_end_date) unless billing_period_end_date.nil?
108
+ @paid_through_date = Date.parse(paid_through_date) unless paid_through_date.nil?
109
109
  end
110
110
 
111
111
  def never_expires?
@@ -13,7 +13,6 @@ module Braintree
13
13
  attr_reader :merchant
14
14
  attr_reader :merchant_account
15
15
  attr_reader :merchant_accounts
16
- attr_reader :new_transaction
17
16
  attr_reader :payment_method
18
17
  attr_reader :payment_method_nonce
19
18
  attr_reader :paypal_account
@@ -0,0 +1,21 @@
1
+ module Braintree
2
+ module Test
3
+ module AuthenticationId
4
+ ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-id"
5
+ ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-id"
6
+ ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-id"
7
+ ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-id"
8
+ ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-id"
9
+ ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-id"
10
+ ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-id"
11
+ ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-id"
12
+ ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-id"
13
+ ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-id"
14
+ ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-id"
15
+ ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-id"
16
+ ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-id"
17
+ ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-id"
18
+ ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-id"
19
+ end
20
+ end
21
+ end
@@ -40,6 +40,7 @@ module Braintree
40
40
  VisaPrepaid = "4500600000000061"
41
41
 
42
42
  Fraud = "4000111111111511"
43
+ RiskThreshold = "4111130000000003"
43
44
 
44
45
  Visas = %w[4009348888881881 4012888888881881 4111111111111111 4000111111111115 4500600000000061]
45
46
  Unknowns = %w[1000000000000008]
@@ -12,15 +12,27 @@ module Braintree
12
12
  ApplePayAmEx = "fake-apple-pay-amex-nonce"
13
13
  AbstractTransactable = "fake-abstract-transactable-nonce"
14
14
  Europe = "fake-europe-bank-account-nonce"
15
- Coinbase = "fake-coinbase-nonce"
16
- AndroidPayDiscover = "fake-android-pay-discover-nonce"
17
- AndroidPayVisa = "fake-android-pay-visa-nonce"
18
- AndroidPayMasterCard = "fake-android-pay-mastercard-nonce"
19
- AndroidPayAmEx = "fake-android-pay-amex-nonce"
20
- AmexExpressCheckout = "fake-amex-express-checkout-nonce"
15
+ GooglePayDiscover = "fake-android-pay-discover-nonce"
16
+ GooglePayVisa = "fake-android-pay-visa-nonce"
17
+ GooglePayMasterCard = "fake-android-pay-mastercard-nonce"
18
+ GooglePayAmEx = "fake-android-pay-amex-nonce"
21
19
  VenmoAccount = "fake-venmo-account-nonce"
22
20
  VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
23
21
  ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
22
+ ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-nonce"
23
+ ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-nonce"
24
+ ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-nonce"
25
+ ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-nonce"
26
+ ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-nonce"
27
+ ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-nonce"
28
+ ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-nonce"
29
+ ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-nonce"
30
+ ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-nonce"
31
+ ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-nonce"
32
+ ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-nonce"
33
+ ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-nonce"
34
+ ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-nonce"
35
+ ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-nonce"
24
36
  TransactableVisa = "fake-valid-visa-nonce"
25
37
  TransactableAmEx = "fake-valid-amex-nonce"
26
38
  TransactableMasterCard = "fake-valid-mastercard-nonce"
@@ -46,12 +58,8 @@ module Braintree
46
58
  ProcessorFailureJCB = "fake-processor-failure-jcb-nonce"
47
59
  LuhnInvalid = "fake-luhn-invalid-nonce"
48
60
  PayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce"
49
- SEPA = "fake-sepa-bank-account-nonce"
50
61
  GatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce"
51
- MasterpassAmEx = "fake-masterpass-amex-nonce"
52
- MasterpassDiscover = "fake-masterpass-discover-nonce"
53
- MasterpassMasterCard = "fake-masterpass-mastercard-nonce"
54
- MasterpassVisa = "fake-masterpass-visa-nonce"
62
+ GatewayRejectedRiskThresholds = "fake-gateway-rejected-risk-thresholds-nonce"
55
63
  VisaCheckoutAmEx = "fake-visa-checkout-amex-nonce"
56
64
  VisaCheckoutDiscover = "fake-visa-checkout-discover-nonce"
57
65
  VisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce"
@@ -60,15 +68,6 @@ module Braintree
60
68
  SamsungPayDiscover = "tokensam_fake_discover"
61
69
  SamsungPayMasterCard = "tokensam_fake_mastercard"
62
70
  SamsungPayVisa = "tokensam_fake_visa"
63
-
64
- def self.const_missing(const_name)
65
- if const_name == :AndroidPay
66
- warn "[DEPRECATED] Braintree::Test::Nonce::AndroidPay is deprecated. Use a card-specific nonce, e.g. Braintree::Test::Nonce::AndroidPayMasterCard"
67
- "fake-android-pay-nonce"
68
- else
69
- super
70
- end
71
- end
72
71
  end
73
72
  end
74
73
  end
@@ -25,6 +25,7 @@ module Braintree
25
25
  CVV = "cvv"
26
26
  Duplicate = "duplicate"
27
27
  Fraud = "fraud"
28
+ RiskThreshold = "risk_threshold"
28
29
  ThreeDSecure = "three_d_secure"
29
30
  TokenIssuance = "token_issuance"
30
31
  Unrecognized = "unrecognized"
@@ -91,9 +92,8 @@ module Braintree
91
92
 
92
93
  attr_reader :add_ons
93
94
  attr_reader :additional_processor_response # The raw response from the processor.
94
- attr_reader :amex_express_checkout_details
95
95
  attr_reader :amount
96
- attr_reader :android_pay_details
96
+ attr_reader :google_pay_details
97
97
  attr_reader :apple_pay_details
98
98
  attr_reader :authorization_adjustments
99
99
  attr_reader :authorization_expires_at
@@ -103,7 +103,6 @@ module Braintree
103
103
  attr_reader :avs_street_address_response_code
104
104
  attr_reader :billing_details
105
105
  attr_reader :channel
106
- attr_reader :coinbase_details
107
106
  attr_reader :created_at
108
107
  attr_reader :credit_card_details
109
108
  attr_reader :currency_iso_code
@@ -121,11 +120,7 @@ module Braintree
121
120
  attr_reader :gateway_rejection_reason
122
121
  attr_reader :graphql_id
123
122
  attr_reader :id
124
- # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
125
- # DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
126
- attr_reader :ideal_payment_details
127
123
  attr_reader :local_payment_details
128
- attr_reader :masterpass_card_details
129
124
  attr_reader :merchant_account_id
130
125
  attr_reader :network_response_code # Response code from the card network
131
126
  attr_reader :network_response_text # Response text from the card network
@@ -142,6 +137,7 @@ module Braintree
142
137
  attr_reader :processor_response_type # Response type from the processor.
143
138
  attr_reader :processor_settlement_response_code # Settlement response code from the processor.
144
139
  attr_reader :processor_settlement_response_text # Settlement response text from the processor.
140
+ attr_reader :product_sku
145
141
  attr_reader :purchase_order_number
146
142
  attr_reader :recurring
147
143
  attr_reader :refund_ids
@@ -166,6 +162,7 @@ module Braintree
166
162
  attr_reader :venmo_account_details
167
163
  attr_reader :visa_checkout_card_details
168
164
  attr_reader :voice_referral_number
165
+ attr_reader :retrieval_reference_number
169
166
 
170
167
  def self.create(*args)
171
168
  Configuration.gateway.transaction.create(*args)
@@ -191,18 +188,6 @@ module Braintree
191
188
  Configuration.gateway.transaction.clone_transaction!(*args)
192
189
  end
193
190
 
194
- # Deprecated. Use Braintree::TransparentRedirect.confirm
195
- def self.create_from_transparent_redirect(*args)
196
- warn "[DEPRECATED] Transaction.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
197
- Configuration.gateway.transaction.create_from_transparent_redirect(*args)
198
- end
199
-
200
- # Deprecated. Use Braintree::TransparentRedirect.url
201
- def self.create_transaction_url
202
- warn "[DEPRECATED] Transaction.create_transaction_url is deprecated. Please use TransparentRedirect.url"
203
- Configuration.gateway.transaction.create_transaction_url
204
- end
205
-
206
191
  def self.credit(*args)
207
192
  Configuration.gateway.transaction.credit(*args)
208
193
  end
@@ -305,10 +290,8 @@ module Braintree
305
290
  @paypal_details = PayPalDetails.new(@paypal)
306
291
  @paypal_here_details = PayPalHereDetails.new(@paypal_here)
307
292
  @apple_pay_details = ApplePayDetails.new(@apple_pay)
308
- @android_pay_details = AndroidPayDetails.new(@android_pay_card)
309
- @amex_express_checkout_details = AmexExpressCheckoutDetails.new(@amex_express_checkout_card)
293
+ @google_pay_details = GooglePayDetails.new(@google_pay_card)
310
294
  @venmo_account_details = VenmoAccountDetails.new(@venmo_account)
311
- @coinbase_details = CoinbaseDetails.new(@coinbase_account)
312
295
  disputes.map! { |attrs| Dispute._new(attrs) } if disputes
313
296
  @custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
314
297
  add_ons.map! { |attrs| AddOn._new(attrs) } if add_ons
@@ -319,9 +302,7 @@ module Braintree
319
302
  @facilitator_details = FacilitatorDetails.new(attributes[:facilitator_details]) if attributes[:facilitator_details]
320
303
  @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
321
304
  @us_bank_account_details = UsBankAccountDetails.new(attributes[:us_bank_account]) if attributes[:us_bank_account]
322
- @ideal_payment_details = IdealPaymentDetails.new(attributes[:ideal_payment]) if attributes[:ideal_payment]
323
305
  @visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card])
324
- @masterpass_card_details = MasterpassCardDetails.new(attributes[:masterpass_card])
325
306
  @samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
326
307
  authorization_adjustments.map! { |attrs| AuthorizationAdjustment._new(attrs) } if authorization_adjustments
327
308
  end
@@ -343,18 +324,6 @@ module Braintree
343
324
  @gateway.transaction_line_item.find_all(id)
344
325
  end
345
326
 
346
- # Deprecated. Use Braintree::Transaction.refund
347
- def refund(amount = nil)
348
- warn "[DEPRECATED] refund as an instance method is deprecated. Please use Transaction.refund"
349
- result = @gateway.transaction.refund(id, amount)
350
-
351
- if result.success?
352
- SuccessfulResult.new(:new_transaction => result.transaction)
353
- else
354
- result
355
- end
356
- end
357
-
358
327
  # Returns true if the transaction has been refunded. False otherwise.
359
328
  def refunded?
360
329
  !@refund_id.nil?
@@ -365,27 +334,6 @@ module Braintree
365
334
  @disbursement_details.valid?
366
335
  end
367
336
 
368
- def refund_id
369
- warn "[DEPRECATED] Transaction.refund_id is deprecated. Please use Transaction.refund_ids"
370
- @refund_id
371
- end
372
-
373
- # Deprecated. Use Braintree::Transaction.submit_for_settlement
374
- def submit_for_settlement(amount = nil)
375
- warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
376
- result = @gateway.transaction.submit_for_settlement(id, amount)
377
- if result.success?
378
- copy_instance_variables_from_object result.transaction
379
- end
380
- result
381
- end
382
-
383
- # Deprecated. Use Braintree::Transaction.submit_for_settlement!
384
- def submit_for_settlement!(amount = nil)
385
- warn "[DEPRECATED] submit_for_settlement! as an instance method is deprecated. Please use Transaction.submit_for_settlement!"
386
- return_object_or_raise(:transaction) { submit_for_settlement(amount) }
387
- end
388
-
389
337
  # If this transaction was stored in the vault, or created from vault records,
390
338
  # vault_billing_address will return the associated Braintree::Address. Because the
391
339
  # vault billing address can be updated after the transaction was created, the attributes
@@ -422,20 +370,8 @@ module Braintree
422
370
  @gateway.address.find(customer_details.id, shipping_details.id)
423
371
  end
424
372
 
425
- # Deprecated. Use Braintree::Transaction.void
426
- def void
427
- warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
428
- result = @gateway.transaction.void(id)
429
- if result.success?
430
- copy_instance_variables_from_object result.transaction
431
- end
432
- result
433
- end
434
-
435
- # Deprecated. Use Braintree::Transaction.void!
436
- def void!
437
- warn "[DEPRECATED] void! as an instance method is deprecated. Please use Transaction.void!"
438
- return_object_or_raise(:transaction) { void }
373
+ def processed_with_network_token?
374
+ @processed_with_network_token
439
375
  end
440
376
 
441
377
  class << self
@@ -446,7 +382,7 @@ module Braintree
446
382
  end
447
383
 
448
384
  def self._attributes # :nodoc:
449
- [:amount, :created_at, :credit_card_details, :customer_details, :id, :status, :subscription_details, :type, :updated_at]
385
+ [:amount, :created_at, :credit_card_details, :customer_details, :id, :status, :subscription_details, :type, :updated_at, :processed_with_network_token?]
450
386
  end
451
387
  end
452
388
  end