braintree 2.104.1 → 3.0.1

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +6 -3
  4. data/lib/braintree.rb +3 -17
  5. data/lib/braintree/address.rb +0 -22
  6. data/lib/braintree/base_module.rb +6 -0
  7. data/lib/braintree/configuration.rb +1 -1
  8. data/lib/braintree/credit_card.rb +0 -75
  9. data/lib/braintree/credit_card_gateway.rb +3 -32
  10. data/lib/braintree/credit_card_verification.rb +13 -0
  11. data/lib/braintree/customer.rb +3 -74
  12. data/lib/braintree/customer_gateway.rb +0 -23
  13. data/lib/braintree/dispute.rb +1 -7
  14. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  15. data/lib/braintree/dispute_gateway.rb +2 -7
  16. data/lib/braintree/error_codes.rb +139 -170
  17. data/lib/braintree/exceptions.rb +5 -3
  18. data/lib/braintree/gateway.rb +0 -14
  19. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -2
  20. data/lib/braintree/merchant_account_gateway.rb +2 -0
  21. data/lib/braintree/payment_instrument_type.rb +1 -5
  22. data/lib/braintree/payment_method_gateway.rb +4 -9
  23. data/lib/braintree/payment_method_parser.rb +1 -8
  24. data/lib/braintree/subscription.rb +5 -5
  25. data/lib/braintree/successful_result.rb +0 -1
  26. data/lib/braintree/test/nonce.rb +4 -23
  27. data/lib/braintree/transaction.rb +2 -79
  28. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  29. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  30. data/lib/braintree/transaction/subscription_details.rb +2 -0
  31. data/lib/braintree/transaction_gateway.rb +12 -21
  32. data/lib/braintree/transaction_search.rb +0 -1
  33. data/lib/braintree/util.rb +17 -2
  34. data/lib/braintree/version.rb +2 -2
  35. data/lib/braintree/webhook_notification.rb +0 -10
  36. data/lib/braintree/webhook_testing_gateway.rb +0 -43
  37. data/lib/braintree/xml/libxml.rb +1 -0
  38. data/lib/braintree/xml/parser.rb +11 -34
  39. data/spec/integration/braintree/address_spec.rb +2 -89
  40. data/spec/integration/braintree/client_api/spec_helper.rb +0 -26
  41. data/spec/integration/braintree/credit_card_spec.rb +6 -471
  42. data/spec/integration/braintree/customer_spec.rb +22 -362
  43. data/spec/integration/braintree/dispute_search_spec.rb +2 -2
  44. data/spec/integration/braintree/dispute_spec.rb +1 -2
  45. data/spec/integration/braintree/payment_method_spec.rb +77 -120
  46. data/spec/integration/braintree/subscription_spec.rb +11 -16
  47. data/spec/integration/braintree/transaction_search_spec.rb +3 -3
  48. data/spec/integration/braintree/transaction_spec.rb +83 -511
  49. data/spec/integration/spec_helper.rb +1 -4
  50. data/spec/spec_helper.rb +1 -11
  51. data/spec/unit/braintree/address_spec.rb +0 -8
  52. data/spec/unit/braintree/credit_card_spec.rb +1 -20
  53. data/spec/unit/braintree/customer_spec.rb +0 -12
  54. data/spec/unit/braintree/dispute_spec.rb +1 -12
  55. data/spec/unit/braintree/http_spec.rb +3 -3
  56. data/spec/unit/braintree/transaction_spec.rb +1 -35
  57. data/spec/unit/braintree/util_spec.rb +37 -3
  58. data/spec/unit/braintree/webhook_notification_spec.rb +1 -1
  59. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  60. metadata +26 -30
  61. data/lib/braintree/amex_express_checkout_card.rb +0 -40
  62. data/lib/braintree/coinbase_account.rb +0 -34
  63. data/lib/braintree/europe_bank_account.rb +0 -36
  64. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  65. data/lib/braintree/ideal_payment.rb +0 -61
  66. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  67. data/lib/braintree/masterpass_card.rb +0 -83
  68. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  69. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  70. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  71. data/lib/braintree/transaction/masterpass_card_details.rb +0 -49
  72. data/lib/braintree/transparent_redirect.rb +0 -40
  73. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  74. data/lib/braintree/xml/rexml.rb +0 -71
  75. data/spec/hacks/tcp_socket.rb +0 -18
  76. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  77. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  78. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  79. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  80. 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
