braintree 4.23.0 → 4.34.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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/address_gateway.rb +5 -0
  3. data/lib/braintree/apple_pay_card.rb +6 -0
  4. data/lib/braintree/bank_account_instant_verification_gateway.rb +38 -0
  5. data/lib/braintree/bank_account_instant_verification_jwt.rb +23 -0
  6. data/lib/braintree/bank_account_instant_verification_jwt_request.rb +21 -0
  7. data/lib/braintree/bin_data.rb +8 -2
  8. data/lib/braintree/configuration.rb +1 -1
  9. data/lib/braintree/credit_card.rb +12 -5
  10. data/lib/braintree/credit_card_gateway.rb +1 -0
  11. data/lib/braintree/credit_card_verification_gateway.rb +5 -2
  12. data/lib/braintree/customer_session_gateway.rb +195 -0
  13. data/lib/braintree/dispute.rb +1 -0
  14. data/lib/braintree/error_codes.rb +58 -104
  15. data/lib/braintree/error_result.rb +1 -1
  16. data/lib/braintree/errors.rb +2 -1
  17. data/lib/braintree/gateway.rb +12 -0
  18. data/lib/braintree/google_pay_card.rb +5 -0
  19. data/lib/braintree/graphql/enums/recommendations.rb +9 -0
  20. data/lib/braintree/graphql/enums/recommended_payment_option.rb +10 -0
  21. data/lib/braintree/graphql/inputs/create_customer_session_input.rb +44 -0
  22. data/lib/braintree/graphql/inputs/customer_recommendations_input.rb +40 -0
  23. data/lib/braintree/graphql/inputs/customer_session_input.rb +45 -0
  24. data/lib/braintree/graphql/inputs/monetary_amount_input.rb +28 -0
  25. data/lib/braintree/graphql/inputs/paypal_payee_input.rb +28 -0
  26. data/lib/braintree/graphql/inputs/paypal_purchase_unit_input.rb +31 -0
  27. data/lib/braintree/graphql/inputs/phone_input.rb +34 -0
  28. data/lib/braintree/graphql/inputs/update_customer_session_input.rb +42 -0
  29. data/lib/braintree/graphql/types/customer_recommendations_payload.rb +129 -0
  30. data/lib/braintree/graphql/types/payment_options.rb +35 -0
  31. data/lib/braintree/graphql/types/payment_recommendations.rb +35 -0
  32. data/lib/braintree/graphql/unions/customer_recommendations.rb +47 -0
  33. data/lib/braintree/graphql_client.rb +16 -0
  34. data/lib/braintree/merchant_account.rb +1 -25
  35. data/lib/braintree/merchant_account_gateway.rb +0 -81
  36. data/lib/braintree/meta_checkout_card.rb +11 -6
  37. data/lib/braintree/meta_checkout_token.rb +11 -6
  38. data/lib/braintree/payment_method_gateway.rb +9 -0
  39. data/lib/braintree/paypal_payment_resource.rb +22 -0
  40. data/lib/braintree/paypal_payment_resource_gateway.rb +36 -0
  41. data/lib/braintree/successful_result.rb +3 -0
  42. data/lib/braintree/test/credit_card.rb +5 -0
  43. data/lib/braintree/transaction/apple_pay_details.rb +7 -0
  44. data/lib/braintree/transaction/credit_card_details.rb +22 -10
  45. data/lib/braintree/transaction/google_pay_details.rb +16 -10
  46. data/lib/braintree/transaction/meta_checkout_card_details.rb +11 -2
  47. data/lib/braintree/transaction/meta_checkout_token_details.rb +13 -3
  48. data/lib/braintree/transaction/paypal_details.rb +2 -0
  49. data/lib/braintree/transaction/visa_checkout_card_details.rb +10 -2
  50. data/lib/braintree/transaction.rb +3 -26
  51. data/lib/braintree/transaction_gateway.rb +52 -31
  52. data/lib/braintree/us_bank_account_verification.rb +3 -1
  53. data/lib/braintree/version.rb +1 -1
  54. data/lib/braintree/visa_checkout_card.rb +10 -5
  55. data/lib/braintree/webhook_notification.rb +1 -4
  56. data/lib/braintree/webhook_testing_gateway.rb +16 -33
  57. data/lib/braintree/xml/{libxml.rb → nokogiri.rb} +18 -16
  58. data/lib/braintree/xml/parser.rb +4 -4
  59. data/lib/braintree.rb +21 -4
  60. data/spec/integration/braintree/advanced_search_spec.rb +7 -4
  61. data/spec/integration/braintree/apple_pay_spec.rb +6 -7
  62. data/spec/integration/braintree/bank_account_instant_verification_spec.rb +191 -0
  63. data/spec/integration/braintree/client_api/spec_helper.rb +81 -0
  64. data/spec/integration/braintree/credit_card_spec.rb +115 -1
  65. data/spec/integration/braintree/credit_card_verification_spec.rb +149 -0
  66. data/spec/integration/braintree/customer_session_spec.rb +154 -0
  67. data/spec/integration/braintree/customer_spec.rb +94 -10
  68. data/spec/integration/braintree/disbursement_spec.rb +1 -1
  69. data/spec/integration/braintree/dispute_spec.rb +13 -2
  70. data/spec/integration/braintree/merchant_account_spec.rb +19 -359
  71. data/spec/integration/braintree/merchant_spec.rb +4 -4
  72. data/spec/integration/braintree/payment_method_nonce_spec.rb +55 -0
  73. data/spec/integration/braintree/payment_method_spec.rb +57 -7
  74. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +0 -3
  75. data/spec/integration/braintree/paypal_payment_resource_spec.rb +141 -0
  76. data/spec/integration/braintree/transaction_payment_facilitator_spec.rb +119 -0
  77. data/spec/integration/braintree/transaction_search_spec.rb +38 -33
  78. data/spec/integration/braintree/transaction_spec.rb +266 -350
  79. data/spec/integration/braintree/transaction_transfer_type_spec.rb +325 -0
  80. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +0 -1
  81. data/spec/integration/braintree/us_bank_account_spec.rb +0 -3
  82. data/spec/integration/braintree/us_bank_account_verification_spec.rb +1 -1
  83. data/spec/spec_helper.rb +46 -12
  84. data/spec/unit/braintree/apple_pay_card_spec.rb +7 -0
  85. data/spec/unit/braintree/bank_account_instant_verification_gateway_spec.rb +98 -0
  86. data/spec/unit/braintree/bank_account_instant_verification_jwt_request_spec.rb +71 -0
  87. data/spec/unit/braintree/client_token_spec.rb +11 -0
  88. data/spec/unit/braintree/configuration_spec.rb +1 -1
  89. data/spec/unit/braintree/credit_card_spec.rb +27 -2
  90. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +1 -0
  91. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -0
  92. data/spec/unit/braintree/customer_session_gateway_spec.rb +122 -0
  93. data/spec/unit/braintree/customer_spec.rb +2 -1
  94. data/spec/unit/braintree/dispute_spec.rb +6 -0
  95. data/spec/unit/braintree/error_result_spec.rb +28 -0
  96. data/spec/unit/braintree/google_pay_card_spec.rb +28 -0
  97. data/spec/unit/braintree/graphql/create_customer_session_input_spec.rb +102 -0
  98. data/spec/unit/braintree/graphql/customer_recommendations_input_spec.rb +80 -0
  99. data/spec/unit/braintree/graphql/customer_recommendations_spec.rb +40 -0
  100. data/spec/unit/braintree/graphql/customer_session_input_spec.rb +81 -0
  101. data/spec/unit/braintree/graphql/phone_input_spec.rb +51 -0
  102. data/spec/unit/braintree/graphql/update_customer_session_input_spec.rb +107 -0
  103. data/spec/unit/braintree/graphql_client_spec.rb +37 -0
  104. data/spec/unit/braintree/meta_checkout_card_spec.rb +61 -51
  105. data/spec/unit/braintree/meta_checkout_token_spec.rb +7 -1
  106. data/spec/unit/braintree/payment_method_nonce_spec.rb +11 -1
  107. data/spec/unit/braintree/payment_method_spec.rb +12 -0
  108. data/spec/unit/braintree/paypal_payment_resource_spec.rb +125 -0
  109. data/spec/unit/braintree/transaction/apple_pay_details_spec.rb +37 -0
  110. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +15 -1
  111. data/spec/unit/braintree/transaction/google_pay_details_spec.rb +37 -0
  112. data/spec/unit/braintree/transaction/meta_checkout_card_details_spec.rb +28 -0
  113. data/spec/unit/braintree/transaction/meta_checkout_token_details_spec.rb +28 -0
  114. data/spec/unit/braintree/transaction/paypal_details_spec.rb +5 -0
  115. data/spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb +28 -0
  116. data/spec/unit/braintree/transaction_ach_mandate_spec.rb +82 -0
  117. data/spec/unit/braintree/transaction_gateway_spec.rb +58 -11
  118. data/spec/unit/braintree/transaction_spec.rb +66 -0
  119. data/spec/unit/braintree/visa_checkout_card_spec.rb +28 -0
  120. data/spec/unit/braintree/webhook_notification_spec.rb +15 -51
  121. data/spec/unit/braintree/xml/{libxml_spec.rb → nokogiri_spec.rb} +7 -7
  122. data/spec/unit/braintree/xml/parser_spec.rb +57 -0
  123. data/spec/unit/credit_card_details_spec.rb +28 -0
  124. metadata +49 -10
  125. data/lib/braintree/merchant_account/business_details.rb +0 -17
  126. data/lib/braintree/merchant_account/funding_details.rb +0 -18
  127. data/lib/braintree/merchant_account/individual_details.rb +0 -20
  128. data/lib/ssl/securetrust_ca.crt +0 -44
  129. data/spec/unit/braintree/disbursement_spec.rb +0 -131
  130. data/spec/unit/braintree/merchant_account_spec.rb +0 -33
