braintree 2.104.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +6 -3
  4. data/lib/braintree.rb +5 -17
  5. data/lib/braintree/address.rb +0 -22
  6. data/lib/braintree/base_module.rb +6 -0
  7. data/lib/braintree/bin_data.rb +9 -2
  8. data/lib/braintree/configuration.rb +1 -1
  9. data/lib/braintree/credit_card.rb +0 -75
  10. data/lib/braintree/credit_card_gateway.rb +4 -33
  11. data/lib/braintree/credit_card_verification.rb +13 -0
  12. data/lib/braintree/customer.rb +3 -74
  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_gateway.rb +2 -7
  17. data/lib/braintree/error_codes.rb +144 -170
  18. data/lib/braintree/exceptions.rb +5 -3
  19. data/lib/braintree/gateway.rb +0 -14
  20. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -2
  21. data/lib/braintree/local_payment_completed.rb +1 -1
  22. data/lib/braintree/merchant_account_gateway.rb +2 -0
  23. data/lib/braintree/payment_instrument_type.rb +1 -5
  24. data/lib/braintree/payment_method_gateway.rb +5 -10
  25. data/lib/braintree/payment_method_parser.rb +1 -8
  26. data/lib/braintree/resource_collection.rb +8 -3
  27. data/lib/braintree/risk_data.rb +3 -1
  28. data/lib/braintree/subscription.rb +5 -5
  29. data/lib/braintree/successful_result.rb +0 -1
  30. data/lib/braintree/test/credit_card.rb +1 -0
  31. data/lib/braintree/test/nonce.rb +4 -23
  32. data/lib/braintree/three_d_secure_info.rb +22 -12
  33. data/lib/braintree/transaction.rb +12 -80
  34. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  35. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  36. data/lib/braintree/transaction/installment.rb +28 -0
  37. data/lib/braintree/transaction/installment/adjustment.rb +33 -0
  38. data/lib/braintree/transaction/paypal_details.rb +1 -0
  39. data/lib/braintree/transaction/subscription_details.rb +2 -0
  40. data/lib/braintree/transaction_gateway.rb +14 -21
  41. data/lib/braintree/transaction_search.rb +0 -1
  42. data/lib/braintree/util.rb +17 -2
  43. data/lib/braintree/version.rb +2 -2
  44. data/lib/braintree/webhook_notification.rb +0 -10
  45. data/lib/braintree/webhook_testing_gateway.rb +0 -43
  46. data/lib/braintree/xml/libxml.rb +1 -0
  47. data/lib/braintree/xml/parser.rb +11 -34
  48. data/spec/integration/braintree/address_spec.rb +2 -89
  49. data/spec/integration/braintree/client_api/spec_helper.rb +0 -26
  50. data/spec/integration/braintree/credit_card_spec.rb +13 -476
  51. data/spec/integration/braintree/customer_spec.rb +189 -362
  52. data/spec/integration/braintree/dispute_search_spec.rb +3 -3
  53. data/spec/integration/braintree/dispute_spec.rb +1 -2
  54. data/spec/integration/braintree/merchant_spec.rb +2 -2
  55. data/spec/integration/braintree/payment_method_spec.rb +254 -120
  56. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +8 -4
  57. data/spec/integration/braintree/subscription_spec.rb +11 -16
  58. data/spec/integration/braintree/transaction_search_spec.rb +3 -3
  59. data/spec/integration/braintree/transaction_spec.rb +324 -550
  60. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +12 -6
  61. data/spec/integration/spec_helper.rb +8 -5
  62. data/spec/spec_helper.rb +2 -11
  63. data/spec/unit/braintree/address_spec.rb +0 -8
  64. data/spec/unit/braintree/credit_card_spec.rb +3 -22
  65. data/spec/unit/braintree/credit_card_verification_spec.rb +6 -2
  66. data/spec/unit/braintree/customer_spec.rb +2 -13
  67. data/spec/unit/braintree/dispute_spec.rb +1 -12
  68. data/spec/unit/braintree/http_spec.rb +3 -3
  69. data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
  70. data/spec/unit/braintree/resource_collection_spec.rb +29 -0
  71. data/spec/unit/braintree/risk_data_spec.rb +9 -5
  72. data/spec/unit/braintree/three_d_secure_info_spec.rb +32 -14
  73. data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
  74. data/spec/unit/braintree/transaction/paypal_details_spec.rb +2 -0
  75. data/spec/unit/braintree/transaction_spec.rb +1 -35
  76. data/spec/unit/braintree/util_spec.rb +37 -3
  77. data/spec/unit/braintree/webhook_notification_spec.rb +1 -1
  78. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  79. metadata +29 -30
  80. data/lib/braintree/amex_express_checkout_card.rb +0 -40
  81. data/lib/braintree/coinbase_account.rb +0 -34
  82. data/lib/braintree/europe_bank_account.rb +0 -36
  83. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  84. data/lib/braintree/ideal_payment.rb +0 -61
  85. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  86. data/lib/braintree/masterpass_card.rb +0 -83
  87. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  88. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  89. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  90. data/lib/braintree/transaction/masterpass_card_details.rb +0 -49
  91. data/lib/braintree/transparent_redirect.rb +0 -40
  92. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  93. data/lib/braintree/xml/rexml.rb +0 -71
  94. data/spec/hacks/tcp_socket.rb +0 -18
  95. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  96. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  97. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  98. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  99. data/spec/unit/braintree/xml/rexml_spec.rb +0 -51