@@ -100,9 +100,9 @@ module Braintree
100
100
  TokenIsRequired = "91722"
101
101
  TokenIsTooLong = "91720"
102
102
  VenmoSDKPaymentMethodCodeCardTypeIsNotAccepted = "91726"
103
- VerificationNotSupportedOnThisMerchantAccount = "91730"
104
103
  VerificationAccountTypeIsInvalid = "91757"
105
104
  VerificationAccountTypeNotSupported = "91758"
105
+ VerificationNotSupportedOnThisMerchantAccount = "91730"
106
106
 
107
107
  module Options
108
108
  UpdateExistingTokenIsInvalid = "91723"
@@ -112,10 +112,10 @@ module Braintree
112
112
  VerificationAmountFormatIsInvalid = "91740"
113
113
  VerificationAmountIsTooLarge = "91752"
114
114
  VerificationAmountNotSupportedByProcessor = "91741"
115
+ VerificationMerchantAccountCannotBeSubMerchantAccount = "91755"
115
116
  VerificationMerchantAccountIdIsInvalid = "91728"
116
117
  VerificationMerchantAccountIsForbidden = "91743"
117
118
  VerificationMerchantAccountIsSuspended = "91742"
118
- VerificationMerchantAccountCannotBeSubMerchantAccount = "91755"
119
119
  end
120
120
  end
121
121
 
@@ -141,47 +141,46 @@ module Braintree
141
141
  end
142
142
 
143
143
  module Descriptor
144
- NameFormatIsInvalid = "92201"
145
- PhoneFormatIsInvalid = "92202"
146
144
  DynamicDescriptorsDisabled = "92203"
147
145
  InternationalNameFormatIsInvalid = "92204"
148
146
  InternationalPhoneFormatIsInvalid = "92205"
147
+ NameFormatIsInvalid = "92201"
148
+ PhoneFormatIsInvalid = "92202"
149
149
  UrlFormatIsInvalid = "92206"
150
150
  end
151
151
 
152
152
  module Dispute
153
- CanOnlyAddEvidenceToOpenDispute = "95701"
154
- CanOnlyRemoveEvidenceFromOpenDispute = "95702"
155
- CanOnlyAddEvidenceDocumentToDispute = "95703"
156
153
  CanOnlyAcceptOpenDispute = "95704"
157
- CanOnlyFinalizeOpenDispute = "95705"
154
+ CanOnlyAddEvidenceDocumentToDispute = "95703"
155
+ CanOnlyAddEvidenceToOpenDispute = "95701"
158
156
  CanOnlyCreateEvidenceWithValidCategory = "95706"
159
- EvidenceContentDateInvalid = "95707"
160
- EvidenceContentTooLong = "95708"
161
- EvidenceContentARNTooLong = "95709"
162
- EvidenceContentPhoneTooLong = "95710"
163
- EvidenceCategoryTextOnly = "95711"
157
+ CanOnlyFinalizeOpenDispute = "95705"
158
+ CanOnlyRemoveEvidenceFromOpenDispute = "95702"
159
+ DigitalGoodsMissingDownloadDate = "95721"
160
+ DigitalGoodsMissingEvidence = "95720"
164
161
  EvidenceCategoryDocumentOnly = "95712"
165
- EvidenceCategoryNotForReasonCode = "95713"
166
162
  EvidenceCategoryDuplicate = "95714"
163
+ EvidenceCategoryNotForReasonCode = "95713"
164
+ EvidenceCategoryTextOnly = "95711"
165
+ EvidenceContentARNTooLong = "95709"
166
+ EvidenceContentDateInvalid = "95707"
167
167
  EvidenceContentEmailInvalid = "95715"