@@ -5,9 +5,12 @@ module Braintree
5
5
 
6
6
  attr_reader :account_type
7
7
  attr_reader :bin
8
+ attr_reader :business
8
9
  attr_reader :card_type
9
10
  attr_reader :cardholder_name
10
11
  attr_reader :commercial
12
+ attr_reader :consumer
13
+ attr_reader :corporate
11
14
  attr_reader :country_of_issuance
12
15
  attr_reader :customer_location
13
16
  attr_reader :debit
@@ -18,9 +21,12 @@ module Braintree
18
21
  attr_reader :image_url
19
22
  attr_reader :issuing_bank
20
23
  attr_reader :last_4
24
+ attr_reader :payment_account_reference
21
25
  attr_reader :payroll
22
26
  attr_reader :prepaid
27
+ attr_reader :prepaid_reloadable
23
28
  attr_reader :product_id
29
+ attr_reader :purchase
24
30
  attr_reader :token
25
31
  attr_reader :unique_number_identifier
26
32
 
@@ -34,23 +40,29 @@ module Braintree
34
40
 
35
41
  def inspect
36
42
  attr_order = [
37
- :token,
38
43
  :bin,
39
- :last_4,
44
+ :business,
40
45
  :card_type,
41
- :expiration_date,
42
46
  :cardholder_name,
47
+ :commercial,
48
+ :consumer,
49
+ :corporate,
50
+ :country_of_issuance,
43
51
  :customer_location,
44
- :prepaid,
45
- :healthcare,
46
- :durbin_regulated,
47
52
  :debit,
48
- :commercial,
53
+ :durbin_regulated,
54
+ :expiration_date,
55
+ :healthcare,
56
+ :image_url,
57
+ :issuing_bank,
58
+ :last_4,
59
+ :payment_account_reference,
49
60
  :payroll,
61
+ :prepaid,
62
+ :prepaid_reloadable,
50
63
  :product_id,
51
- :country_of_issuance,
52
- :issuing_bank,
53
- :image_url,
64
+ :purchase,
65
+ :token,
54
66
  :unique_number_identifier,
55
67
  ]
