braintree 2.101.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +6 -3
  4. data/lib/braintree.rb +3 -17
  5. data/lib/braintree/address.rb +0 -22
  6. data/lib/braintree/address_gateway.rb +2 -2
  7. data/lib/braintree/base_module.rb +6 -0
  8. data/lib/braintree/configuration.rb +1 -1
  9. data/lib/braintree/credit_card.rb +5 -76
  10. data/lib/braintree/credit_card_gateway.rb +16 -32
  11. data/lib/braintree/credit_card_verification.rb +14 -0
  12. data/lib/braintree/customer.rb +3 -72
  13. data/lib/braintree/customer_gateway.rb +0 -23
  14. data/lib/braintree/dispute.rb +1 -7
  15. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  16. data/lib/braintree/dispute/transaction.rb +2 -0
  17. data/lib/braintree/dispute_gateway.rb +2 -7
  18. data/lib/braintree/error_codes.rb +162 -157
  19. data/lib/braintree/exceptions.rb +5 -3
  20. data/lib/braintree/gateway.rb +0 -14
  21. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -1
  22. data/lib/braintree/local_payment_completed.rb +1 -1
  23. data/lib/braintree/merchant_account_gateway.rb +2 -0
  24. data/lib/braintree/payment_instrument_type.rb +1 -4
  25. data/lib/braintree/payment_method_gateway.rb +16 -8
  26. data/lib/braintree/payment_method_nonce.rb +2 -0
  27. data/lib/braintree/payment_method_nonce_gateway.rb +13 -2
  28. data/lib/braintree/payment_method_parser.rb +1 -7
  29. data/lib/braintree/risk_data.rb +4 -1
  30. data/lib/braintree/subscription.rb +5 -5
  31. data/lib/braintree/successful_result.rb +0 -1
  32. data/lib/braintree/test/authentication_id.rb +21 -0
  33. data/lib/braintree/test/credit_card.rb +1 -0
  34. data/lib/braintree/test/nonce.rb +19 -20
  35. data/lib/braintree/transaction.rb +8 -72
  36. data/lib/braintree/transaction/address_details.rb +11 -0
  37. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  38. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  39. data/lib/braintree/transaction/paypal_details.rb +2 -0
  40. data/lib/braintree/transaction/subscription_details.rb +2 -0
  41. data/lib/braintree/transaction_gateway.rb +14 -21
  42. data/lib/braintree/transaction_search.rb +0 -1
  43. data/lib/braintree/util.rb +17 -2
  44. data/lib/braintree/version.rb +3 -3
  45. data/lib/braintree/webhook_notification.rb +3 -10
  46. data/lib/braintree/webhook_testing_gateway.rb +243 -43
  47. data/lib/braintree/xml/libxml.rb +1 -0
  48. data/lib/braintree/xml/parser.rb +11 -34
  49. data/spec/integration/braintree/address_spec.rb +2 -89
  50. data/spec/integration/braintree/client_api/spec_helper.rb +100 -67
  51. data/spec/integration/braintree/credit_card_spec.rb +119 -467
  52. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -0
  53. data/spec/integration/braintree/customer_spec.rb +135 -362
  54. data/spec/integration/braintree/dispute_search_spec.rb +2 -2
  55. data/spec/integration/braintree/dispute_spec.rb +1 -2
  56. data/spec/integration/braintree/document_upload_spec.rb +12 -0
  57. data/spec/integration/braintree/merchant_spec.rb +2 -2
  58. data/spec/integration/braintree/payment_method_nonce_spec.rb +77 -0
  59. data/spec/integration/braintree/payment_method_spec.rb +186 -120
  60. data/spec/integration/braintree/paypal_account_spec.rb +1 -1
  61. data/spec/integration/braintree/subscription_spec.rb +11 -16
  62. data/spec/integration/braintree/transaction_search_spec.rb +3 -3
  63. data/spec/integration/braintree/transaction_spec.rb +252 -524
  64. data/spec/integration/spec_helper.rb +1 -4
  65. data/spec/spec_helper.rb +1 -11
  66. data/spec/unit/braintree/address_spec.rb +0 -8
  67. data/spec/unit/braintree/credit_card_spec.rb +50 -23
  68. data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
  69. data/spec/unit/braintree/customer_spec.rb +26 -14
  70. data/spec/unit/braintree/dispute_spec.rb +4 -12
  71. data/spec/unit/braintree/http_spec.rb +3 -3
  72. data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
  73. data/spec/unit/braintree/transaction/paypal_details_spec.rb +57 -0
  74. data/spec/unit/braintree/transaction_spec.rb +17 -37
  75. data/spec/unit/braintree/util_spec.rb +37 -3
  76. data/spec/unit/braintree/webhook_notification_spec.rb +49 -1
  77. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  78. metadata +29 -31
  79. data/lib/braintree/amex_express_checkout_card.rb +0 -38
  80. data/lib/braintree/coinbase_account.rb +0 -34
  81. data/lib/braintree/europe_bank_account.rb +0 -36
  82. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  83. data/lib/braintree/ideal_payment.rb +0 -61
  84. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  85. data/lib/braintree/masterpass_card.rb +0 -81
  86. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  87. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  88. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  89. data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
  90. data/lib/braintree/transparent_redirect.rb +0 -40
  91. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  92. data/lib/braintree/xml/rexml.rb +0 -71
  93. data/spec/hacks/tcp_socket.rb +0 -18
  94. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  95. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  96. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  97. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  98. data/spec/unit/braintree/xml/rexml_spec.rb +0 -51