@@ -22,17 +22,6 @@ module Braintree
22
22
  return_object_or_raise(:customer) { create(*args) }
23
23
  end
24
24
 
25
- # Deprecated
26
- def create_customer_url
27
- "#{@config.base_merchant_url}/customers/all/create_via_transparent_redirect_request"
28
- end
29
-
30
- # Deprecated
31
- def create_from_transparent_redirect(query_string)
32
- params = @gateway.transparent_redirect.parse_and_validate_query_string query_string
33
- _do_create("/customers/all/confirm_transparent_redirect_request", :id => params[:id])
34
- end
35
-
36
25
  def delete(customer_id)
37
26
  @config.http.delete("#{@config.base_merchant_path}/customers/#{customer_id}")
38
27
  SuccessfulResult.new
@@ -71,18 +60,6 @@ module Braintree
71
60
  return_object_or_raise(:customer) { update(*args) }
72
61
  end
73
62
 
74
- # Deprecated
75
- def update_customer_url
76
- warn "[DEPRECATED] Customer.update_customer_url is deprecated. Please use TransparentRedirect.url"
77
- "#{@config.base_merchant_url}/customers/all/update_via_transparent_redirect_request"
78
- end
79
-
80
- # Deprecated
81
- def update_from_transparent_redirect(query_string)
82
- params = @gateway.transparent_redirect.parse_and_validate_query_string(query_string)
83
- _do_update(:post, "/customers/all/confirm_transparent_redirect_request", :id => params[:id])
84
- end
85
-
86
63
  def self._create_signature # :nodoc:
87
64
  credit_card_signature = CreditCardGateway._create_signature - [:customer_id]
88
65
  paypal_account_signature = PayPalAccountGateway._create_nested_signature
@@ -118,14 +118,8 @@ module Braintree
118
118
  @transaction = Transaction.new(transaction)
119
119
 
120
120
  @status_history = status_history.map do |event|
121
- Braintree::Dispute::HistoryEvent.new(event)
121
+ Braintree::Dispute::StatusHistory.new(event)
122
122
  end unless status_history.nil?
123
123
  end
124
-
125
- def forwarded_comments
126
- # NEXT_MAJOR_VERSION delete this method since it never returned anything anyway.
127
- warn "[DEPRECATED] #forwarded_comments is deprecated. Please use #processor_comments"
128
- processor_comments
129
- end
130
124
  end
131
125
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Dispute
3
- class HistoryEvent # :nodoc:
3
+ class StatusHistory # :nodoc:
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :disbursement_date
@@ -10,6 +10,8 @@ module Braintree
10
10
 
11
11
  def initialize(attributes)
12
12
  set_instance_variables_from_hash attributes unless attributes.nil?
13
+ @disbursement_date = Date.parse(disbursement_date) unless disbursement_date.nil?
14
+ @effective_date = Date.parse(effective_date) unless effective_date.nil?
13
15
  end
14
16
  end
15
17
  end
@@ -58,20 +58,15 @@ module Braintree
58
58
  request = content_or_request.is_a?(String) ? { content: content_or_request } : content_or_request
59
59
 
60
60
  raise ArgumentError, "content cannot be blank" if request[:content].nil? || request[:content].to_s.strip == ""
61
- raise ArgumentError, "request can only contain the keys [:content, :category, :sequence_number]" if (request.keys - [:category, :content, :tag, :sequence_number]).any?
61
+ raise ArgumentError, "request can only contain the keys [:content, :category, :sequence_number]" if (request.keys - [:category, :content, :sequence_number]).any?
62
62
  raise ArgumentError, "sequence_number must be an integer" if request[:sequence_number] && request[:sequence_number].to_s.match(/\D/)
63
- raise ArgumentError, "tag must be a string" if request[:tag] && !request[:tag].is_a?(String)
64
63
  raise ArgumentError, "category must be a string" if request[:category] && !request[:category].is_a?(String)
65
64
 
66
- warn "[DEPRECATED] tag as an option is deprecated. Please use category" if request[:tag]
67
-
68
- category = request[:category] || request[:tag]
69
-
70
65
  params_for_http_post = {
71
66
  evidence: {
72
67
  comments: request[:content]
73
68
  }.tap do |evidence_params|
74
- evidence_params[:category] = category if category
69
+ evidence_params[:category] = request[:category] if request[:category]
75
70
  evidence_params[:sequence_number] = request[:sequence_number] if request[:sequence_number]
76
71
  end
77
72
  }
@@ -37,27 +37,27 @@ module Braintree
37
37
 
38
38
  module ApplePay
39
39
  ApplePayCardsAreNotAccepted = "83501"
40
- CustomerIdIsRequiredForVaulting = "83502"
41
- TokenIsInUse = "93503"
42
- PaymentMethodNonceConsumed = "93504"
43
- PaymentMethodNonceUnknown = "93505"
44
- PaymentMethodNonceLocked = "93506"
45
- PaymentMethodNonceCardTypeIsNotAccepted = "83518"
46
40
  CannotUpdateApplePayCardUsingPaymentMethodNonce = "93507"
47
- NumberIsRequired = "93508"
48
- ExpirationMonthIsRequired = "93509"
49
- ExpirationYearIsRequired = "93510"
41
+ CertificateInvalid = "93517"
42
+ CertificateMismatch = "93519"
50
43
  CryptogramIsRequired = "93511"