56
68
 
@@ -4,28 +4,34 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin
7
+ attr_reader :business
7
8
  attr_reader :card_type
9
+ attr_reader :commercial
10
+ attr_reader :consumer
11
+ attr_reader :corporate
12
+ attr_reader :country_of_issuance
13
+ attr_reader :debit
14
+ attr_reader :durbin_regulated
8
15
  attr_reader :expiration_month
9
16
  attr_reader :expiration_year
17
+ attr_reader :global_id
10
18
  attr_reader :google_transaction_id
19
+ attr_reader :healthcare
11
20
  attr_reader :image_url
21
+ attr_reader :issuing_bank
12
22
  attr_reader :last_4
23
+ attr_reader :payment_account_reference
24
+ attr_reader :payroll
25
+ attr_reader :prepaid
26
+ attr_reader :prepaid_reloadable
27
+ attr_reader :product_id
28
+ attr_reader :purchase
13
29
  attr_reader :source_card_last_4
14
30
  attr_reader :source_card_type
15
31
  attr_reader :source_description
16
32
  attr_reader :token
17
33
  attr_reader :virtual_card_last_4
18
34
  attr_reader :virtual_card_type
19
- attr_reader :prepaid
20
- attr_reader :healthcare
21
- attr_reader :debit
22
- attr_reader :durbin_regulated
23
- attr_reader :commercial
24
- attr_reader :payroll
25
- attr_reader :issuing_bank
26
- attr_reader :country_of_issuance
27
- attr_reader :product_id
28
- attr_reader :global_id
29
35
 
