braintree 2.104.1 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +7 -4
  4. data/lib/braintree.rb +7 -18
  5. data/lib/braintree/account_updater_daily_report.rb +1 -1
  6. data/lib/braintree/address.rb +1 -23
  7. data/lib/braintree/apple_pay.rb +1 -1
  8. data/lib/braintree/apple_pay_card.rb +1 -1
  9. data/lib/braintree/apple_pay_options.rb +1 -1
  10. data/lib/braintree/authorization_adjustment.rb +1 -1
  11. data/lib/braintree/base_module.rb +6 -0
  12. data/lib/braintree/bin_data.rb +9 -2
  13. data/lib/braintree/client_token.rb +1 -1
  14. data/lib/braintree/configuration.rb +12 -12
  15. data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
  16. data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
  17. data/lib/braintree/credit_card.rb +2 -77
  18. data/lib/braintree/credit_card_gateway.rb +7 -36
  19. data/lib/braintree/credit_card_verification.rb +18 -5
  20. data/lib/braintree/credit_card_verification_search.rb +1 -1
  21. data/lib/braintree/customer.rb +5 -76
  22. data/lib/braintree/customer_gateway.rb +0 -23
  23. data/lib/braintree/customer_search.rb +1 -1
  24. data/lib/braintree/disbursement.rb +1 -1
  25. data/lib/braintree/dispute.rb +2 -8
  26. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  27. data/lib/braintree/dispute_gateway.rb +4 -9
  28. data/lib/braintree/dispute_search.rb +2 -2
  29. data/lib/braintree/document_upload.rb +1 -1
  30. data/lib/braintree/error_codes.rb +151 -170
  31. data/lib/braintree/exceptions.rb +5 -3
  32. data/lib/braintree/gateway.rb +0 -14
  33. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +2 -3
  34. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  35. data/lib/braintree/graphql_client.rb +7 -7
  36. data/lib/braintree/http.rb +3 -3
  37. data/lib/braintree/local_payment_completed.rb +1 -1
  38. data/lib/braintree/local_payment_reversed.rb +19 -0
  39. data/lib/braintree/merchant.rb +1 -1
  40. data/lib/braintree/merchant_account.rb +1 -1
  41. data/lib/braintree/merchant_account_gateway.rb +3 -1
  42. data/lib/braintree/merchant_gateway.rb +1 -1
  43. data/lib/braintree/modification.rb +1 -1
  44. data/lib/braintree/oauth_credentials.rb +1 -1
  45. data/lib/braintree/oauth_gateway.rb +5 -5
  46. data/lib/braintree/payment_instrument_type.rb +10 -14
  47. data/lib/braintree/payment_method_gateway.rb +8 -13
  48. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  49. data/lib/braintree/payment_method_parser.rb +1 -8
  50. data/lib/braintree/plan.rb +1 -1
  51. data/lib/braintree/processor_response_types.rb +3 -3
  52. data/lib/braintree/resource_collection.rb +8 -3
  53. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  54. data/lib/braintree/risk_data.rb +3 -1
  55. data/lib/braintree/samsung_pay_card.rb +1 -1
  56. data/lib/braintree/settlement_batch_summary.rb +2 -2
  57. data/lib/braintree/subscription.rb +11 -11
  58. data/lib/braintree/successful_result.rb +0 -1
  59. data/lib/braintree/test/credit_card.rb +1 -0
  60. data/lib/braintree/test/nonce.rb +4 -23
  61. data/lib/braintree/three_d_secure_info.rb +22 -12
  62. data/lib/braintree/transaction.rb +44 -104
  63. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  64. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  65. data/lib/braintree/transaction/installment.rb +28 -0
  66. data/lib/braintree/transaction/installment/adjustment.rb +33 -0
  67. data/lib/braintree/transaction/paypal_details.rb +1 -0
  68. data/lib/braintree/transaction/subscription_details.rb +2 -0
  69. data/lib/braintree/transaction_gateway.rb +37 -25
  70. data/lib/braintree/transaction_line_item.rb +1 -1
  71. data/lib/braintree/transaction_search.rb +3 -2
  72. data/lib/braintree/unknown_payment_method.rb +1 -1
  73. data/lib/braintree/us_bank_account.rb +3 -3
  74. data/lib/braintree/us_bank_account_verification.rb +1 -1
  75. data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
  76. data/lib/braintree/util.rb +21 -6
  77. data/lib/braintree/venmo_account.rb +1 -1
  78. data/lib/braintree/version.rb +3 -3
  79. data/lib/braintree/visa_checkout_card.rb +2 -2
  80. data/lib/braintree/webhook_notification.rb +28 -29
  81. data/lib/braintree/webhook_notification_gateway.rb +5 -5
  82. data/lib/braintree/webhook_testing_gateway.rb +10 -43
  83. data/lib/braintree/xml/generator.rb +5 -4
  84. data/lib/braintree/xml/libxml.rb +1 -0
  85. data/lib/braintree/xml/parser.rb +21 -44
  86. data/spec/integration/braintree/add_on_spec.rb +1 -1
  87. data/spec/integration/braintree/address_spec.rb +26 -113
  88. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  89. data/spec/integration/braintree/apple_pay_spec.rb +3 -3
  90. data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
  91. data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
  92. data/spec/integration/braintree/client_api/spec_helper.rb +5 -31
  93. data/spec/integration/braintree/credit_card_spec.rb +130 -593
  94. data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
  95. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
  96. data/spec/integration/braintree/customer_search_spec.rb +8 -8
  97. data/spec/integration/braintree/customer_spec.rb +336 -509
  98. data/spec/integration/braintree/dispute_search_spec.rb +6 -6
  99. data/spec/integration/braintree/dispute_spec.rb +6 -7
  100. data/spec/integration/braintree/error_codes_spec.rb +1 -1
  101. data/spec/integration/braintree/http_spec.rb +2 -2
  102. data/spec/integration/braintree/merchant_account_spec.rb +25 -26
  103. data/spec/integration/braintree/merchant_spec.rb +14 -14
  104. data/spec/integration/braintree/oauth_spec.rb +11 -11
  105. data/spec/integration/braintree/payment_method_nonce_spec.rb +12 -12
  106. data/spec/integration/braintree/payment_method_spec.rb +403 -269
  107. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +17 -13
  108. data/spec/integration/braintree/paypal_account_spec.rb +28 -28
  109. data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
  110. data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
  111. data/spec/integration/braintree/subscription_spec.rb +144 -149
  112. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  113. data/spec/integration/braintree/test_transaction_spec.rb +10 -10
  114. data/spec/integration/braintree/transaction_search_spec.rb +96 -70
  115. data/spec/integration/braintree/transaction_spec.rb +832 -904
  116. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -26
  117. data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
  118. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
  119. data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
  120. data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
  121. data/spec/integration/spec_helper.rb +10 -7
  122. data/spec/oauth_test_helper.rb +1 -1
  123. data/spec/script/httpsd.rb +6 -6
  124. data/spec/spec_helper.rb +6 -14
  125. data/spec/unit/braintree/address_spec.rb +1 -9
  126. data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
  127. data/spec/unit/braintree/client_token_spec.rb +2 -2
  128. data/spec/unit/braintree/configuration_spec.rb +42 -42
  129. data/spec/unit/braintree/credit_card_spec.rb +9 -28
  130. data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
  131. data/spec/unit/braintree/credit_card_verification_spec.rb +8 -4
  132. data/spec/unit/braintree/customer_spec.rb +5 -16
  133. data/spec/unit/braintree/disbursement_spec.rb +7 -7
  134. data/spec/unit/braintree/dispute_spec.rb +9 -20
  135. data/spec/unit/braintree/error_result_spec.rb +5 -5
  136. data/spec/unit/braintree/errors_spec.rb +8 -8
  137. data/spec/unit/braintree/http_spec.rb +8 -8
  138. data/spec/unit/braintree/merchant_account_spec.rb +1 -1
  139. data/spec/unit/braintree/payment_method_spec.rb +1 -1
  140. data/spec/unit/braintree/paypal_account_spec.rb +2 -2
  141. data/spec/unit/braintree/resource_collection_spec.rb +30 -1
  142. data/spec/unit/braintree/risk_data_spec.rb +9 -5
  143. data/spec/unit/braintree/subscription_search_spec.rb +1 -1
  144. data/spec/unit/braintree/successful_result_spec.rb +1 -1
  145. data/spec/unit/braintree/three_d_secure_info_spec.rb +32 -14
  146. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
  147. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  148. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  149. data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
  150. data/spec/unit/braintree/transaction/paypal_details_spec.rb +3 -1
  151. data/spec/unit/braintree/transaction_search_spec.rb +12 -12
  152. data/spec/unit/braintree/transaction_spec.rb +25 -51
  153. data/spec/unit/braintree/util_spec.rb +55 -21
  154. data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
  155. data/spec/unit/braintree/webhook_notification_spec.rb +73 -57
  156. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  157. data/spec/unit/braintree/xml_spec.rb +31 -31
  158. metadata +30 -31
  159. data/lib/braintree/amex_express_checkout_card.rb +0 -40
  160. data/lib/braintree/coinbase_account.rb +0 -34
  161. data/lib/braintree/europe_bank_account.rb +0 -36
  162. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  163. data/lib/braintree/ideal_payment.rb +0 -61
  164. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  165. data/lib/braintree/masterpass_card.rb +0 -83
  166. data/lib/braintree/settlement_batch.rb +0 -0
  167. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  168. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  169. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  170. data/lib/braintree/transaction/masterpass_card_details.rb +0 -49
  171. data/lib/braintree/transparent_redirect.rb +0 -40
  172. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  173. data/lib/braintree/xml/rexml.rb +0 -71
  174. data/spec/hacks/tcp_socket.rb +0 -18
  175. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  176. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  177. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  178. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  179. data/spec/unit/braintree/xml/rexml_spec.rb +0 -51