44
+ CustomerIdIsRequiredForVaulting = "83502"
51
45
  DecryptionFailed = "83512"
52
46
  Disabled = "93513"
53
- MerchantNotConfigured = "93514"
47
+ ExpirationMonthIsRequired = "93509"
48
+ ExpirationYearIsRequired = "93510"
49
+ InvalidToken = "83520"
50
+ KeyMismatchStoringCertificate = "93522"
54
51
  MerchantKeysAlreadyConfigured = "93515"
55
52
  MerchantKeysNotConfigured = "93516"
56
- CertificateInvalid = "93517"
57
- CertificateMismatch = "93519"
58
- InvalidToken = "83520"
53
+ MerchantNotConfigured = "93514"
54
+ NumberIsRequired = "93508"
55
+ PaymentMethodNonceCardTypeIsNotAccepted = "83518"
56
+ PaymentMethodNonceConsumed = "93504"
57
+ PaymentMethodNonceLocked = "93506"
58
+ PaymentMethodNonceUnknown = "93505"
59
59
  PrivateKeyMismatch = "93521"
60
- KeyMismatchStoringCertificate = "93522"
60
+ TokenIsInUse = "93503"
61
61
  end
62
62
 
63
63
  module CreditCard
@@ -68,6 +68,7 @@ module Braintree
68
68
  CardholderNameIsTooLong = "81723"
69
69
  CreditCardTypeIsNotAccepted = "81703"
70
70
  CreditCardTypeIsNotAcceptedBySubscriptionMerchantAccount = "81718"
71
+ CurrencyCodeNotSupportedByMerchantAccount = "91760"
71
72
  CustomerIdIsInvalid = "91705"
72
73
  CustomerIdIsRequired = "91704"
73
74
  CvvIsInvalid = "81707"
@@ -100,9 +101,9 @@ module Braintree
100
101
  TokenIsRequired = "91722"
101
102
  TokenIsTooLong = "91720"
102
103
  VenmoSDKPaymentMethodCodeCardTypeIsNotAccepted = "91726"
103
- VerificationNotSupportedOnThisMerchantAccount = "91730"
104
104
  VerificationAccountTypeIsInvalid = "91757"
105
105
  VerificationAccountTypeNotSupported = "91758"
106
+ VerificationNotSupportedOnThisMerchantAccount = "91730"
106
107
 
107
108
  module Options
108
109
  UpdateExistingTokenIsInvalid = "91723"
@@ -112,10 +113,10 @@ module Braintree
112
113
  VerificationAmountFormatIsInvalid = "91740"
113
114
  VerificationAmountIsTooLarge = "91752"
114
115
  VerificationAmountNotSupportedByProcessor = "91741"
116
+ VerificationMerchantAccountCannotBeSubMerchantAccount = "91755"
115
117
  VerificationMerchantAccountIdIsInvalid = "91728"
116
118
  VerificationMerchantAccountIsForbidden = "91743"
117
119
  VerificationMerchantAccountIsSuspended = "91742"
118
- VerificationMerchantAccountCannotBeSubMerchantAccount = "91755"
119
120
  end
120
121
  end
121
122
 
@@ -141,47 +142,46 @@ module Braintree
141
142
  end
142
143
 
143
144
  module Descriptor
144
- NameFormatIsInvalid = "92201"
145
- PhoneFormatIsInvalid = "92202"
146
145
  DynamicDescriptorsDisabled = "92203"
147
146
  InternationalNameFormatIsInvalid = "92204"
148
147
  InternationalPhoneFormatIsInvalid = "92205"
148
+ NameFormatIsInvalid = "92201"
149
+ PhoneFormatIsInvalid = "92202"
149
150
  UrlFormatIsInvalid = "92206"
150
151
  end
151
152
 
152
153
  module Dispute
153
- CanOnlyAddEvidenceToOpenDispute = "95701"
154
- CanOnlyRemoveEvidenceFromOpenDispute = "95702"
155
- CanOnlyAddEvidenceDocumentToDispute = "95703"
156
154
  CanOnlyAcceptOpenDispute = "95704"
157
- CanOnlyFinalizeOpenDispute = "95705"
155
+ CanOnlyAddEvidenceDocumentToDispute = "95703"
156
+ CanOnlyAddEvidenceToOpenDispute = "95701"
158
157
  CanOnlyCreateEvidenceWithValidCategory = "95706"
159
- EvidenceContentDateInvalid = "95707"
160
- EvidenceContentTooLong = "95708"
161
- EvidenceContentARNTooLong = "95709"
162
- EvidenceContentPhoneTooLong = "95710"
163
- EvidenceCategoryTextOnly = "95711"
158
+ CanOnlyFinalizeOpenDispute = "95705"
159
+ CanOnlyRemoveEvidenceFromOpenDispute = "95702"
160
+ DigitalGoodsMissingDownloadDate = "95721"
161
+ DigitalGoodsMissingEvidence = "95720"
164
162
  EvidenceCategoryDocumentOnly = "95712"
165
- EvidenceCategoryNotForReasonCode = "95713"
166
163
  EvidenceCategoryDuplicate = "95714"
164
+ EvidenceCategoryNotForReasonCode = "95713"
165
+ EvidenceCategoryTextOnly = "95711"
166
+ EvidenceContentARNTooLong = "95709"
167
+ EvidenceContentDateInvalid = "95707"
167
168
  EvidenceContentEmailInvalid = "95715"