30
36
  def initialize(attributes)
31
37
  set_instance_variables_from_hash attributes unless attributes.nil?
@@ -4,10 +4,13 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin
7
+ attr_reader :business
7
8
  attr_reader :card_type
8
9
  attr_reader :cardholder_name
9
10
  attr_reader :commercial
11
+ attr_reader :consumer
10
12
  attr_reader :container_id
13
+ attr_reader :corporate
11
14
  attr_reader :country_of_issuance
12
15
  attr_reader :created_at
13
16
  attr_reader :customer_location
@@ -22,7 +25,9 @@ module Braintree
22
25
  attr_reader :last_4
23
26
  attr_reader :payroll
24
27
  attr_reader :prepaid
28
+ attr_reader :prepaid_reloadable
25
29
  attr_reader :product_id
30
+ attr_reader :purchase
26
31
  attr_reader :token
27
32
  attr_reader :unique_number_identifier
28
33
  attr_reader :updated_at
@@ -36,8 +41,12 @@ module Braintree
36
41
  end
37
42
 
38
43
  def inspect
39
- attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
40
- :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url, :container_id]
44
+ attr_order = [
45
+ :bin, :business, :card_type, :cardholder_name, :commercial, :consumer, :container_id,
46
+ :corporate, :country_of_issuance, :customer_location, :debit, :durbin_regulated,
47
+ :expiration_date, :healthcare, :image_url, :issuing_bank, :last_4, :payroll,
48
+ :prepaid, :prepaid_reloadable, :product_id, :purchase, :token
49
+ ]
41
50
  formatted_attrs = attr_order.map do |attr|
42
51
  "#{attr}: #{send(attr).inspect}"
43
52
  end
@@ -4,10 +4,13 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin
7
- attr_reader :container_id
7
+ attr_reader :business
8
8
  attr_reader :card_type
9
9
  attr_reader :cardholder_name
10
10
  attr_reader :commercial
11
+ attr_reader :consumer
12
+ attr_reader :container_id
13
+ attr_reader :corporate
11
14
  attr_reader :country_of_issuance
12
15
  attr_reader :created_at
13
16
  attr_reader :cryptogram
@@ -24,7 +27,9 @@ module Braintree
24
27
  attr_reader :last_4
25
28
  attr_reader :payroll
26
29
  attr_reader :prepaid
30
+ attr_reader :prepaid_reloadable
27
31
  attr_reader :product_id
32
+ attr_reader :purchase
28
33
  attr_reader :token
29
34
  attr_reader :unique_number_identifier
30
35
  attr_reader :updated_at
@@ -38,8 +43,13 @@ module Braintree
38
43
  end
39
44
 
40
45
  def inspect
41
- attr_order = [:container_id, :cryptogram, :ecommerce_indicator, :token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
42
- :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :is_network_tokenized, :image_url]
46
+ attr_order = [
47
+ :bin, :business, :card_type, :cardholder_name, :commercial, :consumer, :container_id,
48
+ :corporate, :country_of_issuance, :cryptogram, :customer_location, :debit,
49
+ :durbin_regulated, :ecommerce_indicator, :expiration_date, :healthcare, :image_url,
50
+ :is_network_tokenized, :issuing_bank, :last_4, :payroll, :prepaid, :prepaid_reloadable,
51
+ :product_id, :purchase, :token
52
+ ]
43
53
  formatted_attrs = attr_order.map do |attr|
44
54
  "#{attr}: #{send(attr).inspect}"
45
55
  end
@@ -20,6 +20,8 @@ module Braintree
20
20
  attr_reader :payer_last_name
21
21
  attr_reader :payer_status
22
22
  attr_reader :payment_id
23
+ attr_reader :recipient_email
24
+ attr_reader :recipient_phone
23
25
  attr_reader :refund_from_transaction_fee_amount