@@ -15,7 +15,7 @@ module Braintree
15
15
  class << self
16
16
  protected :new
17
17
  def _new(*args) # :nodoc:
18
- self.new *args
18
+ self.new(*args)
19
19
  end
20
20
  end
21
21
  end
@@ -6,16 +6,18 @@ module Braintree
6
6
  attr_reader :customer_location_zip
7
7
  attr_reader :customer_tenure
8
8
  attr_reader :decision
9
+ attr_reader :decision_reasons
9
10
  attr_reader :device_data_captured
10
11
  attr_reader :fraud_service_provider
11
12
  attr_reader :id
13
+ attr_reader :transaction_risk_score
12
14
 
13
15
  def initialize(attributes)
14
16
  set_instance_variables_from_hash attributes unless attributes.nil?
15
17
  end
16
18
 
17
19
  def inspect
18
- attr_order = [:id, :decision, :device_data_captured, :fraud_service_provider]
20
+ attr_order = [:id, :decision, :decision_reasons, :device_data_captured, :fraud_service_provider, :transaction_risk_score]
19
21
  formatted_attrs = attr_order.map do |attr|
20
22
  "#{attr}: #{send(attr).inspect}"
21
23
  end
@@ -77,7 +77,7 @@ module Braintree
77
77
  end