@@ -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
@@ -4,7 +4,9 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :amount
7
+ attr_reader :created_at
7
8
  attr_reader :id
9
+ attr_reader :installment_count
8
10
  attr_reader :order_id
9
11
  attr_reader :purchase_order_number
10
12
  attr_reader :payment_instrument_subtype
@@ -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,46 +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"
182
+ FileTypeIsInvalid = "84903"
183
+ KindIsInvalid = "84901"
184
184
  end
185
185
 
186
186
  module PayPalAccount
@@ -202,28 +202,6 @@ module Braintree
202
202
  TokenIsInUse = "92906"
203
203
  end
204
204
 
205
- module EuropeBankAccount
206
- IBANIsRequired = "93001"
207
- BICIsRequired = "93002"
208
- AccountHolderNameIsRequired = "93003"
209
- end
210
-
211
- module SEPAMandate
212
- AccountHolderNameIsRequired = "83301"
213
- BICIsRequired = "83302"
214
- IBANIsRequired = "83303"
215
- TypeIsRequired = "93304"
216
- IBANInvalidCharacter = "83305"
217
- BICInvalidCharacter = "83306"
218
- BICLengthIsInvalid = "83307"
219
- BICUnsupportedCountry = "83308"
220
- IBANUnsupportedCountry = "83309"
221
- IBANInvalidFormat = "83310"
222
- LocaleIsUnsupported = "93311"
223
- BillingAddressIsInvalid = "93312"
224
- TypeIsInvalid = "93313"
225
- end
226
-
227
205
  module Subscription
228
206
  BillingDayOfMonthCannotBeUpdated = "91918"
229
207
  BillingDayOfMonthIsInvalid = "91914"
@@ -294,7 +272,6 @@ module Braintree
294
272
  module Transaction
295
273
  AmountCannotBeNegative = "81501"
296
274
  AmountDoesNotMatch3DSecureAmount = "91585"
297
- AmountDoesNotMatchIdealPaymentAmount = "915144"
298
275
  AmountFormatIsInvalid = "81503" # Keep for backwards compatibility
299
276
  AmountIsInvalid = "81503" # Keep for backwards compatibility
300
277
  AmountIsRequired = "81502"