168
-
169
- DigitalGoodsMissingEvidence = "95720"
170
- DigitalGoodsMissingDownloadDate = "95721"
168
+ EvidenceContentPhoneTooLong = "95710"
169
+ EvidenceContentTooLong = "95708"
171
170
  NonDisputedPriorTransactionEvidenceMissingARN = "95722"
172
171
  NonDisputedPriorTransactionEvidenceMissingDate = "95723"
173
- RecurringTransactionEvidenceMissingDate = "95724"
174
172
  RecurringTransactionEvidenceMissingARN = "95725"
173
+ RecurringTransactionEvidenceMissingDate = "95724"
175
174
  ValidEvidenceRequiredToFinalize = "95726"
176
175
  end
177
176
 
178
177
  module DocumentUpload
179
- KindIsInvalid = "84901"
180
- FileIsTooLarge = "84902"
181
- FileTypeIsInvalid = "84903"
178
+ FileIsEmpty = "84906"
182
179
  FileIsMalformedOrEncrypted = "84904"
180
+ FileIsTooLarge = "84902"
183
181
  FileIsTooLong = "84905"
184
- FileIsEmpty = "84906"
182
+ FileTypeIsInvalid = "84903"
183
+ KindIsInvalid = "84901"
185
184
  end
186
185
 
187
186
  module PayPalAccount
@@ -203,28 +202,6 @@ module Braintree
203
202
  TokenIsInUse = "92906"
204
203
  end
205
204
 
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
205
  module Subscription
229
206
  BillingDayOfMonthCannotBeUpdated = "91918"
230
207
  BillingDayOfMonthIsInvalid = "91914"
@@ -295,7 +272,6 @@ module Braintree
295
272
  module Transaction
296
273
  AmountCannotBeNegative = "81501"
297
274
  AmountDoesNotMatch3DSecureAmount = "91585"
298
- AmountDoesNotMatchIdealPaymentAmount = "915144"
299
275
  AmountFormatIsInvalid = "81503" # Keep for backwards compatibility
300
276
  AmountIsInvalid = "81503" # Keep for backwards compatibility
301
277
  AmountIsRequired = "81502"
@@ -325,11 +301,11 @@ module Braintree
325
301
  CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
326
302
  ChannelIsTooLong = "91550"
327
303
  CreditCardIsRequired = "91508"
304
+ CustomFieldIsInvalid = "91526"
305
+ CustomFieldIsTooLong = "81527"
328
306
  CustomerDefaultPaymentMethodCardTypeIsNotAccepted = "81509"
329
307
  CustomerDoesNotHaveCreditCard = "91511"
330
308
  CustomerIdIsInvalid = "91510"
331
- CustomFieldIsInvalid = "91526"
332
- CustomFieldIsTooLong = "81527"
333
309
  DiscountAmountCannotBeNegative = "915160"
334
310
  DiscountAmountFormatIsInvalid = "915159"
335
311
  DiscountAmountIsTooLarge = "915161"
@@ -337,19 +313,17 @@ module Braintree
337
313
  FailedAuthAdjustmentHardDecline = "95602"
338
314
  FinalAuthSubmitForSettlementForDifferentAmount = "95601"
339
315
  HasAlreadyBeenRefunded = "91512"
340
- IdealPaymentNotComplete = "815141"
341
- IdealPaymentsCannotBeVaulted = "915150"
342
316
  LineItemsExpected = "915158"
343
317
  MerchantAccountDoesNotMatch3DSecureMerchantAccount = "91584"
344
- MerchantAccountDoesNotMatchIdealPaymentMerchantAccount = "915143"
345
318
  MerchantAccountDoesNotSupportMOTO = "91558"
346
319
  MerchantAccountDoesNotSupportRefunds = "91547"
347
320
  MerchantAccountIdDoesNotMatchSubscription = "915180"
348
321
  MerchantAccountIdIsInvalid = "91513"
349
322
  MerchantAccountIsSuspended = "91514"