168
-
169
- DigitalGoodsMissingEvidence = "95720"
170
- DigitalGoodsMissingDownloadDate = "95721"
169
+ EvidenceContentPhoneTooLong = "95710"
170
+ EvidenceContentTooLong = "95708"
171
171
  NonDisputedPriorTransactionEvidenceMissingARN = "95722"
172
172
  NonDisputedPriorTransactionEvidenceMissingDate = "95723"
173
- RecurringTransactionEvidenceMissingDate = "95724"
174
173
  RecurringTransactionEvidenceMissingARN = "95725"
174
+ RecurringTransactionEvidenceMissingDate = "95724"
175
175
  ValidEvidenceRequiredToFinalize = "95726"
176
176
  end
177
177
 
178
178
  module DocumentUpload
179
- KindIsInvalid = "84901"
180
- FileIsTooLarge = "84902"
181
- FileTypeIsInvalid = "84903"
179
+ FileIsEmpty = "84906"
182
180
  FileIsMalformedOrEncrypted = "84904"
181
+ FileIsTooLarge = "84902"
183
182
  FileIsTooLong = "84905"
184
- FileIsEmpty = "84906"
183
+ FileTypeIsInvalid = "84903"
184
+ KindIsInvalid = "84901"
185
185
  end
186
186
 
187
187
  module PayPalAccount
@@ -203,28 +203,6 @@ module Braintree
203
203
  TokenIsInUse = "92906"
204
204
  end
205
205
 
206
- module EuropeBankAccount
207
- IBANIsRequired = "93001"
208
- BICIsRequired = "93002"
209
- AccountHolderNameIsRequired = "93003"
210
- end
211
-
212
- module SEPAMandate
213
- AccountHolderNameIsRequired = "83301"
214
- BICIsRequired = "83302"
215
- IBANIsRequired = "83303"
216
- TypeIsRequired = "93304"
217
- IBANInvalidCharacter = "83305"
218
- BICInvalidCharacter = "83306"
219
- BICLengthIsInvalid = "83307"
220
- BICUnsupportedCountry = "83308"
221
- IBANUnsupportedCountry = "83309"
222
- IBANInvalidFormat = "83310"
223
- LocaleIsUnsupported = "93311"
224
- BillingAddressIsInvalid = "93312"
225
- TypeIsInvalid = "93313"
226
- end
227
-
228
206
  module Subscription
229
207
  BillingDayOfMonthCannotBeUpdated = "91918"
230
208
  BillingDayOfMonthIsInvalid = "91914"
@@ -295,7 +273,6 @@ module Braintree
295
273
  module Transaction
296
274
  AmountCannotBeNegative = "81501"
297
275
  AmountDoesNotMatch3DSecureAmount = "91585"
298
- AmountDoesNotMatchIdealPaymentAmount = "915144"
299
276
  AmountFormatIsInvalid = "81503" # Keep for backwards compatibility
300
277
  AmountIsInvalid = "81503" # Keep for backwards compatibility
301
278
  AmountIsRequired = "81502"
@@ -325,11 +302,12 @@ module Braintree
325
302
  CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
326
303
  ChannelIsTooLong = "91550"
327
304
  CreditCardIsRequired = "91508"
305
+ CurrencyCodeNotSupportedByMerchantAccount = "915214"
306
+ CustomFieldIsInvalid = "91526"
307
+ CustomFieldIsTooLong = "81527"
328
308
  CustomerDefaultPaymentMethodCardTypeIsNotAccepted = "81509"
329
309
  CustomerDoesNotHaveCreditCard = "91511"
330
310
  CustomerIdIsInvalid = "91510"
331
- CustomFieldIsInvalid = "91526"
332
- CustomFieldIsTooLong = "81527"
333
311
  DiscountAmountCannotBeNegative = "915160"
334
312
  DiscountAmountFormatIsInvalid = "915159"
335
313
  DiscountAmountIsTooLarge = "915161"
@@ -337,19 +315,17 @@ module Braintree
337
315
  FailedAuthAdjustmentHardDecline = "95602"
338
316
  FinalAuthSubmitForSettlementForDifferentAmount = "95601"
339
317
  HasAlreadyBeenRefunded = "91512"
340
- IdealPaymentNotComplete = "815141"
341
- IdealPaymentsCannotBeVaulted = "915150"
342
318
  LineItemsExpected = "915158"
343
319
  MerchantAccountDoesNotMatch3DSecureMerchantAccount = "91584"
344
- MerchantAccountDoesNotMatchIdealPaymentMerchantAccount = "915143"
345
320
  MerchantAccountDoesNotSupportMOTO = "91558"
346
321
  MerchantAccountDoesNotSupportRefunds = "91547"
347
322
  MerchantAccountIdDoesNotMatchSubscription = "915180"
348
323
  MerchantAccountIdIsInvalid = "91513"
349
324
  MerchantAccountIsSuspended = "91514"
350
- OrderIdDoesNotMatchIdealPaymentOrderId = "91503"
351
- OrderIdIsRequiredWithIdealPayment = "91502"
352
325
  OrderIdIsTooLong = "91501"
326
+ PayPalAuthExpired = "91579"
327
+ PayPalNotEnabled = "91576"
328
+ PayPalVaultRecordMissingData = "91583"
353
329
  PaymentInstrumentNotSupportedByMerchantAccount = "91577"