@@ -302,6 +279,7 @@ module Braintree
302
279
  AmountMustBeGreaterThanZero = "81531"
303
280
  AmountNotSupportedByProcessor = "815193"
304
281
  BillingAddressConflict = "91530"
282
+ BillingPhoneNumberIsInvalid = "915206"
305
283
  CannotBeVoided = "91504"
306
284
  CannotCancelRelease = "91562"
307
285
  CannotCloneCredit = "91543"
@@ -323,11 +301,11 @@ module Braintree
323
301
  CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
324
302
  ChannelIsTooLong = "91550"
325
303
  CreditCardIsRequired = "91508"
304
+ CustomFieldIsInvalid = "91526"
305
+ CustomFieldIsTooLong = "81527"
326
306
  CustomerDefaultPaymentMethodCardTypeIsNotAccepted = "81509"
327
307
  CustomerDoesNotHaveCreditCard = "91511"
328
308
  CustomerIdIsInvalid = "91510"
329
- CustomFieldIsInvalid = "91526"
330
- CustomFieldIsTooLong = "81527"
331
309
  DiscountAmountCannotBeNegative = "915160"
332
310
  DiscountAmountFormatIsInvalid = "915159"
333
311
  DiscountAmountIsTooLarge = "915161"
@@ -335,19 +313,17 @@ module Braintree
335
313
  FailedAuthAdjustmentHardDecline = "95602"
336
314
  FinalAuthSubmitForSettlementForDifferentAmount = "95601"
337
315
  HasAlreadyBeenRefunded = "91512"
338
- IdealPaymentNotComplete = "815141"
339
- IdealPaymentsCannotBeVaulted = "915150"
340
316
  LineItemsExpected = "915158"
341
317
  MerchantAccountDoesNotMatch3DSecureMerchantAccount = "91584"
342
- MerchantAccountDoesNotMatchIdealPaymentMerchantAccount = "915143"
343
318
  MerchantAccountDoesNotSupportMOTO = "91558"
344
319
  MerchantAccountDoesNotSupportRefunds = "91547"
345
320
  MerchantAccountIdDoesNotMatchSubscription = "915180"
346
321
  MerchantAccountIdIsInvalid = "91513"
347
322
  MerchantAccountIsSuspended = "91514"
348
- OrderIdDoesNotMatchIdealPaymentOrderId = "91503"
349
- OrderIdIsRequiredWithIdealPayment = "91502"
350
323
  OrderIdIsTooLong = "91501"
324
+ PayPalAuthExpired = "91579"
325
+ PayPalNotEnabled = "91576"
326
+ PayPalVaultRecordMissingData = "91583"
351
327
  PaymentInstrumentNotSupportedByMerchantAccount = "91577"
352
328
  PaymentInstrumentTypeIsNotAccepted = "915101"
353
329
  PaymentInstrumentWithExternalVaultIsInvalid = "915176"
@@ -362,9 +338,6 @@ module Braintree
362
338
  PaymentMethodNonceUnknown = "91565"
363
339
  PaymentMethodTokenCardTypeIsNotAccepted = "91517"
364
340
  PaymentMethodTokenIsInvalid = "91518"
365
- PayPalAuthExpired = "91579"
366
- PayPalNotEnabled = "91576"
367
- PayPalVaultRecordMissingData = "91583"
368
341
  ProcessorAuthorizationCodeCannotBeSet = "91519"
369
342
  ProcessorAuthorizationCodeIsInvalid = "81520"
370
343
  ProcessorDoesNotSupportAuths = "915104"
@@ -375,6 +348,7 @@ module Braintree
375
348
  ProcessorDoesNotSupportUpdatingOrderId = "915107"
376
349
  ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
377
350
  ProcessorDoesNotSupportVoiceAuthorizations = "91545"
351
+ ProductSkuIsInvalid = "915202"
378
352
  PurchaseOrderNumberIsInvalid = "91548"