350
- OrderIdDoesNotMatchIdealPaymentOrderId = "91503"
351
- OrderIdIsRequiredWithIdealPayment = "91502"
352
323
  OrderIdIsTooLong = "91501"
324
+ PayPalAuthExpired = "91579"
325
+ PayPalNotEnabled = "91576"
326
+ PayPalVaultRecordMissingData = "91583"
353
327
  PaymentInstrumentNotSupportedByMerchantAccount = "91577"
354
328
  PaymentInstrumentTypeIsNotAccepted = "915101"
355
329
  PaymentInstrumentWithExternalVaultIsInvalid = "915176"
@@ -364,9 +338,6 @@ module Braintree
364
338
  PaymentMethodNonceUnknown = "91565"
365
339
  PaymentMethodTokenCardTypeIsNotAccepted = "91517"
366
340
  PaymentMethodTokenIsInvalid = "91518"
367
- PayPalAuthExpired = "91579"
368
- PayPalNotEnabled = "91576"
369
- PayPalVaultRecordMissingData = "91583"
370
341
  ProcessorAuthorizationCodeCannotBeSet = "91519"
371
342
  ProcessorAuthorizationCodeIsInvalid = "81520"
372
343
  ProcessorDoesNotSupportAuths = "915104"
@@ -451,37 +422,36 @@ module Braintree
451
422
  IndustryTypeIsInvalid = "93401"
452
423
 
453
424
  module Lodging
454
- EmptyData = "93402"
455
- FolioNumberIsInvalid = "93403"
425
+ AdvancedDepositIndicatorIsInvalid = "93440"
456
426
  CheckInDateIsInvalid = "93404"
457
427
  CheckOutDateIsInvalid = "93405"
458
428
  CheckOutDateMustFollowCheckInDate = "93406"
459
- UnknownDataField = "93407"
460
- RoomRateMustBeGreaterThanZero = "93433"
429
+ EmptyData = "93402"
430
+ FireSafetyIndicatorIsInvalid = "93441"
431
+ FolioNumberIsInvalid = "93403"
432
+ NoShowIndicatorIsInvalid = "93439"
433
+ PropertyPhoneIsInvalid = "93442"
461
434
  RoomRateFormatIsInvalid = "93434"
462
435
  RoomRateIsTooLarge = "93435"
463
- RoomTaxMustBeGreaterThanZero = "93436"
436
+ RoomRateMustBeGreaterThanZero = "93433"
464
437
  RoomTaxFormatIsInvalid = "93437"
465
438
  RoomTaxIsTooLarge = "93438"
466
- NoShowIndicatorIsInvalid = "93439"
467
- AdvancedDepositIndicatorIsInvalid = "93440"
468
- FireSafetyIndicatorIsInvalid = "93441"
469
- PropertyPhoneIsInvalid = "93442"
439
+ RoomTaxMustBeGreaterThanZero = "93436"
440
+ UnknownDataField = "93407"
470
441
  end
471
442
 
472
443
  module TravelCruise
473
- EmptyData = "93408"
474
- UnknownDataField = "93409"
475
- TravelPackageIsInvalid = "93410"
476
444
  DepartureDateIsInvalid = "93411"
445
+ EmptyData = "93408"
477
446
  LodgingCheckInDateIsInvalid = "93412"
478
447
  LodgingCheckOutDateIsInvalid = "93413"
448
+ TravelPackageIsInvalid = "93410"
449
+ UnknownDataField = "93409"
479
450
  end
480
451
 
481
452
  module TravelFlight
482
- EmptyData = "93414"
483
- UnknownDataField = "93415"
484
453
  CustomerCodeIsTooLong = "93416"
454
+ EmptyData = "93414"
485
455
  FareAmountCannotBeNegative = "93417"
486
456
  FareAmountFormatIsInvalid = "93418"
487
457
  FareAmountIsTooLarge = "93419"
@@ -490,14 +460,15 @@ module Braintree
490
460
  FeeAmountIsTooLarge = "93422"