24
26
  attr_reader :refund_from_transaction_fee_currency_iso_code
25
27
  attr_reader :refund_id
@@ -4,10 +4,13 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin
7
+ attr_reader :business
7
8
  attr_reader :call_id
8
9
  attr_reader :card_type
9
10
  attr_reader :cardholder_name
10
11
  attr_reader :commercial
12
+ attr_reader :consumer
13
+ attr_reader :corporate
11
14
  attr_reader :country_of_issuance
12
15
  attr_reader :customer_location
13
16
  attr_reader :debit
@@ -20,7 +23,9 @@ module Braintree
20
23
  attr_reader :last_4
21
24
  attr_reader :payroll
22
25
  attr_reader :prepaid
26
+ attr_reader :prepaid_reloadable
23
27
  attr_reader :product_id
28
+ attr_reader :purchase
24
29
  attr_reader :token
25
30
 
26
31
  def initialize(attributes)
@@ -32,8 +37,11 @@ module Braintree
32
37
  end
33
38
 
34
39
  def inspect
35
- attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
36
- :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url, :call_id]
40
+ attr_order = [
41
+ :bin, :business, :call_id, :card_type, :cardholder_name, :commercial, :consumer, :corporate,
42
+ :country_of_issuance, :customer_location, :debit, :durbin_regulated, :expiration_date,
43
+ :healthcare, :image_url, :issuing_bank, :last_4, :payroll, :prepaid, :prepaid_reloadable,
44
+ :product_id, :purchase, :token]
37
45
  formatted_attrs = attr_order.map do |attr|
38
46
  "#{attr}: #{send(attr).inspect}"
39
47
  end
@@ -9,15 +9,6 @@ module Braintree
9
9
  Unrecognized = "unrecognized"
10
10
  end
11
11
 
12
- module EscrowStatus
13
- HoldPending = "hold_pending"
14
- Held = "held"
15
- ReleasePending = "release_pending"
16
- Released = "released"
17
- Refunded = "refunded"
18
- Unrecognized = "unrecognized"
19
- end
20
-
21
12
  module GatewayRejectionReason
22
13
  ApplicationIncomplete = "application_incomplete"
23
14
  AVS = "avs"
@@ -91,6 +82,8 @@ module Braintree
91
82
  end
92
83
  end
93
84
 
85
+ attr_reader :account_funding_transaction
86
+ attr_reader :ach_reject_reason
94
87
  attr_reader :ach_return_code
95
88
  attr_reader :ach_return_responses
96
89
  attr_reader :acquirer_reference_number
@@ -118,7 +111,6 @@ module Braintree
118
111
  attr_reader :discount_amount
119
112
  attr_reader :discounts
120
113
  attr_reader :disputes
121
- attr_reader :escrow_status
122
114
  attr_reader :facilitated_details
123
115
  attr_reader :facilitator_details
124
116
  attr_reader :foreign_retailer
@@ -181,6 +173,7 @@ module Braintree
181
173
  attr_reader :tax_exempt
182
174
  attr_reader :three_d_secure_info
183
175
  attr_reader :type
176
+ attr_reader :upcoming_retry_date
184
177
  attr_reader :updated_at
185
178
  attr_reader :us_bank_account_details
186
179
  attr_reader :venmo_account_details
@@ -235,14 +228,6 @@ module Braintree
235
228
  Configuration.gateway.transaction_line_item.find_all(*args)
236
229
  end
237
230
 
238
- def self.hold_in_escrow(*args)
239
- Configuration.gateway.transaction.hold_in_escrow(*args)
240
- end
241
-
242
- def self.hold_in_escrow!(*args)
243
- Configuration.gateway.transaction.hold_in_escrow!(*args)
244
- end
245
-
246
231
  def self.refund(*args)
247
232
  Configuration.gateway.transaction.refund(*args)
248
233
  end
@@ -263,14 +248,6 @@ module Braintree
263
248
  Configuration.gateway.transaction.search(&block)
264
249
  end
265
250
 
266
- def self.release_from_escrow(*args)
267
- Configuration.gateway.transaction.release_from_escrow(*args)
268
- end
269
-
270
- def self.release_from_escrow!(*args)
271
- Configuration.gateway.transaction.release_from_escrow!(*args)
272
- end
273
-
274
251
  def self.submit_for_settlement(*args)