379
353
  PurchaseOrderNumberIsTooLong = "91537"
380
354
  RefundAmountIsTooLarge = "91521"
@@ -392,6 +366,8 @@ module Braintree
392
366
  ShippingAmountCannotBeNegative = "915163"
393
367
  ShippingAmountFormatIsInvalid = "915162"
394
368
  ShippingAmountIsTooLarge = "915164"
369
+ ShippingMethodIsInvalid = "915203"
370
+ ShippingPhoneNumberIsInvalid = "915204"
395
371
  ShipsFromPostalCodeInvalidCharacters = "915167"
396
372
  ShipsFromPostalCodeIsInvalid = "915166"
397
373
  ShipsFromPostalCodeIsTooLong = "915165"
@@ -446,37 +422,36 @@ module Braintree
446
422
  IndustryTypeIsInvalid = "93401"
447
423
 
448
424
  module Lodging
449
- EmptyData = "93402"
450
- FolioNumberIsInvalid = "93403"
425
+ AdvancedDepositIndicatorIsInvalid = "93440"
451
426
  CheckInDateIsInvalid = "93404"
452
427
  CheckOutDateIsInvalid = "93405"
453
428
  CheckOutDateMustFollowCheckInDate = "93406"
454
- UnknownDataField = "93407"
455
- RoomRateMustBeGreaterThanZero = "93433"
429
+ EmptyData = "93402"
430
+ FireSafetyIndicatorIsInvalid = "93441"
431
+ FolioNumberIsInvalid = "93403"
432
+ NoShowIndicatorIsInvalid = "93439"
433
+ PropertyPhoneIsInvalid = "93442"
456
434
  RoomRateFormatIsInvalid = "93434"
457
435
  RoomRateIsTooLarge = "93435"
458
- RoomTaxMustBeGreaterThanZero = "93436"
436
+ RoomRateMustBeGreaterThanZero = "93433"
459
437
  RoomTaxFormatIsInvalid = "93437"
460
438
  RoomTaxIsTooLarge = "93438"
461
- NoShowIndicatorIsInvalid = "93439"
462
- AdvancedDepositIndicatorIsInvalid = "93440"
463
- FireSafetyIndicatorIsInvalid = "93441"
464
- PropertyPhoneIsInvalid = "93442"
439
+ RoomTaxMustBeGreaterThanZero = "93436"
440
+ UnknownDataField = "93407"
465
441
  end
466
442
 
467
443
  module TravelCruise
468
- EmptyData = "93408"
469
- UnknownDataField = "93409"
470
- TravelPackageIsInvalid = "93410"
471
444
  DepartureDateIsInvalid = "93411"
445
+ EmptyData = "93408"
472
446
  LodgingCheckInDateIsInvalid = "93412"
473
447
  LodgingCheckOutDateIsInvalid = "93413"
448
+ TravelPackageIsInvalid = "93410"
449
+ UnknownDataField = "93409"
474
450
  end
475
451
 
476
452
  module TravelFlight
477
- EmptyData = "93414"
478
- UnknownDataField = "93415"
479
453
  CustomerCodeIsTooLong = "93416"
454
+ EmptyData = "93414"
480
455
  FareAmountCannotBeNegative = "93417"
481
456
  FareAmountFormatIsInvalid = "93418"
482
457
  FareAmountIsTooLarge = "93419"
@@ -485,14 +460,15 @@ module Braintree
485
460
  FeeAmountIsTooLarge = "93422"
486
461
  IssuedDateFormatIsInvalid = "93423"
487
462
  IssuingCarrierCodeIsTooLong = "93424"
463
+ LegsExpected = "93431"
488
464
  PassengerMiddleInitialIsTooLong = "93425"
489
465
  RestrictedTicketIsRequired = "93426"
490
466
  TaxAmountCannotBeNegative = "93427"