78
78
 
79
79
  def self._new(*args) # :nodoc:
80
- self.new *args
80
+ self.new(*args)
81
81
  end
82
82
  end
83
83
  end
@@ -1,11 +1,11 @@
1
1
  module Braintree
2
2
  class SettlementBatchSummary
3
3
  include BaseModule
4
-
4
+
5
5
  attr_reader :records
6
6
 
7
7
  def self.generate(settlement_date, group_by_custom_field = nil)
8
- criteria = { :settlement_date => settlement_date }
8
+ criteria = {:settlement_date => settlement_date}
9
9
  criteria.merge!({:group_by_custom_field => group_by_custom_field}) if group_by_custom_field
10
10
  Configuration.gateway.settlement_batch_summary.generate(criteria)
11
11
  end
@@ -11,11 +11,11 @@ module Braintree
11
11
  end
12
12
 
13
13
  module Status
14
- Active = 'Active'
15
- Canceled = 'Canceled'
16
- Expired = 'Expired'
17
- PastDue = 'Past Due'
18
- Pending = 'Pending'
14
+ Active = "Active"
15
+ Canceled = "Canceled"
16
+ Expired = "Expired"
17
+ PastDue = "Past Due"
18
+ Pending = "Pending"
19
19
 
20
20
  All = constants.map { |c| const_get(c) }