354
330
  PaymentInstrumentTypeIsNotAccepted = "915101"
355
331
  PaymentInstrumentWithExternalVaultIsInvalid = "915176"
@@ -364,9 +340,6 @@ module Braintree
364
340
  PaymentMethodNonceUnknown = "91565"
365
341
  PaymentMethodTokenCardTypeIsNotAccepted = "91517"
366
342
  PaymentMethodTokenIsInvalid = "91518"
367
- PayPalAuthExpired = "91579"
368
- PayPalNotEnabled = "91576"
369
- PayPalVaultRecordMissingData = "91583"
370
343
  ProcessorAuthorizationCodeCannotBeSet = "91519"
371
344
  ProcessorAuthorizationCodeIsInvalid = "81520"
372
345
  ProcessorDoesNotSupportAuths = "915104"
@@ -383,6 +356,7 @@ module Braintree
383
356
  RefundAmountIsTooLarge = "91521"
384
357
  RefundAuthHardDeclined = "915200"
385
358
  RefundAuthSoftDeclined = "915201"
359
+ ScaExemptionInvalid = "915213"
386
360
  ServiceFeeAmountCannotBeNegative = "91554"
387
361
  ServiceFeeAmountFormatIsInvalid = "91555"
388
362
  ServiceFeeAmountIsTooLarge = "91556"
@@ -451,37 +425,36 @@ module Braintree
451
425
  IndustryTypeIsInvalid = "93401"
452
426
 
453
427
  module Lodging
454
- EmptyData = "93402"
455
- FolioNumberIsInvalid = "93403"
428
+ AdvancedDepositIndicatorIsInvalid = "93440"
456
429
  CheckInDateIsInvalid = "93404"
457
430
  CheckOutDateIsInvalid = "93405"
458
431
  CheckOutDateMustFollowCheckInDate = "93406"
459
- UnknownDataField = "93407"
460
- RoomRateMustBeGreaterThanZero = "93433"
432
+ EmptyData = "93402"
433
+ FireSafetyIndicatorIsInvalid = "93441"
434
+ FolioNumberIsInvalid = "93403"
435
+ NoShowIndicatorIsInvalid = "93439"
436
+ PropertyPhoneIsInvalid = "93442"
461
437
  RoomRateFormatIsInvalid = "93434"
462
438
  RoomRateIsTooLarge = "93435"
463
- RoomTaxMustBeGreaterThanZero = "93436"
439
+ RoomRateMustBeGreaterThanZero = "93433"
464
440
  RoomTaxFormatIsInvalid = "93437"
465
441
  RoomTaxIsTooLarge = "93438"
466
- NoShowIndicatorIsInvalid = "93439"
467
- AdvancedDepositIndicatorIsInvalid = "93440"
468
- FireSafetyIndicatorIsInvalid = "93441"
469
- PropertyPhoneIsInvalid = "93442"
442
+ RoomTaxMustBeGreaterThanZero = "93436"
443
+ UnknownDataField = "93407"
470
444
  end
471
445
 
472
446
  module TravelCruise
473
- EmptyData = "93408"
474
- UnknownDataField = "93409"
475
- TravelPackageIsInvalid = "93410"
476
447
  DepartureDateIsInvalid = "93411"
448
+ EmptyData = "93408"
477
449
  LodgingCheckInDateIsInvalid = "93412"
478
450
  LodgingCheckOutDateIsInvalid = "93413"
451
+ TravelPackageIsInvalid = "93410"
452
+ UnknownDataField = "93409"
479
453
  end
480
454
 
481
455
  module TravelFlight
482
- EmptyData = "93414"
483
- UnknownDataField = "93415"
484
456
  CustomerCodeIsTooLong = "93416"
457
+ EmptyData = "93414"
485
458
  FareAmountCannotBeNegative = "93417"
486
459
  FareAmountFormatIsInvalid = "93418"
487
460
  FareAmountIsTooLarge = "93419"
@@ -490,14 +463,15 @@ module Braintree
490
463
  FeeAmountIsTooLarge = "93422"
491
464
  IssuedDateFormatIsInvalid = "93423"
492
465
  IssuingCarrierCodeIsTooLong = "93424"
466
+ LegsExpected = "93431"
493
467
  PassengerMiddleInitialIsTooLong = "93425"
494
468
  RestrictedTicketIsRequired = "93426"
495
469
  TaxAmountCannotBeNegative = "93427"
496
470
  TaxAmountFormatIsInvalid = "93428"
497
471
  TaxAmountIsTooLarge = "93429"
498
472
  TicketNumberIsTooLong = "93430"
499
- LegsExpected = "93431"
500
473
  TooManyLegs = "93432"
474
+ UnknownDataField = "93415"
501
475
  end
502
476
 
503
477
  module Leg
@@ -526,30 +500,30 @@ module Braintree
526
500
  end
527
501
 
528
502
  module AdditionalCharge
529
- KindIsInvalid = "96601"
530
- KindMustBeUnique = "96602"
531
- AmountMustBeGreaterThanZero = "96603"
532
503
  AmountFormatIsInvalid = "96604"
533
- AmountIsTooLarge = "96605"
534
504
  AmountIsRequired = "96606"