491
461
  IssuedDateFormatIsInvalid = "93423"
492
462
  IssuingCarrierCodeIsTooLong = "93424"
463
+ LegsExpected = "93431"
493
464
  PassengerMiddleInitialIsTooLong = "93425"
494
465
  RestrictedTicketIsRequired = "93426"
495
466
  TaxAmountCannotBeNegative = "93427"
496
467
  TaxAmountFormatIsInvalid = "93428"
497
468
  TaxAmountIsTooLarge = "93429"
498
469
  TicketNumberIsTooLong = "93430"
499
- LegsExpected = "93431"
500
470
  TooManyLegs = "93432"
471
+ UnknownDataField = "93415"
501
472
  end
502
473
 
503
474
  module Leg
@@ -526,30 +497,29 @@ module Braintree
526
497
  end
527
498
 
528
499
  module AdditionalCharge
529
- KindIsInvalid = "96601"
530
- KindMustBeUnique = "96602"
531
- AmountMustBeGreaterThanZero = "96603"
532
500
  AmountFormatIsInvalid = "96604"
533
- AmountIsTooLarge = "96605"
534
501
  AmountIsRequired = "96606"
502
+ AmountIsTooLarge = "96605"
503
+ AmountMustBeGreaterThanZero = "96603"
504
+ KindIsInvalid = "96601"
505
+ KindMustBeUnique = "96602"
535
506
  end
536
507
  end
537
508
 
538
509
  module ExternalVault
539
- StatusIsInvalid = "915175"
540
510
  CardTypeIsInvalid = "915178"
541
- StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
542
511
  PreviousNetworkTransactionIdIsInvalid = "915179"
512
+ StatusIsInvalid = "915175"
513
+ StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
543
514
  end
544
515
  end
545
516
 
546
517
  module TransactionLineItem
547
518
  CommodityCodeIsTooLong = "95801"
548
519
  DescriptionIsTooLong = "95803"
520
+ DiscountAmountCannotBeNegative = "95806"
549
521
  DiscountAmountFormatIsInvalid = "95804"
550
522
  DiscountAmountIsTooLarge = "95805"
551
- DiscountAmountMustBeGreaterThanZero = "95806" # Deprecated as the amount may be zero. Use DiscountAmountCannotBeNegative.
552
- DiscountAmountCannotBeNegative = "95806"
553
523
  KindIsInvalid = "95807"
554
524
  KindIsRequired = "95808"
555
525
  NameIsRequired = "95822"
@@ -558,6 +528,9 @@ module Braintree
558
528
  QuantityFormatIsInvalid = "95810"
559
529
  QuantityIsRequired = "95811"
560
530
  QuantityIsTooLarge = "95812"
531
+ TaxAmountCannotBeNegative = "95829"
532
+ TaxAmountFormatIsInvalid = "95827"
533
+ TaxAmountIsTooLarge = "95828"
561
534
  TotalAmountFormatIsInvalid = "95813"
562
535
  TotalAmountIsRequired = "95814"
563
536
  TotalAmountIsTooLarge = "95815"
@@ -567,13 +540,9 @@ module Braintree
567
540
  UnitAmountIsTooLarge = "95819"
568
541
  UnitAmountMustBeGreaterThanZero = "95820"
569
542
  UnitOfMeasureIsTooLong = "95821"
543
+ UnitTaxAmountCannotBeNegative = "95826"
570
544
  UnitTaxAmountFormatIsInvalid = "95824"
571
545
  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
546
  end
578
547
 
579
548
  module Merchant
@@ -587,96 +556,96 @@ module Braintree
587
556
  CountryNameIsInvalid = "93611"
588
557
  CountryNameIsNotAccepted = "93610"
589
558
  CurrenciesAreInvalid = "93614"
559
+ CurrencyIsInvalid = "93618"
560
+ CurrencyIsRequired = "93617"
590
561
  EmailFormatIsInvalid = "93602"
591
562
  EmailIsRequired = "83601"
592
563
  InconsistentCountry = "93612"