21
21
  end
@@ -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?
@@ -115,7 +115,7 @@ module Braintree
115
115
  class << self
116
116
  protected :new
117
117
  def _new(*args) # :nodoc:
118
- self.new *args
118
+ self.new(*args)
119
119
  end
120
120
  end
121
121
  end
@@ -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
@@ -36,6 +36,7 @@ module Braintree
36
36
  Hipercard = "6062820524845321"
37
37
 
38
38
  Visa = "4012888888881881"
39
+ VisaCountryOfIssuanceIE = "4023490000000008"
39
40
  VisaInternational = "4009348888881881" # :nodoc:
40
41
  VisaPrepaid = "4500600000000061"
41
42
 
@@ -12,14 +12,10 @@ 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
- # NEXT_MAJOR_VERSION rename Android Pay to Google Pay
17
- AndroidPayDiscover = "fake-android-pay-discover-nonce"
18
- AndroidPayVisa = "fake-android-pay-visa-nonce"
19
- AndroidPayMasterCard = "fake-android-pay-mastercard-nonce"
20
- AndroidPayAmEx = "fake-android-pay-amex-nonce"
21
- # NEXT_MAJOR_VERSION Remove AmexExpressCheckout test nonces
22
- 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"
23
19
  VenmoAccount = "fake-venmo-account-nonce"
24
20
  VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
25
21
  ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
@@ -62,14 +58,8 @@ module Braintree
62
58
  ProcessorFailureJCB = "fake-processor-failure-jcb-nonce"
63
59
  LuhnInvalid = "fake-luhn-invalid-nonce"
64
60
  PayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce"
65
- SEPA = "fake-sepa-bank-account-nonce"
66
61
  GatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce"
67
62
  GatewayRejectedRiskThresholds = "fake-gateway-rejected-risk-thresholds-nonce"
68
- # NEXT_MAJOR_VERSION Remove Masterpass test nonces
69
- MasterpassAmEx = "fake-masterpass-amex-nonce"
70
- MasterpassDiscover = "fake-masterpass-discover-nonce"
71
- MasterpassMasterCard = "fake-masterpass-mastercard-nonce"
72
- MasterpassVisa = "fake-masterpass-visa-nonce"
73
63
  VisaCheckoutAmEx = "fake-visa-checkout-amex-nonce"
74
64
  VisaCheckoutDiscover = "fake-visa-checkout-discover-nonce"
75
65
  VisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce"
@@ -78,15 +68,6 @@ module Braintree
78
68
  SamsungPayDiscover = "tokensam_fake_discover"
79
69
  SamsungPayMasterCard = "tokensam_fake_mastercard"
80
70
  SamsungPayVisa = "tokensam_fake_visa"
81
-
82
- def self.const_missing(const_name)
83
- if const_name == :AndroidPay
84
- warn "[DEPRECATED] Braintree::Test::Nonce::AndroidPay is deprecated. Use a card-specific nonce, e.g. Braintree::Test::Nonce::AndroidPayMasterCard"
85
- "fake-android-pay-nonce"
86
- else
87
- super
88
- end
89
- end
90
71
  end
91
72
  end
92
73
  end
@@ -2,16 +2,21 @@ module Braintree
2
2
  class ThreeDSecureInfo # :nodoc:
3
3
  include BaseModule
4
4
 
5
+ attr_reader :acs_transaction_id
6
+ attr_reader :cavv
7
+ attr_reader :ds_transaction_id
8
+ attr_reader :eci_flag
5
9
  attr_reader :enrolled
6
- attr_reader :liability_shifted
7
10
  attr_reader :liability_shift_possible
11
+ attr_reader :liability_shifted
12
+ attr_reader :pares_status
8
13
  attr_reader :status
9
- attr_reader :cavv
10
- attr_reader :xid
11
- attr_reader :eci_flag
12
- attr_reader :three_d_secure_version
13
- attr_reader :ds_transaction_id
14
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
15
20
 
16
21
  alias_method :liability_shifted?, :liability_shifted
17
22
  alias_method :liability_shift_possible?, :liability_shift_possible