505
+ AmountIsTooLarge = "96605"
506
+ AmountMustBeGreaterThanZero = "96603"
507
+ KindIsInvalid = "96601"
508
+ KindMustBeUnique = "96602"
535
509
  end
536
510
  end
537
511
 
538
512
  module ExternalVault
539
- StatusIsInvalid = "915175"
513
+ # NEXT_MAJOR_VERSION remove this validation error as it is no longer returned by the gateway
540
514
  CardTypeIsInvalid = "915178"
541
- StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
542
515
  PreviousNetworkTransactionIdIsInvalid = "915179"
516
+ StatusIsInvalid = "915175"
517
+ StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
543
518
  end
544
519
  end
545
520
 
546
521
  module TransactionLineItem
547
522
  CommodityCodeIsTooLong = "95801"
548
523
  DescriptionIsTooLong = "95803"
524
+ DiscountAmountCannotBeNegative = "95806"
549
525
  DiscountAmountFormatIsInvalid = "95804"
550
526
  DiscountAmountIsTooLarge = "95805"
551
- DiscountAmountMustBeGreaterThanZero = "95806" # Deprecated as the amount may be zero. Use DiscountAmountCannotBeNegative.
552
- DiscountAmountCannotBeNegative = "95806"
553
527
  KindIsInvalid = "95807"
554
528
  KindIsRequired = "95808"
555
529
  NameIsRequired = "95822"
@@ -558,6 +532,9 @@ module Braintree
558
532
  QuantityFormatIsInvalid = "95810"
559
533
  QuantityIsRequired = "95811"
560
534
  QuantityIsTooLarge = "95812"
535
+ TaxAmountCannotBeNegative = "95829"
536
+ TaxAmountFormatIsInvalid = "95827"
537
+ TaxAmountIsTooLarge = "95828"
561
538
  TotalAmountFormatIsInvalid = "95813"
562
539
  TotalAmountIsRequired = "95814"
563
540
  TotalAmountIsTooLarge = "95815"
@@ -567,13 +544,9 @@ module Braintree
567
544
  UnitAmountIsTooLarge = "95819"
568
545
  UnitAmountMustBeGreaterThanZero = "95820"
569
546
  UnitOfMeasureIsTooLong = "95821"
547
+ UnitTaxAmountCannotBeNegative = "95826"
570
548
  UnitTaxAmountFormatIsInvalid = "95824"
571
549
  UnitTaxAmountIsTooLarge = "95825"
572
- UnitTaxAmountMustBeGreaterThanZero = "95826" # Deprecated as the amount may be zero. Use UnitTaxAmountCannotBeNegative.
573
- UnitTaxAmountCannotBeNegative = "95826"
574
- TaxAmountFormatIsInvalid = "95827"
575
- TaxAmountIsTooLarge = "95828"
576
- TaxAmountCannotBeNegative = "95829"
577
550
  end
578
551
 
579
552
  module Merchant
@@ -587,96 +560,96 @@ module Braintree
587
560
  CountryNameIsInvalid = "93611"
588
561
  CountryNameIsNotAccepted = "93610"
589
562
  CurrenciesAreInvalid = "93614"
563
+ CurrencyIsInvalid = "93618"
564
+ CurrencyIsRequired = "93617"
590
565
  EmailFormatIsInvalid = "93602"
591
566
  EmailIsRequired = "83601"
592
567
  InconsistentCountry = "93612"
593
- PaymentMethodsAreInvalid = "93613"
594
- PaymentMethodsAreNotAllowed = "93615"
595
568
  MerchantAccountExistsForCurrency = "93616"
596
- CurrencyIsRequired = "93617"
597
- CurrencyIsInvalid = "93618"
598
- NoMerchantAccounts = "93619"
599
569
  MerchantAccountExistsForId = "93620"
600
570
  MerchantAccountNotAuthOnboarded = "93621"
571
+ NoMerchantAccounts = "93619"
572
+ PaymentMethodsAreInvalid = "93613"
573
+ PaymentMethodsAreNotAllowed = "93615"
601
574
  end
602
575
 
603
576
  module MerchantAccount
604
- IdIsTooLong = "82602"
577
+ CannotBeUpdated = "82674"
578
+ Declined = "82626"
579
+ DeclinedFailedKYC = "82623"
580
+ DeclinedMasterCardMatch = "82622"
581
+ DeclinedOFAC = "82621"
582
+ DeclinedSsnInvalid = "82624"
583
+ DeclinedSsnMatchesDeceased = "82625"
584
+ IdCannotBeUpdated = "82675"
605
585
  IdFormatIsInvalid = "82603"
606
586
  IdIsInUse = "82604"
607
587
  IdIsNotAllowed = "82605"
608
- MasterMerchantAccountIdIsRequired = "82606"
588
+ IdIsTooLong = "82602"
589
+ MasterMerchantAccountIdCannotBeUpdated = "82676"
609
590
  MasterMerchantAccountIdIsInvalid = "82607"
591
+ MasterMerchantAccountIdIsRequired = "82606"
610
592
  MasterMerchantAccountMustBeActive = "82608"
611
593
  TosAcceptedIsRequired = "82610"
612
- IdCannotBeUpdated = "82675"
613
- MasterMerchantAccountIdCannotBeUpdated = "82676"
614
- CannotBeUpdated = "82674"
615
- DeclinedOFAC = "82621"
616
- DeclinedMasterCardMatch = "82622"
617
- DeclinedFailedKYC = "82623"
618
- DeclinedSsnInvalid = "82624"
619
- DeclinedSsnMatchesDeceased = "82625"
620
- Declined = "82626"
621
594
 