275
252
  Configuration.gateway.transaction.submit_for_settlement(*args)
276
253
  end
@@ -31,16 +31,6 @@ module Braintree
31
31
  return_object_or_raise(:transaction) { cancel_release(*args) }
32
32
  end
33
33
 
34
- def hold_in_escrow(transaction_id)
35
- raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
36
- response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/hold_in_escrow")
37
- _handle_transaction_response(response)
38
- end
39
-
40
- def hold_in_escrow!(*args)
41
- return_object_or_raise(:transaction) { hold_in_escrow(*args) }
42
- end
43
-
44
34
  def _handle_transaction_response(response)
45
35
  if response[:transaction]
46
36
  SuccessfulResult.new(:transaction => Transaction._new(@gateway, response[:transaction]))
@@ -135,16 +125,6 @@ module Braintree
135
125
  end
136
126
  end
137
127
 
138
- def release_from_escrow(transaction_id)
139
- raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
140
- response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/release_from_escrow")
141
- _handle_transaction_response(response)
142
- end
143
-
144
- def release_from_escrow!(*args)
145
- return_object_or_raise(:transaction) { release_from_escrow(*args) }
146
- end
147
-
148
128
  def submit_for_settlement(transaction_id, amount = nil, options = {})
149
129
  raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
150
130
  Util.verify_keys(TransactionGateway._submit_for_settlement_signature, options)
@@ -216,7 +196,7 @@ module Braintree
216
196
  [
217
197
  :amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
218
198
  :discount_amount, :exchange_rate_quote_id, :foreign_retailer,
219
- :merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token,
199
+ :merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token, :processing_merchant_category_code,
220
200
  :product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
221
201
  :shared_customer_id, :shared_payment_method_nonce, :shared_payment_method_token,
222
202
  :shared_shipping_address_id, :shipping_address_id, :shipping_amount, :shipping_tax_amount,
@@ -254,27 +234,36 @@ module Braintree
254
234
  {:installments => [:count]},
255
235
  {:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]},
256
236
  {:options => [
257
- :hold_in_escrow,
258
- :store_in_vault,
259
- :store_in_vault_on_success,
260
- :submit_for_settlement,
261
237
  :add_billing_address_to_payment_method,
262
- :store_shipping_address_in_vault,
263
- :venmo_sdk_session, # Deprecated
238
+ {:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
239
+ {:credit_card => [:account_type, :process_debit_as_credit]},
240
+ :hold_in_escrow,
264
241
  :payee_id,
265
242
  :payee_email,
243
+ {:paypal => [:custom_field, :description, :payee_id, :payee_email, :recipient_email, {:recipient_phone => [:country_code, :national_number]}, {:supplementary_data => :_any_key_}]},
244
+ {:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]},
266
245
  :skip_advanced_fraud_checking,
267
246
  :skip_avs,
268
247
  :skip_cvv,
269
- {:paypal => [:custom_field, :payee_id, :payee_email, :description, {:supplementary_data => :_any_key_}]},
270
- {:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]},
248
+ :store_in_vault,
249
+ :store_in_vault_on_success,
250
+ :store_shipping_address_in_vault,
251
+ :submit_for_settlement,
271
252
  {:three_d_secure => [:required]},
272
- {:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
273
253
  {:venmo => [:profile_id]},
274
- {:credit_card => [:account_type, :process_debit_as_credit]},
254
+ :venmo_sdk_session, # Deprecated
275
255
  ]
276
256
  },
277
257
  {:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
258
+ {:payment_facilitator => [
259
+ :payment_facilitator_id,
260
+ {:sub_merchant => [:reference_number, :tax_id, :legal_name,
261
+ {:address => [ :street_address, :locality, :region, :country_code_alpha2, :postal_code,
262
+ {:international_phone => [:country_code, :national_number
263
+ ]}
264
+ ]}
265
+ ]}
266
+ ]},
278
267
  {:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
279
268
  {
280
269
  :shipping => AddressGateway._shared_signature + [:shipping_method],
@@ -291,6 +280,38 @@ module Braintree
291
280
  :ds_transaction_id,
292
281
  ]
293
282
  },
283
+ {
284
+ :transfer => [
285
+ :type,
286
+ {
287
+ :sender => [
288
+ :account_reference_number,
289
+ :date_of_birth,
290
+ :first_name,
291
+ :last_name,
292
+ :middle_name,
293
+ :tax_id,
294
+ {:address => AddressGateway._address_attributes}
295
+ ]
296
+ },
297
+ {
298
+ :receiver => [
299
+ :account_reference_number,
300
+ :first_name,
301
+ :last_name,
302
+ :middle_name,
303
+ :tax_id,
304
+ {:address => AddressGateway._address_attributes}
305
+ ]
306
+ },
307
+ ]
308
+ },
309
+ {
310
+ :us_bank_account => [
311
+ :ach_mandate_text,
312
+ :ach_mandate_accepted_at,
313
+ ]
314
+ },
294
315
  ]