@@ -22,16 +27,21 @@ module Braintree
22
27
 
23
28
  def inspect
24
29
  attr_order = [
30
+ :acs_transaction_id,
31
+ :authentication,
32
+ :cavv,
33
+ :ds_transaction_id,
34
+ :eci_flag,
25
35
  :enrolled,
26
- :liability_shifted,
27
36
  :liability_shift_possible,
37
+ :liability_shifted,
38
+ :lookup,
39
+ :pares_status,
28
40
  :status,
29
- :cavv,
30
- :xid,
31
- :eci_flag,
32
- :three_d_secure_version,
33
- :ds_transaction_id,
34
41
  :three_d_secure_authentication_id,
42
+ :three_d_secure_transaction_id,
43
+ :three_d_secure_version,
44
+ :xid
35
45
  ]
36
46
 
37
47
  formatted_attrs = attr_order.map do |attr|
@@ -4,18 +4,18 @@ module Braintree
4
4
  include Braintree::Util::IdEquality
5
5
 
6
6
  module CreatedUsing
7
- FullInformation = 'full_information'
8
- Token = 'token'
9
- Unrecognized = 'unrecognized'
7
+ FullInformation = "full_information"
8
+ Token = "token"
9
+ Unrecognized = "unrecognized"
10
10
  end
11
11
 
12
12
  module EscrowStatus
13
- HoldPending = 'hold_pending'
14
- Held = 'held'
15
- ReleasePending = 'release_pending'
16
- Released = 'released'
17
- Refunded = 'refunded'
18
- Unrecognized = 'unrecognized'
13
+ HoldPending = "hold_pending"
14
+ Held = "held"
15
+ ReleasePending = "release_pending"
16
+ Released = "released"
17
+ Refunded = "refunded"
18
+ Unrecognized = "unrecognized"
19
19
  end
20
20
 
21
21
  module GatewayRejectionReason
@@ -32,20 +32,20 @@ module Braintree
32
32
  end
33
33
 
34
34
  module Status
35
- AuthorizationExpired = 'authorization_expired'
36
- Authorizing = 'authorizing'
37
- Authorized = 'authorized'
38
- GatewayRejected = 'gateway_rejected'
39
- Failed = 'failed'
40
- ProcessorDeclined = 'processor_declined'
41
- Settled = 'settled'
42
- SettlementConfirmed = 'settlement_confirmed'
43
- SettlementDeclined = 'settlement_declined'
44
- SettlementPending = 'settlement_pending'
45
- Settling = 'settling'
46
- SubmittedForSettlement = 'submitted_for_settlement'
47
- Voided = 'voided'
48
- Unrecognized = 'unrecognized'
35
+ AuthorizationExpired = "authorization_expired"
36
+ Authorizing = "authorizing"
37
+ Authorized = "authorized"
38
+ GatewayRejected = "gateway_rejected"
39
+ Failed = "failed"
40
+ ProcessorDeclined = "processor_declined"
41
+ Settled = "settled"
42
+ SettlementConfirmed = "settlement_confirmed"
43
+ SettlementDeclined = "settlement_declined"
44
+ SettlementPending = "settlement_pending"
45
+ Settling = "settling"
46
+ SubmittedForSettlement = "submitted_for_settlement"
47
+ Voided = "voided"
48
+ Unrecognized = "unrecognized"
49
49
 
50
50
  All = constants.map { |c| const_get(c) }
51
51
  end
@@ -90,14 +90,10 @@ module Braintree
90
90
  end
91
91
  end
92
92
 
93
+ attr_reader :acquirer_reference_number
93
94
  attr_reader :add_ons
94
95
  attr_reader :additional_processor_response # The raw response from the processor.
95
- # NEXT_MAJOR_VERSION Remove this class.
96
- # DEPRECATED The American Express Checkout payment method is deprecated.
97
- attr_reader :amex_express_checkout_details
98
96
  attr_reader :amount
99
- # NEXT_MAJOR_VERSION rename Android Pay to Google Pay
100
- attr_reader :android_pay_details
101
97
  attr_reader :apple_pay_details
102
98
  attr_reader :authorization_adjustments
103
99
  attr_reader :authorization_expires_at