622
595
  module ApplicantDetails
623
- FirstNameIsRequired = "82609"
624
- LastNameIsRequired = "82611"
625
- DateOfBirthIsRequired = "82612"
626
- RoutingNumberIsRequired = "82613"
596
+ AccountNumberIsInvalid = "82670"
627
597
  AccountNumberIsRequired = "82614"
628
- SsnIsInvalid = "82615"
629
- EmailAddressIsInvalid = "82616"
630
- FirstNameIsInvalid = "82627"
631
- LastNameIsInvalid = "82628"
632
598
  CompanyNameIsInvalid = "82631"
633
- TaxIdIsInvalid = "82632"
634
599
  CompanyNameIsRequiredWithTaxId = "82633"
635
- TaxIdIsRequiredWithCompanyName = "82634"
636
- RoutingNumberIsInvalid = "82635"
637
- DeclinedOFAC = "82621" # Keep for backwards compatibility
638
- DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
600
+ DateOfBirthIsInvalid = "82663"
601
+ DateOfBirthIsRequired = "82612"
602
+ Declined = "82626" # Keep for backwards compatibility
639
603
  DeclinedFailedKYC = "82623" # Keep for backwards compatibility
604
+ DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
605
+ DeclinedOFAC = "82621" # Keep for backwards compatibility
640
606
  DeclinedSsnInvalid = "82624" # Keep for backwards compatibility
641
607
  DeclinedSsnMatchesDeceased = "82625" # Keep for backwards compatibility
642
- Declined = "82626" # Keep for backwards compatibility
643
- PhoneIsInvalid = "82636"
644
- DateOfBirthIsInvalid = "82663"
645
- AccountNumberIsInvalid = "82670"
608
+ EmailAddressIsInvalid = "82616"
646
609
  EmailAddressIsRequired = "82665"
610
+ FirstNameIsInvalid = "82627"
611
+ FirstNameIsRequired = "82609"
612
+ LastNameIsInvalid = "82628"
613
+ LastNameIsRequired = "82611"
614
+ PhoneIsInvalid = "82636"
615
+ RoutingNumberIsInvalid = "82635"
616
+ RoutingNumberIsRequired = "82613"
617
+ SsnIsInvalid = "82615"
618
+ TaxIdIsInvalid = "82632"
619
+ TaxIdIsRequiredWithCompanyName = "82634"
647
620
  TaxIdMustBeBlank = "82673"
648
621
 
649
622
  module Address
650
- StreetAddressIsRequired = "82617"
651
623
  LocalityIsRequired = "82618"
624
+ PostalCodeIsInvalid = "82630"
652
625
  PostalCodeIsRequired = "82619"
626
+ RegionIsInvalid = "82664"
653
627
  RegionIsRequired = "82620"
654
628
  StreetAddressIsInvalid = "82629"
655
- PostalCodeIsInvalid = "82630"
656
- RegionIsInvalid = "82664"
629
+ StreetAddressIsRequired = "82617"
657
630
  end
658
631
  end
659
632
 
660
633
  module Individual
661
- FirstNameIsRequired = "82637"
662
- LastNameIsRequired = "82638"
634
+ DateOfBirthIsInvalid = "82666"
663
635
  DateOfBirthIsRequired = "82639"
664
- SsnIsInvalid = "82642"
665
636
  EmailIsInvalid = "82643"
637
+ EmailIsRequired = "82667"
666
638
  FirstNameIsInvalid = "82644"
639
+ FirstNameIsRequired = "82637"
667
640
  LastNameIsInvalid = "82645"
641
+ LastNameIsRequired = "82638"
668
642
  PhoneIsInvalid = "82656"
669
- DateOfBirthIsInvalid = "82666"
670
- EmailIsRequired = "82667"
643
+ SsnIsInvalid = "82642"
671
644
 
672
645
  module Address
673
- StreetAddressIsRequired = "82657"
674
646
  LocalityIsRequired = "82658"
647
+ PostalCodeIsInvalid = "82662"
675
648
  PostalCodeIsRequired = "82659"
649
+ RegionIsInvalid = "82668"
676
650
  RegionIsRequired = "82660"
677
651
  StreetAddressIsInvalid = "82661"
678
- PostalCodeIsInvalid = "82662"
679
- RegionIsInvalid = "82668"
652
+ StreetAddressIsRequired = "82657"
680
653
  end
681
654
  end
682
655
 
@@ -688,9 +661,9 @@ module Braintree
688
661
  TaxIdIsRequiredWithLegalName = "82648"
689
662
  TaxIdMustBeBlank = "82672"
690
663
  module Address
691
- StreetAddressIsInvalid = "82685"
692
664
  PostalCodeIsInvalid = "82686"
693
665
  RegionIsInvalid = "82684"
666
+ StreetAddressIsInvalid = "82685"
694
667
  end
695
668
  end
696
669
 
@@ -709,32 +682,32 @@ module Braintree
709
682
  end
710
683
 
711
684
  module SettlementBatchSummary
712
- SettlementDateIsRequired = "82301"
713
- SettlementDateIsInvalid = "82302"
714
685
  CustomFieldIsInvalid = "82303"
686
+ SettlementDateIsInvalid = "82302"
687
+ SettlementDateIsRequired = "82301"
715
688
  end