491
467
  TaxAmountFormatIsInvalid = "93428"
492
468
  TaxAmountIsTooLarge = "93429"
493
469
  TicketNumberIsTooLong = "93430"
494
- LegsExpected = "93431"
495
470
  TooManyLegs = "93432"
471
+ UnknownDataField = "93415"
496
472
  end
497
473
 
498
474
  module Leg
@@ -521,30 +497,29 @@ module Braintree
521
497
  end
522
498
 
523
499
  module AdditionalCharge
524
- KindIsInvalid = "96601"
525
- KindMustBeUnique = "96602"
526
- AmountMustBeGreaterThanZero = "96603"
527
500
  AmountFormatIsInvalid = "96604"
528
- AmountIsTooLarge = "96605"
529
501
  AmountIsRequired = "96606"
502
+ AmountIsTooLarge = "96605"
503
+ AmountMustBeGreaterThanZero = "96603"
504
+ KindIsInvalid = "96601"
505
+ KindMustBeUnique = "96602"
530
506
  end
531
507
  end
532
508
 
533
509
  module ExternalVault
534
- StatusIsInvalid = "915175"
535
510
  CardTypeIsInvalid = "915178"
536
- StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
537
511
  PreviousNetworkTransactionIdIsInvalid = "915179"
512
+ StatusIsInvalid = "915175"
513
+ StatusWithPreviousNetworkTransactionIdIsInvalid = "915177"
538
514
  end
539
515
  end
540
516
 
541
517
  module TransactionLineItem
542
518
  CommodityCodeIsTooLong = "95801"
543
519
  DescriptionIsTooLong = "95803"
520
+ DiscountAmountCannotBeNegative = "95806"
544
521
  DiscountAmountFormatIsInvalid = "95804"
545
522
  DiscountAmountIsTooLarge = "95805"
546
- DiscountAmountMustBeGreaterThanZero = "95806" # Deprecated as the amount may be zero. Use DiscountAmountCannotBeNegative.
547
- DiscountAmountCannotBeNegative = "95806"
548
523
  KindIsInvalid = "95807"
549
524
  KindIsRequired = "95808"
550
525
  NameIsRequired = "95822"
@@ -553,6 +528,9 @@ module Braintree
553
528
  QuantityFormatIsInvalid = "95810"
554
529
  QuantityIsRequired = "95811"
555
530
  QuantityIsTooLarge = "95812"
531
+ TaxAmountCannotBeNegative = "95829"
532
+ TaxAmountFormatIsInvalid = "95827"
533
+ TaxAmountIsTooLarge = "95828"
556
534
  TotalAmountFormatIsInvalid = "95813"
557
535
  TotalAmountIsRequired = "95814"
558
536
  TotalAmountIsTooLarge = "95815"
@@ -562,13 +540,9 @@ module Braintree
562
540
  UnitAmountIsTooLarge = "95819"
563
541
  UnitAmountMustBeGreaterThanZero = "95820"
564
542
  UnitOfMeasureIsTooLong = "95821"
543
+ UnitTaxAmountCannotBeNegative = "95826"
565
544
  UnitTaxAmountFormatIsInvalid = "95824"
566
545
  UnitTaxAmountIsTooLarge = "95825"
567
- UnitTaxAmountMustBeGreaterThanZero = "95826" # Deprecated as the amount may be zero. Use UnitTaxAmountCannotBeNegative.
568
- UnitTaxAmountCannotBeNegative = "95826"
569
- TaxAmountFormatIsInvalid = "95827"
570
- TaxAmountIsTooLarge = "95828"
571
- TaxAmountCannotBeNegative = "95829"
572
546
  end
573
547
 
574
548
  module Merchant
@@ -582,96 +556,96 @@ module Braintree
582
556
  CountryNameIsInvalid = "93611"
583
557
  CountryNameIsNotAccepted = "93610"
584
558
  CurrenciesAreInvalid = "93614"