@@ -107,7 +103,6 @@ module Braintree
107
103
  attr_reader :avs_street_address_response_code
108
104
  attr_reader :billing_details
109
105
  attr_reader :channel
110
- attr_reader :coinbase_details
111
106
  attr_reader :created_at
112
107
  attr_reader :credit_card_details
113
108
  attr_reader :currency_iso_code
@@ -123,15 +118,12 @@ module Braintree
123
118
  attr_reader :facilitated_details
124
119
  attr_reader :facilitator_details
125
120
  attr_reader :gateway_rejection_reason
121
+ attr_reader :google_pay_details
126
122
  attr_reader :graphql_id
127
123
  attr_reader :id
128
- # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
129
- # DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
130
- attr_reader :ideal_payment_details
124
+ attr_reader :installment_count
125
+ attr_reader :installments
131
126
  attr_reader :local_payment_details
132
- # NEXT_MAJOR_VERSION Remove this class.
133
- # DEPRECATED The Masterpass Card payment method is deprecated.
134
- attr_reader :masterpass_card_details
135
127
  attr_reader :merchant_account_id
136
128
  attr_reader :network_response_code # Response code from the card network
137
129
  attr_reader :network_response_text # Response text from the card network
@@ -153,8 +145,11 @@ module Braintree
153
145
  attr_reader :recurring
154
146
  attr_reader :refund_ids
155
147
  attr_reader :refunded_transaction_id
148
+ attr_reader :refunded_installments
149
+ attr_reader :retrieval_reference_number
156
150
  attr_reader :risk_data
157
151
  attr_reader :samsung_pay_card_details
152
+ attr_reader :sca_exemption_requested
158
153
  attr_reader :service_fee_amount
159
154
  attr_reader :settlement_batch_id
160
155
  attr_reader :shipping_amount
@@ -173,7 +168,14 @@ module Braintree
173
168
  attr_reader :venmo_account_details
174
169
  attr_reader :visa_checkout_card_details
175
170
  attr_reader :voice_referral_number
176
- attr_reader :retrieval_reference_number
171
+
172
+ def self.adjust_authorization(*args)
173
+ Configuration.gateway.transaction.adjust_authorization(*args)
174
+ end
175
+
176
+ def self.adjust_authorization!(*args)
177
+ Configuration.gateway.transaction.adjust_authorization!(*args)
178
+ end
177
179
 
178
180
  def self.create(*args)
179
181
  Configuration.gateway.transaction.create(*args)
@@ -199,18 +201,6 @@ module Braintree
199
201
  Configuration.gateway.transaction.clone_transaction!(*args)
200
202
  end
201
203
 
202
- # Deprecated. Use Braintree::TransparentRedirect.confirm
203
- def self.create_from_transparent_redirect(*args)
204
- warn "[DEPRECATED] Transaction.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
205
- Configuration.gateway.transaction.create_from_transparent_redirect(*args)
206
- end
207
-
208
- # Deprecated. Use Braintree::TransparentRedirect.url
209
- def self.create_transaction_url
210
- warn "[DEPRECATED] Transaction.create_transaction_url is deprecated. Please use TransparentRedirect.url"
211
- Configuration.gateway.transaction.create_transaction_url
212
- end
213
-
214
204
  def self.credit(*args)
215
205
  Configuration.gateway.transaction.credit(*args)
216
206
  end
@@ -313,11 +303,8 @@ module Braintree
313
303
  @paypal_details = PayPalDetails.new(@paypal)
314
304
  @paypal_here_details = PayPalHereDetails.new(@paypal_here)
315
305
  @apple_pay_details = ApplePayDetails.new(@apple_pay)
316
- # NEXT_MAJOR_VERSION rename Android Pay to Google Pay
317
- @android_pay_details = AndroidPayDetails.new(@android_pay_card)
318
- @amex_express_checkout_details = AmexExpressCheckoutDetails.new(@amex_express_checkout_card)
306
+ @google_pay_details = GooglePayDetails.new(@google_pay_card)
319
307
  @venmo_account_details = VenmoAccountDetails.new(@venmo_account)
320
- @coinbase_details = CoinbaseDetails.new(@coinbase_account)
321
308
  disputes.map! { |attrs| Dispute._new(attrs) } if disputes