716
689
 
717
690
  module ClientToken
718
691
  CustomerDoesNotExist = "92804"
719
692
  FailOnDuplicatePaymentMethodRequiresCustomerId = "92803"
720
693
  MakeDefaultRequiresCustomerId = "92801"
694
+ MerchantAccountDoesNotExist = "92807"
721
695
  ProxyMerchantDoesNotExist = "92805"
722
- VerifyCardRequiresCustomerId = "92802"
723
696
  UnsupportedVersion = "92806"
724
- MerchantAccountDoesNotExist = "92807"
697
+ VerifyCardRequiresCustomerId = "92802"
725
698
  end
726
699
 
727
700
  module PaymentMethod
728
- PaymentMethodNonceConsumed = "93106"
701
+ CannotForwardPaymentMethodType = "93107"
729
702
  CustomerIdIsInvalid = "93105"
730
703
  CustomerIdIsRequired = "93104"
731
704
  NonceIsInvalid = "93102"
732
705
  NonceIsRequired = "93103"
733
- PaymentMethodParamsAreRequired = "93101"
734
- PaymentMethodNonceUnknown = "93108"
735
- PaymentMethodNonceLocked = "93109"
736
- CannotForwardPaymentMethodType = "93107"
737
706
  PaymentMethodNoLongerSupported = "93117"
707
+ PaymentMethodNonceConsumed = "93106"
708
+ PaymentMethodNonceLocked = "93109"
709
+ PaymentMethodNonceUnknown = "93108"
710
+ PaymentMethodParamsAreRequired = "93101"
738
711
 
739
712
  module Options
740
713
  UsBankAccountVerificationMethodIsInvalid = "93121"
@@ -761,51 +734,52 @@ module Braintree
761
734
 
762
735
  module Verification
763
736
  module Options
737
+ AccountTypeIsInvalid = "942184"
738
+ AccountTypeNotSupported = "942185"
764
739
  AmountCannotBeNegative = "94201"
765
740
  AmountFormatIsInvalid = "94202"
766
741
  AmountIsTooLarge = "94207"
767
742
  AmountNotSupportedByProcessor = "94203"
743
+ MerchantAccountCannotBeSubMerchantAccount = "94208"
768
744
  MerchantAccountIdIsInvalid = "94204"
769
- MerchantAccountIsSuspended = "94205"
770
745
  MerchantAccountIsForbidden = "94206"
771
- MerchantAccountCannotBeSubMerchantAccount = "94208"
772
- AccountTypeIsInvalid = "942184"
773
- AccountTypeNotSupported = "942185"
746
+ MerchantAccountIsSuspended = "94205"
774
747
  end
775
748
 
776
- ThreeDSecureAuthenticationIdIsInvalid = "942196"
749
+ AmountDoesNotMatch3DSecureAmount = "94285"
750
+ MerchantAccountDoesNotSupport3DSecure = "942169"
751
+ MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
752
+ ThreeDSecureAuthenticationFailed = "94271"
777
753
  ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "942198"
778
- ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
754
+ ThreeDSecureAuthenticationIdIsInvalid = "942196"
779
755
  ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "942199"
780
- ThreeDSecureAuthenticationFailed = "94271"
781
756
  ThreeDSecureTokenIsInvalid = "94268"
757
+ ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
782
758
  ThreeDSecureVerificationDataDoesntMatchVerify = "94270"
783
- MerchantAccountDoesNotSupport3DSecure = "942169"
784
- MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
785
- AmountDoesNotMatch3DSecureAmount = "94285"
786
759
 
787
760
  module ThreeDSecurePassThru
788
- EciFlagIsRequired = "942113"
789
- EciFlagIsInvalid = "942114"
790
- CavvIsRequired = "942116"
791
- ThreeDSecureVersionIsRequired = "942117"
792
- ThreeDSecureVersionIsInvalid = "942119"
793
761
  AuthenticationResponseIsInvalid = "942120"
794
- DirectoryResponseIsInvalid = "942121"
795
762
  CavvAlgorithmIsInvalid = "942122"
763
+ CavvIsRequired = "942116"
764
+ DirectoryResponseIsInvalid = "942121"
765
+ EciFlagIsInvalid = "942114"
766
+ EciFlagIsRequired = "942113"
767
+ ThreeDSecureVersionIsInvalid = "942119"
768
+ ThreeDSecureVersionIsRequired = "942117"
796
769
  end
797
770
  end
798
771
 
799
772
  module UsBankAccountVerification
800
- NotConfirmable = "96101"
801
- MustBeMicroTransfersVerification = "96102"
802
773
  AmountsDoNotMatch = "96103"
774
+ InvalidDepositAmounts = "96106"
775
+ MustBeMicroTransfersVerification = "96102"
776
+ NotConfirmable = "96101"
803
777
  TooManyConfirmationAttempts = "96104"
804
778
  UnableToConfirmDepositAmounts = "96105"
805
- InvalidDepositAmounts = "96106"
806
779
  end
807
780
 
808
781
  module RiskData
782
+ # NEXT_MAJOR_VERSION Remove CustomerBrowserIsTooLong (this validation is no longer applied)
809
783
  CustomerBrowserIsTooLong = "94701"
810
784
  CustomerDeviceIdIsTooLong = "94702"
811
785
  CustomerLocationZipInvalidCharacters = "94703"