295
316
  end
296
317
 
@@ -15,11 +15,12 @@ module Braintree
15
15
 
16
16
  module VerificationMethod
17
17
  IndependentCheck = "independent_check"
18
+ InstantVerificationAccountValidation = "instant_verification_account_validation"
18
19
  NetworkCheck = "network_check"
19
20
  TokenizedCheck = "tokenized_check"
20
21
  MicroTransfers = "micro_transfers"
21
22
 
22
- All = [IndependentCheck, NetworkCheck, TokenizedCheck, MicroTransfers]
23
+ All = [IndependentCheck, InstantVerificationAccountValidation, NetworkCheck, TokenizedCheck, MicroTransfers]
23
24
  end
24
25
 
25
26
  module VerificationAddOns
@@ -42,6 +43,7 @@ module Braintree
42
43
 
43
44
  def initialize(attributes)
44
45
  set_instance_variables_from_hash(attributes)
46
+ @us_bank_account = UsBankAccount._new(nil, attributes[:us_bank_account]) if attributes[:us_bank_account]
45
47
  end
46
48
 
47
49
  def inspect
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 4
4
- Minor = 23
4
+ Minor = 34
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
@@ -5,10 +5,13 @@ module Braintree
5
5
 
6
6
  attr_reader :billing_address
7
7
  attr_reader :bin
8
+ attr_reader :business
8
9
  attr_reader :call_id
9
10
  attr_reader :card_type
10
11
  attr_reader :cardholder_name
11
12
  attr_reader :commercial
13
+ attr_reader :consumer
14
+ attr_reader :corporate
12
15
  attr_reader :country_of_issuance
13
16
  attr_reader :created_at
14
17
  attr_reader :customer_id
@@ -23,7 +26,9 @@ module Braintree
23
26
  attr_reader :last_4
24
27
  attr_reader :payroll
25
28
  attr_reader :prepaid
29
+ attr_reader :prepaid_reloadable
26
30
  attr_reader :product_id
31
+ attr_reader :purchase
27
32
  attr_reader :subscriptions
28
33
  attr_reader :token
29
34
  attr_reader :unique_number_identifier
@@ -75,11 +80,11 @@ module Braintree
75
80
 
76
81
  def self._attributes
77
82
  [
78
- :billing_address, :bin, :card_type, :cardholder_name, :created_at,
79
- :customer_id, :customer_location, :expiration_month, :expiration_year,
80
- :last_4, :token, :updated_at, :prepaid, :payroll, :product_id,
81
- :commercial, :debit, :durbin_regulated, :healthcare,
82
- :country_of_issuance, :issuing_bank, :image_url, :call_id
83
+ :bin, :billing_address, :business, :card_type, :cardholder_name, :commercial,
84
+ :consumer, :container_id, :corporate, :country_of_issuance, :created_at, :customer_id,
85
+ :customer_location, :debit, :durbin_regulated, :expiration_month, :expiration_year,
86
+ :healthcare, :image_url, :issuing_bank, :last_4, :payroll, :prepaid, :prepaid_reloadable,
87
+ :product_id, :purchase, :token, :updated_at
83
88
  ]
84
89
  end
85
90
 
@@ -13,7 +13,6 @@ module Braintree
13
13
  ConnectedMerchantPayPalStatusChanged = "connected_merchant_paypal_status_changed"
14
14
  ConnectedMerchantStatusTransitioned = "connected_merchant_status_transitioned"
15
15
  Disbursement = "disbursement"
16
- DisbursementException = "disbursement_exception"
17
16
 
18
17
  DisputeAccepted = "dispute_accepted"
19
18
  DisputeAutoAccepted = "dispute_auto_accepted"
@@ -57,10 +56,8 @@ module Braintree
57
56
  SubscriptionWentActive = "subscription_went_active"