322
309
  @custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
323
310
  add_ons.map! { |attrs| AddOn._new(attrs) } if add_ons
@@ -328,11 +315,13 @@ module Braintree
328
315
  @facilitator_details = FacilitatorDetails.new(attributes[:facilitator_details]) if attributes[:facilitator_details]
329
316
  @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
330
317
  @us_bank_account_details = UsBankAccountDetails.new(attributes[:us_bank_account]) if attributes[:us_bank_account]
331
- @ideal_payment_details = IdealPaymentDetails.new(attributes[:ideal_payment]) if attributes[:ideal_payment]
332
318
  @visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card])
333
- @masterpass_card_details = MasterpassCardDetails.new(attributes[:masterpass_card])
334
319
  @samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
320
+ @sca_exemption_requested = attributes[:sca_exemption_requested]
335
321
  authorization_adjustments.map! { |attrs| AuthorizationAdjustment._new(attrs) } if authorization_adjustments
322
+
323
+ installments.map! { |attrs| Installment.new(attrs) } if installments
324
+ refunded_installments.map! { |attrs| Installment.new(attrs) } if refunded_installments
336
325
  end
337
326
 
338
327
  def inspect # :nodoc:
@@ -352,18 +341,6 @@ module Braintree
352
341
  @gateway.transaction_line_item.find_all(id)
353
342
  end
354
343
 
355
- # Deprecated. Use Braintree::Transaction.refund
356
- def refund(amount = nil)
357
- warn "[DEPRECATED] refund as an instance method is deprecated. Please use Transaction.refund"
358
- result = @gateway.transaction.refund(id, amount)
359
-
360
- if result.success?
361
- SuccessfulResult.new(:new_transaction => result.transaction)
362
- else
363
- result
364
- end
365
- end
366
-
367
344
  # Returns true if the transaction has been refunded. False otherwise.
368
345
  def refunded?
369
346
  !@refund_id.nil?
@@ -374,27 +351,6 @@ module Braintree
374
351
  @disbursement_details.valid?
375
352
  end
376
353
 
377
- def refund_id
378
- warn "[DEPRECATED] Transaction.refund_id is deprecated. Please use Transaction.refund_ids"
379
- @refund_id
380
- end
381
-
382
- # Deprecated. Use Braintree::Transaction.submit_for_settlement
383
- def submit_for_settlement(amount = nil)
384
- warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
385
- result = @gateway.transaction.submit_for_settlement(id, amount)
386
- if result.success?
387
- copy_instance_variables_from_object result.transaction
388
- end
389
- result
390
- end
391
-
392
- # Deprecated. Use Braintree::Transaction.submit_for_settlement!
393
- def submit_for_settlement!(amount = nil)
394
- warn "[DEPRECATED] submit_for_settlement! as an instance method is deprecated. Please use Transaction.submit_for_settlement!"
395
- return_object_or_raise(:transaction) { submit_for_settlement(amount) }
396
- end
397
-
398
354
  # If this transaction was stored in the vault, or created from vault records,
399
355
  # vault_billing_address will return the associated Braintree::Address. Because the
400
356
  # vault billing address can be updated after the transaction was created, the attributes
@@ -431,22 +387,6 @@ module Braintree
431
387
  @gateway.address.find(customer_details.id, shipping_details.id)
432
388
  end
433
389
 
434
- # Deprecated. Use Braintree::Transaction.void
435
- def void
436
- warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
437
- result = @gateway.transaction.void(id)
438
- if result.success?
439
- copy_instance_variables_from_object result.transaction
440
- end
441
- result
442
- end
443
-
444
- # Deprecated. Use Braintree::Transaction.void!
445
- def void!
446
- warn "[DEPRECATED] void! as an instance method is deprecated. Please use Transaction.void!"
447
- return_object_or_raise(:transaction) { void }
448
- end
449
-
450
390
  def processed_with_network_token?
451
391
  @processed_with_network_token
452
392
  end
@@ -454,7 +394,7 @@ module Braintree
454
394
  class << self
455
395
  protected :new
456
396
  def _new(*args) # :nodoc:
457
- self.new *args
397
+ self.new(*args)
458
398
  end
459
399
  end
460
400