559
+ CurrencyIsInvalid = "93618"
560
+ CurrencyIsRequired = "93617"
585
561
  EmailFormatIsInvalid = "93602"
586
562
  EmailIsRequired = "83601"
587
563
  InconsistentCountry = "93612"
588
- PaymentMethodsAreInvalid = "93613"
589
- PaymentMethodsAreNotAllowed = "93615"
590
564
  MerchantAccountExistsForCurrency = "93616"
591
- CurrencyIsRequired = "93617"
592
- CurrencyIsInvalid = "93618"
593
- NoMerchantAccounts = "93619"
594
565
  MerchantAccountExistsForId = "93620"
595
566
  MerchantAccountNotAuthOnboarded = "93621"
567
+ NoMerchantAccounts = "93619"
568
+ PaymentMethodsAreInvalid = "93613"
569
+ PaymentMethodsAreNotAllowed = "93615"
596
570
  end
597
571
 
598
572
  module MerchantAccount
599
- 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"
600
581
  IdFormatIsInvalid = "82603"
601
582
  IdIsInUse = "82604"
602
583
  IdIsNotAllowed = "82605"
603
- MasterMerchantAccountIdIsRequired = "82606"
584
+ IdIsTooLong = "82602"
585
+ MasterMerchantAccountIdCannotBeUpdated = "82676"
604
586
  MasterMerchantAccountIdIsInvalid = "82607"
587
+ MasterMerchantAccountIdIsRequired = "82606"
605
588
  MasterMerchantAccountMustBeActive = "82608"
606
589
  TosAcceptedIsRequired = "82610"
607
- IdCannotBeUpdated = "82675"
608
- MasterMerchantAccountIdCannotBeUpdated = "82676"
609
- CannotBeUpdated = "82674"
610
- DeclinedOFAC = "82621"
611
- DeclinedMasterCardMatch = "82622"
612
- DeclinedFailedKYC = "82623"
613
- DeclinedSsnInvalid = "82624"
614
- DeclinedSsnMatchesDeceased = "82625"
615
- Declined = "82626"
616
590
 
617
591
  module ApplicantDetails
618
- FirstNameIsRequired = "82609"
619
- LastNameIsRequired = "82611"
620
- DateOfBirthIsRequired = "82612"
621
- RoutingNumberIsRequired = "82613"
592
+ AccountNumberIsInvalid = "82670"
622
593
  AccountNumberIsRequired = "82614"
623
- SsnIsInvalid = "82615"
624
- EmailAddressIsInvalid = "82616"
625
- FirstNameIsInvalid = "82627"
626
- LastNameIsInvalid = "82628"
627
594
  CompanyNameIsInvalid = "82631"
628
- TaxIdIsInvalid = "82632"
629
595
  CompanyNameIsRequiredWithTaxId = "82633"
630
- TaxIdIsRequiredWithCompanyName = "82634"
631
- RoutingNumberIsInvalid = "82635"
632
- DeclinedOFAC = "82621" # Keep for backwards compatibility
633
- DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
596
+ DateOfBirthIsInvalid = "82663"
597
+ DateOfBirthIsRequired = "82612"
598
+ Declined = "82626" # Keep for backwards compatibility
634
599
  DeclinedFailedKYC = "82623" # Keep for backwards compatibility
600
+ DeclinedMasterCardMatch = "82622" # Keep for backwards compatibility
601
+ DeclinedOFAC = "82621" # Keep for backwards compatibility
635
602
  DeclinedSsnInvalid = "82624" # Keep for backwards compatibility
636
603
  DeclinedSsnMatchesDeceased = "82625" # Keep for backwards compatibility
637
- Declined = "82626" # Keep for backwards compatibility
638
- PhoneIsInvalid = "82636"
639
- DateOfBirthIsInvalid = "82663"
640
- AccountNumberIsInvalid = "82670"
604
+ EmailAddressIsInvalid = "82616"
641
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"
642
616
  TaxIdMustBeBlank = "82673"