593
- PaymentMethodsAreInvalid = "93613"
594
- PaymentMethodsAreNotAllowed = "93615"
595
564
  MerchantAccountExistsForCurrency = "93616"
596
- CurrencyIsRequired = "93617"
597
- CurrencyIsInvalid = "93618"
598
- NoMerchantAccounts = "93619"
599
565
  MerchantAccountExistsForId = "93620"
600
566
  MerchantAccountNotAuthOnboarded = "93621"
567
+ NoMerchantAccounts = "93619"
568
+ PaymentMethodsAreInvalid = "93613"
569
+ PaymentMethodsAreNotAllowed = "93615"
601
570
  end
602
571
 
603
572
  module MerchantAccount
604
- IdIsTooLong = "82602"
573
+ CannotBeUpdated = "82674"
574
+ Declined = "82626"
575
+ DeclinedFailedKYC = "82623"
576
+ DeclinedMasterCardMatch = "82622"
577
+ DeclinedOFAC = "82621"
578
+ DeclinedSsnInvalid = "82624"
579
+ DeclinedSsnMatchesDeceased = "82625"
580
+ IdCannotBeUpdated = "82675"
605
581
  IdFormatIsInvalid = "82603"
606
582
  IdIsInUse = "82604"
607
583
  IdIsNotAllowed = "82605"
608
- MasterMerchantAccountIdIsRequired = "82606"
584
+ IdIsTooLong = "82602"
585
+ MasterMerchantAccountIdCannotBeUpdated = "82676"
609
586
  MasterMerchantAccountIdIsInvalid = "82607"
587
+ MasterMerchantAccountIdIsRequired = "82606"
610
588
  MasterMerchantAccountMustBeActive = "82608"
611
589
  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
590
 
622
591
  module ApplicantDetails
623
- FirstNameIsRequired = "82609"
624
- LastNameIsRequired = "82611"
625
- DateOfBirthIsRequired = "82612"
626
- RoutingNumberIsRequired = "82613"
592
+ AccountNumberIsInvalid = "82670"
627
593
  AccountNumberIsRequired = "82614"
628
- SsnIsInvalid = "82615"
629
- EmailAddressIsInvalid = "82616"
630
- FirstNameIsInvalid = "82627"
631
- LastNameIsInvalid = "82628"
632
594
  CompanyNameIsInvalid = "82631"
633
- TaxIdIsInvalid = "82632"
634
595
  CompanyNameIsRequiredWithTaxId = "82633"
635
- TaxIdIsRequiredWithCompanyName = "82634"
636
- RoutingNumberIsInvalid = "82635"
637
- DeclinedOFAC = "82621" # Keep for backwards compatibility
638
- DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
596
+ DateOfBirthIsInvalid = "82663"
597
+ DateOfBirthIsRequired = "82612"
598
+ Declined = "82626" # Keep for backwards compatibility
639
599
  DeclinedFailedKYC = "82623" # Keep for backwards compatibility
600
+ DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
601
+ DeclinedOFAC = "82621" # Keep for backwards compatibility
640
602
  DeclinedSsnInvalid = "82624" # Keep for backwards compatibility
641
603
  DeclinedSsnMatchesDeceased = "82625" # Keep for backwards compatibility
642
- Declined = "82626" # Keep for backwards compatibility
643
- PhoneIsInvalid = "82636"
644
- DateOfBirthIsInvalid = "82663"
645
- AccountNumberIsInvalid = "82670"
604
+ EmailAddressIsInvalid = "82616"
646
605
  EmailAddressIsRequired = "82665"
606
+ FirstNameIsInvalid = "82627"
607
+ FirstNameIsRequired = "82609"
608
+ LastNameIsInvalid = "82628"
609
+ LastNameIsRequired = "82611"
610
+ PhoneIsInvalid = "82636"
611
+ RoutingNumberIsInvalid = "82635"
612
+ RoutingNumberIsRequired = "82613"
613
+ SsnIsInvalid = "82615"
614
+ TaxIdIsInvalid = "82632"
615
+ TaxIdIsRequiredWithCompanyName = "82634"
647
616
  TaxIdMustBeBlank = "82673"