58
57
  SubscriptionWentPastDue = "subscription_went_past_due"
59
58
 
60
- SubMerchantAccountApproved = "sub_merchant_account_approved"
61
- SubMerchantAccountDeclined = "sub_merchant_account_declined"
62
-
63
59
  TransactionDisbursed = "transaction_disbursed"
60
+ TransactionRetried = "transaction_retried"
64
61
  TransactionReviewed = "transaction_reviewed"
65
62
  TransactionSettlementDeclined = "transaction_settlement_declined"
66
63
  TransactionSettled = "transaction_settled"
@@ -58,20 +58,16 @@ module Braintree
58
58
  _partner_merchant_declined_sample_xml(id)
59
59
  when Braintree::WebhookNotification::Kind::OAuthAccessRevoked
60
60
  _oauth_access_revoked_sample_xml(id)
61
- when Braintree::WebhookNotification::Kind::SubMerchantAccountApproved
62
- _merchant_account_approved_sample_xml(id)
63
- when Braintree::WebhookNotification::Kind::SubMerchantAccountDeclined
64
- _merchant_account_declined_sample_xml(id)
65
61
  when Braintree::WebhookNotification::Kind::TransactionDisbursed
66
62
  _transaction_disbursed_sample_xml(id)
63
+ when Braintree::WebhookNotification::Kind::TransactionRetried
64
+ _transaction_retried_sample_xml(id)
67
65
  when Braintree::WebhookNotification::Kind::TransactionReviewed
68
66
  _transaction_reviewed_sample_xml(id)
69
67
  when Braintree::WebhookNotification::Kind::TransactionSettled
70
68
  _transaction_settled_sample_xml(id)
71
69
  when Braintree::WebhookNotification::Kind::TransactionSettlementDeclined
72
70
  _transaction_settlement_declined_sample_xml(id)
73
- when Braintree::WebhookNotification::Kind::DisbursementException
74
- _disbursement_exception_sample_xml(id)
75
71
  when Braintree::WebhookNotification::Kind::Disbursement
76
72
  _disbursement_sample_xml(id)
77
73
  when Braintree::WebhookNotification::Kind::SubscriptionBillingSkipped
@@ -275,6 +271,20 @@ module Braintree
275
271
  XML
276
272
  end
277
273
 
274
+ def _transaction_retried_sample_xml(id)
275
+
276
+ <<-XML
277
+ <transaction>
278
+ <id>#{id}</id>
279
+ <amount>100</amount>
280
+ <status>submitted_for_settlement</status>
281
+ <type>sale</type>
282
+ <currency-iso-code>USD</currency-iso-code>
283
+ <retried-transaction-id>original_txn_id</retried-transaction-id>
284
+ </transaction>
285
+ XML
286
+ end
287
+
278
288
  def _transaction_reviewed_sample_xml(id)
279
289
 
280
290
  <<-XML
@@ -959,33 +969,7 @@ module Braintree
959
969
  XML
960
970
  end
961
971
 
962
- def _disbursement_exception_sample_xml(id)
963
-
964
- <<-XML
965
- <disbursement>
966
- <id>#{id}</id>
967
- <transaction-ids type="array">
968
- <item>afv56j</item>
969
- <item>kj8hjk</item>
970
- </transaction-ids>
971
- <success type="boolean">false</success>
972
- <retry type="boolean">false</retry>
973
- <merchant-account>
974
- <id>merchant_account_token</id>
975
- <currency-iso-code>USD</currency-iso-code>
976
- <sub-merchant-account type="boolean">false</sub-merchant-account>
977
- <status>active</status>
978
- </merchant-account>
979
- <amount>100.00</amount>
980
- <disbursement-date type="date">2014-02-10</disbursement-date>
981
- <exception-message>bank_rejected</exception-message>
982
- <follow-up-action>update_funding_information</follow-up-action>
983
- </disbursement>
984
- XML
985
- end
986
-
987
972
  def _disbursement_sample_xml(id)
988
-
989
973
  <<-XML
990
974
  <disbursement>
991
975
  <id>#{id}</id>
@@ -1010,7 +994,6 @@ module Braintree
1010
994
  end
1011
995
 
1012
996
  def _account_updater_daily_report_sample_xml(id)
1013
-
1014
997
  <<-XML
1015
998
  <account-updater-daily-report>
1016
999
  <report-date type="date">2016-01-14</report-date>