643
617
 
644
618
  module Address
645
- StreetAddressIsRequired = "82617"
646
619
  LocalityIsRequired = "82618"
620
+ PostalCodeIsInvalid = "82630"
647
621
  PostalCodeIsRequired = "82619"
622
+ RegionIsInvalid = "82664"
648
623
  RegionIsRequired = "82620"
649
624
  StreetAddressIsInvalid = "82629"
650
- PostalCodeIsInvalid = "82630"
651
- RegionIsInvalid = "82664"
625
+ StreetAddressIsRequired = "82617"
652
626
  end
653
627
  end
654
628
 
655
629
  module Individual
656
- FirstNameIsRequired = "82637"
657
- LastNameIsRequired = "82638"
630
+ DateOfBirthIsInvalid = "82666"
658
631
  DateOfBirthIsRequired = "82639"
659
- SsnIsInvalid = "82642"
660
632
  EmailIsInvalid = "82643"
633
+ EmailIsRequired = "82667"
661
634
  FirstNameIsInvalid = "82644"
635
+ FirstNameIsRequired = "82637"
662
636
  LastNameIsInvalid = "82645"
637
+ LastNameIsRequired = "82638"
663
638
  PhoneIsInvalid = "82656"
664
- DateOfBirthIsInvalid = "82666"
665
- EmailIsRequired = "82667"
639
+ SsnIsInvalid = "82642"
666
640
 
667
641
  module Address
668
- StreetAddressIsRequired = "82657"
669
642
  LocalityIsRequired = "82658"
643
+ PostalCodeIsInvalid = "82662"
670
644
  PostalCodeIsRequired = "82659"
645
+ RegionIsInvalid = "82668"
671
646
  RegionIsRequired = "82660"
672
647
  StreetAddressIsInvalid = "82661"
673
- PostalCodeIsInvalid = "82662"
674
- RegionIsInvalid = "82668"
648
+ StreetAddressIsRequired = "82657"
675
649
  end
676
650
  end
677
651
 
@@ -683,9 +657,9 @@ module Braintree
683
657
  TaxIdIsRequiredWithLegalName = "82648"
684
658
  TaxIdMustBeBlank = "82672"
685
659
  module Address
686
- StreetAddressIsInvalid = "82685"
687
660
  PostalCodeIsInvalid = "82686"
688
661
  RegionIsInvalid = "82684"
662
+ StreetAddressIsInvalid = "82685"
689
663
  end
690
664
  end
691
665
 
@@ -704,32 +678,32 @@ module Braintree
704
678
  end
705
679
 
706
680
  module SettlementBatchSummary
707
- SettlementDateIsRequired = "82301"
708
- SettlementDateIsInvalid = "82302"
709
681
  CustomFieldIsInvalid = "82303"
682
+ SettlementDateIsInvalid = "82302"
683
+ SettlementDateIsRequired = "82301"
710
684
  end
711
685
 
712
686
  module ClientToken
713
687
  CustomerDoesNotExist = "92804"
714
688
  FailOnDuplicatePaymentMethodRequiresCustomerId = "92803"
715
689
  MakeDefaultRequiresCustomerId = "92801"
690
+ MerchantAccountDoesNotExist = "92807"
716
691
  ProxyMerchantDoesNotExist = "92805"
717
- VerifyCardRequiresCustomerId = "92802"
718
692
  UnsupportedVersion = "92806"
719
- MerchantAccountDoesNotExist = "92807"
693
+ VerifyCardRequiresCustomerId = "92802"
720
694
  end
721
695
 
722
696
  module PaymentMethod
723
- PaymentMethodNonceConsumed = "93106"
697
+ CannotForwardPaymentMethodType = "93107"
724
698
  CustomerIdIsInvalid = "93105"
725
699
  CustomerIdIsRequired = "93104"