648
617
 
649
618
  module Address
650
- StreetAddressIsRequired = "82617"
651
619
  LocalityIsRequired = "82618"
620
+ PostalCodeIsInvalid = "82630"
652
621
  PostalCodeIsRequired = "82619"
622
+ RegionIsInvalid = "82664"
653
623
  RegionIsRequired = "82620"
654
624
  StreetAddressIsInvalid = "82629"
655
- PostalCodeIsInvalid = "82630"
656
- RegionIsInvalid = "82664"
625
+ StreetAddressIsRequired = "82617"
657
626
  end
658
627
  end
659
628
 
660
629
  module Individual
661
- FirstNameIsRequired = "82637"
662
- LastNameIsRequired = "82638"
630
+ DateOfBirthIsInvalid = "82666"
663
631
  DateOfBirthIsRequired = "82639"
664
- SsnIsInvalid = "82642"
665
632
  EmailIsInvalid = "82643"
633
+ EmailIsRequired = "82667"
666
634
  FirstNameIsInvalid = "82644"
635
+ FirstNameIsRequired = "82637"
667
636
  LastNameIsInvalid = "82645"
637
+ LastNameIsRequired = "82638"
668
638
  PhoneIsInvalid = "82656"
669
- DateOfBirthIsInvalid = "82666"
670
- EmailIsRequired = "82667"
639
+ SsnIsInvalid = "82642"
671
640
 
672
641
  module Address
673
- StreetAddressIsRequired = "82657"
674
642
  LocalityIsRequired = "82658"
643
+ PostalCodeIsInvalid = "82662"
675
644
  PostalCodeIsRequired = "82659"
645
+ RegionIsInvalid = "82668"
676
646
  RegionIsRequired = "82660"
677
647
  StreetAddressIsInvalid = "82661"
678
- PostalCodeIsInvalid = "82662"
679
- RegionIsInvalid = "82668"
648
+ StreetAddressIsRequired = "82657"
680
649
  end
681
650
  end
682
651
 
@@ -688,9 +657,9 @@ module Braintree
688
657
  TaxIdIsRequiredWithLegalName = "82648"
689
658
  TaxIdMustBeBlank = "82672"
690
659
  module Address
691
- StreetAddressIsInvalid = "82685"
692
660
  PostalCodeIsInvalid = "82686"
693
661
  RegionIsInvalid = "82684"
662
+ StreetAddressIsInvalid = "82685"
694
663
  end
695
664
  end
696
665
 
@@ -709,32 +678,32 @@ module Braintree
709
678
  end
710
679
 
711
680
  module SettlementBatchSummary
712
- SettlementDateIsRequired = "82301"
713
- SettlementDateIsInvalid = "82302"
714
681
  CustomFieldIsInvalid = "82303"
682
+ SettlementDateIsInvalid = "82302"
683
+ SettlementDateIsRequired = "82301"
715
684
  end
716
685
 
717
686
  module ClientToken
718
687
  CustomerDoesNotExist = "92804"
719
688
  FailOnDuplicatePaymentMethodRequiresCustomerId = "92803"
720
689
  MakeDefaultRequiresCustomerId = "92801"
690
+ MerchantAccountDoesNotExist = "92807"
721
691
  ProxyMerchantDoesNotExist = "92805"
722
- VerifyCardRequiresCustomerId = "92802"
723
692
  UnsupportedVersion = "92806"
724
- MerchantAccountDoesNotExist = "92807"
693
+ VerifyCardRequiresCustomerId = "92802"
725
694
  end
726
695
 
727
696
  module PaymentMethod
728
- PaymentMethodNonceConsumed = "93106"
697
+ CannotForwardPaymentMethodType = "93107"
729
698
  CustomerIdIsInvalid = "93105"
730
699
  CustomerIdIsRequired = "93104"
731
700
  NonceIsInvalid = "93102"
732
701
  NonceIsRequired = "93103"