726
700
  NonceIsInvalid = "93102"
727
701
  NonceIsRequired = "93103"
728
- PaymentMethodParamsAreRequired = "93101"
729
- PaymentMethodNonceUnknown = "93108"
730
- PaymentMethodNonceLocked = "93109"
731
- CannotForwardPaymentMethodType = "93107"
732
702
  PaymentMethodNoLongerSupported = "93117"
703
+ PaymentMethodNonceConsumed = "93106"
704
+ PaymentMethodNonceLocked = "93109"
705
+ PaymentMethodNonceUnknown = "93108"
706
+ PaymentMethodParamsAreRequired = "93101"
733
707
 
734
708
  module Options
735
709
  UsBankAccountVerificationMethodIsInvalid = "93121"
@@ -756,26 +730,57 @@ module Braintree
756
730
 
757
731
  module Verification
758
732
  module Options
733
+ AccountTypeIsInvalid = "942184"
734
+ AccountTypeNotSupported = "942185"
759
735
  AmountCannotBeNegative = "94201"
760
736
  AmountFormatIsInvalid = "94202"
761
737
  AmountIsTooLarge = "94207"
762
738
  AmountNotSupportedByProcessor = "94203"
739
+ MerchantAccountCannotBeSubMerchantAccount = "94208"
763
740
  MerchantAccountIdIsInvalid = "94204"
764
- MerchantAccountIsSuspended = "94205"
765
741
  MerchantAccountIsForbidden = "94206"
766
- MerchantAccountCannotBeSubMerchantAccount = "94208"
767
- AccountTypeIsInvalid = "942184"
768
- AccountTypeNotSupported = "942185"
742
+ MerchantAccountIsSuspended = "94205"
743
+ end
744
+
745
+ AmountDoesNotMatch3DSecureAmount = "94285"
746
+ MerchantAccountDoesNotSupport3DSecure = "942169"
747
+ MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
748
+ ThreeDSecureAuthenticationFailed = "94271"
749
+ ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "942198"
750
+ ThreeDSecureAuthenticationIdIsInvalid = "942196"
751
+ ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "942199"
752
+ ThreeDSecureTokenIsInvalid = "94268"
753
+ ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
754
+ ThreeDSecureVerificationDataDoesntMatchVerify = "94270"
755
+
756
+ module ThreeDSecurePassThru
757
+ AuthenticationResponseIsInvalid = "942120"
758
+ CavvAlgorithmIsInvalid = "942122"
759
+ CavvIsRequired = "942116"
760
+ DirectoryResponseIsInvalid = "942121"
761
+ EciFlagIsInvalid = "942114"
762
+ EciFlagIsRequired = "942113"
763
+ ThreeDSecureVersionIsInvalid = "942119"
764
+ ThreeDSecureVersionIsRequired = "942117"
769
765
  end
770
766
  end
771
767
 
772
768
  module UsBankAccountVerification
773
- NotConfirmable = "96101"
774
- MustBeMicroTransfersVerification = "96102"
775
769
  AmountsDoNotMatch = "96103"
770
+ InvalidDepositAmounts = "96106"
771
+ MustBeMicroTransfersVerification = "96102"
772
+ NotConfirmable = "96101"
776
773
  TooManyConfirmationAttempts = "96104"
777
774
  UnableToConfirmDepositAmounts = "96105"
778
- InvalidDepositAmounts = "96106"
775
+ end
776
+
777
+ module RiskData
778
+ CustomerBrowserIsTooLong = "94701"
779
+ CustomerDeviceIdIsTooLong = "94702"
780
+ CustomerLocationZipInvalidCharacters = "94703"
781
+ CustomerLocationZipIsInvalid = "94704"
782
+ CustomerLocationZipIsTooLong = "94705"
783
+ CustomerTenureIsTooLong = "94706"
779
784
  end
780
785
  end
781
786
  end