733
- PaymentMethodParamsAreRequired = "93101"
734
- PaymentMethodNonceUnknown = "93108"
735
- PaymentMethodNonceLocked = "93109"
736
- CannotForwardPaymentMethodType = "93107"
737
702
  PaymentMethodNoLongerSupported = "93117"
703
+ PaymentMethodNonceConsumed = "93106"
704
+ PaymentMethodNonceLocked = "93109"
705
+ PaymentMethodNonceUnknown = "93108"
706
+ PaymentMethodParamsAreRequired = "93101"
738
707
 
739
708
  module Options
740
709
  UsBankAccountVerificationMethodIsInvalid = "93121"
@@ -761,48 +730,48 @@ module Braintree
761
730
 
762
731
  module Verification
763
732
  module Options
733
+ AccountTypeIsInvalid = "942184"
734
+ AccountTypeNotSupported = "942185"
764
735
  AmountCannotBeNegative = "94201"
765
736
  AmountFormatIsInvalid = "94202"
766
737
  AmountIsTooLarge = "94207"
767
738
  AmountNotSupportedByProcessor = "94203"
739
+ MerchantAccountCannotBeSubMerchantAccount = "94208"
768
740
  MerchantAccountIdIsInvalid = "94204"
769
- MerchantAccountIsSuspended = "94205"
770
741
  MerchantAccountIsForbidden = "94206"
771
- MerchantAccountCannotBeSubMerchantAccount = "94208"
772
- AccountTypeIsInvalid = "942184"
773
- AccountTypeNotSupported = "942185"
742
+ MerchantAccountIsSuspended = "94205"
774
743
  end
775
744
 
776
- ThreeDSecureAuthenticationIdIsInvalid = "942196"
745
+ AmountDoesNotMatch3DSecureAmount = "94285"
746
+ MerchantAccountDoesNotSupport3DSecure = "942169"
747
+ MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
748
+ ThreeDSecureAuthenticationFailed = "94271"
777
749
  ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "942198"
778
- ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
750
+ ThreeDSecureAuthenticationIdIsInvalid = "942196"
779
751
  ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "942199"
780
- ThreeDSecureAuthenticationFailed = "94271"
781
752
  ThreeDSecureTokenIsInvalid = "94268"
753
+ ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
782
754
  ThreeDSecureVerificationDataDoesntMatchVerify = "94270"
783
- MerchantAccountDoesNotSupport3DSecure = "942169"
784
- MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
785
- AmountDoesNotMatch3DSecureAmount = "94285"
786
755
 
787
756
  module ThreeDSecurePassThru
788
- EciFlagIsRequired = "942113"
789
- EciFlagIsInvalid = "942114"
790
- CavvIsRequired = "942116"
791
- ThreeDSecureVersionIsRequired = "942117"
792
- ThreeDSecureVersionIsInvalid = "942119"
793
757
  AuthenticationResponseIsInvalid = "942120"
794
- DirectoryResponseIsInvalid = "942121"
795
758
  CavvAlgorithmIsInvalid = "942122"
759
+ CavvIsRequired = "942116"
760
+ DirectoryResponseIsInvalid = "942121"
761
+ EciFlagIsInvalid = "942114"
762
+ EciFlagIsRequired = "942113"
763
+ ThreeDSecureVersionIsInvalid = "942119"
764
+ ThreeDSecureVersionIsRequired = "942117"
796
765
  end
797
766
  end
798
767
 
799
768
  module UsBankAccountVerification
800
- NotConfirmable = "96101"
801
- MustBeMicroTransfersVerification = "96102"
802
769
  AmountsDoNotMatch = "96103"
770
+ InvalidDepositAmounts = "96106"
771
+ MustBeMicroTransfersVerification = "96102"
772
+ NotConfirmable = "96101"
803
773
  TooManyConfirmationAttempts = "96104"
804
774
  UnableToConfirmDepositAmounts = "96105"
805
- InvalidDepositAmounts = "96106"
806
775
  end
807
776
 
808
777
  module RiskData