braintree 2.99.0 → 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/braintree/address_gateway.rb +2 -2
- data/lib/braintree/amex_express_checkout_card.rb +2 -0
- data/lib/braintree/android_pay_card.rb +5 -0
- data/lib/braintree/base_module.rb +4 -0
- data/lib/braintree/credit_card.rb +5 -1
- data/lib/braintree/credit_card_gateway.rb +14 -0
- data/lib/braintree/credit_card_verification.rb +2 -0
- data/lib/braintree/customer.rb +5 -2
- data/lib/braintree/dispute.rb +1 -0
- data/lib/braintree/dispute/transaction.rb +2 -0
- data/lib/braintree/error_codes.rb +76 -33
- data/lib/braintree/graphql_client.rb +7 -1
- data/lib/braintree/masterpass_card.rb +2 -0
- data/lib/braintree/payment_instrument_type.rb +2 -1
- data/lib/braintree/payment_method_gateway.rb +14 -0
- data/lib/braintree/payment_method_nonce.rb +2 -0
- data/lib/braintree/payment_method_nonce_gateway.rb +13 -2
- data/lib/braintree/payment_method_parser.rb +1 -0
- data/lib/braintree/risk_data.rb +4 -1
- data/lib/braintree/test/authentication_id.rb +21 -0
- data/lib/braintree/test/credit_card.rb +1 -0
- data/lib/braintree/test/nonce.rb +18 -0
- data/lib/braintree/three_d_secure_info.rb +2 -0
- data/lib/braintree/transaction.rb +15 -1
- data/lib/braintree/transaction/address_details.rb +11 -0
- data/lib/braintree/transaction/android_pay_details.rb +5 -0
- data/lib/braintree/transaction/apple_pay_details.rb +1 -0
- data/lib/braintree/transaction/masterpass_card_details.rb +2 -0
- data/lib/braintree/transaction/paypal_details.rb +2 -0
- data/lib/braintree/transaction_gateway.rb +12 -3
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/webhook_notification.rb +3 -0
- data/lib/braintree/webhook_testing_gateway.rb +243 -0
- data/spec/integration/braintree/client_api/spec_helper.rb +98 -46
- data/spec/integration/braintree/credit_card_spec.rb +135 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +2 -0
- data/spec/integration/braintree/customer_spec.rb +116 -0
- data/spec/integration/braintree/dispute_search_spec.rb +1 -1
- data/spec/integration/braintree/dispute_spec.rb +1 -0
- data/spec/integration/braintree/document_upload_spec.rb +12 -0
- data/spec/integration/braintree/merchant_spec.rb +2 -2
- data/spec/integration/braintree/payment_method_nonce_spec.rb +83 -2
- data/spec/integration/braintree/payment_method_spec.rb +113 -18
- data/spec/integration/braintree/paypal_account_spec.rb +1 -1
- data/spec/integration/braintree/transaction_spec.rb +437 -45
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/braintree/credit_card_spec.rb +51 -3
- data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
- data/spec/unit/braintree/customer_spec.rb +28 -2
- data/spec/unit/braintree/dispute_spec.rb +3 -0
- data/spec/unit/braintree/three_d_secure_info_spec.rb +3 -1
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +57 -0
- data/spec/unit/braintree/transaction_spec.rb +16 -2
- data/spec/unit/braintree/webhook_notification_spec.rb +48 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5e73505966566953ef5df2f2e366b104d0ba4bae9fe485759a4cd2048100d75
|
|
4
|
+
data.tar.gz: 5909d63f9c589f1c0ac70bd55c8b4eda61cd52fcaf53d46c1030ef7b18ffe1ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2012367a1bc709459b1a65828ea01aa851d0e491e9071dee4ce8797603b75cf3f412f6ededf628e713d55bdc095762f50fc500e77519d8ec485679aa0033a92
|
|
7
|
+
data.tar.gz: f7724b06f9b4447fe2051f50fa0c0f62e96d43342cf09e048fc8522ee0bb29e38d0fe35ab938fe1b16202e3a77be67d20b038d920eb4acc4e82db2416d555537
|
|
@@ -76,8 +76,8 @@ module Braintree
|
|
|
76
76
|
|
|
77
77
|
def self._shared_signature # :nodoc:
|
|
78
78
|
[:company, :country_code_alpha2, :country_code_alpha3, :country_code_numeric,
|
|
79
|
-
:country_name, :extended_address, :first_name,
|
|
80
|
-
:
|
|
79
|
+
:country_name, :extended_address, :first_name, :last_name, :locality, :phone_number,
|
|
80
|
+
:postal_code, :region, :street_address]
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def self._update_signature # :nodoc:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
+
# NEXT_MAJOR_VERSION rename Android Pay to Google Pay
|
|
2
3
|
class AndroidPayCard
|
|
3
4
|
include BaseModule # :nodoc:
|
|
4
5
|
|
|
@@ -29,6 +30,10 @@ module Braintree
|
|
|
29
30
|
@default
|
|
30
31
|
end
|
|
31
32
|
|
|
33
|
+
def is_network_tokenized?
|
|
34
|
+
@is_network_tokenized
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
def card_type
|
|
33
38
|
virtual_card_type
|
|
34
39
|
end
|
|
@@ -239,6 +239,10 @@ module Braintree
|
|
|
239
239
|
@venmo_sdk
|
|
240
240
|
end
|
|
241
241
|
|
|
242
|
+
def is_network_tokenized?
|
|
243
|
+
@is_network_tokenized
|
|
244
|
+
end
|
|
245
|
+
|
|
242
246
|
class << self
|
|
243
247
|
protected :new
|
|
244
248
|
end
|
|
@@ -247,7 +251,7 @@ module Braintree
|
|
|
247
251
|
[
|
|
248
252
|
:billing_address, :bin, :card_type, :cardholder_name, :created_at, :customer_id, :expiration_month,
|
|
249
253
|
:expiration_year, :last_4, :token, :updated_at, :prepaid, :payroll, :product_id, :commercial, :debit, :durbin_regulated,
|
|
250
|
-
:healthcare, :country_of_issuance, :issuing_bank, :image_url
|
|
254
|
+
:healthcare, :country_of_issuance, :issuing_bank, :image_url, :is_network_tokenized?
|
|
251
255
|
]
|
|
252
256
|
end
|
|
253
257
|
|
|
@@ -113,10 +113,24 @@ module Braintree
|
|
|
113
113
|
:billing_address_id, :cardholder_name, :cvv, :device_session_id, :expiration_date,
|
|
114
114
|
:expiration_month, :expiration_year, :number, :token, :venmo_sdk_payment_method_code,
|
|
115
115
|
:device_data, :fraud_merchant_id, :payment_method_nonce,
|
|
116
|
+
{:external_vault => [:network_transaction_id]},
|
|
116
117
|
{:options => options},
|
|
117
118
|
{:billing_address => billing_address_params}
|
|
118
119
|
]
|
|
119
120
|
|
|
121
|
+
signature << {
|
|
122
|
+
:three_d_secure_pass_thru => [
|
|
123
|
+
:eci_flag,
|
|
124
|
+
:cavv,
|
|
125
|
+
:xid,
|
|
126
|
+
:three_d_secure_version,
|
|
127
|
+
:authentication_response,
|
|
128
|
+
:directory_response,
|
|
129
|
+
:cavv_algorithm,
|
|
130
|
+
:ds_transaction_id,
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
|
|
120
134
|
case type
|
|
121
135
|
when :create
|
|
122
136
|
signature << :customer_id
|
|
@@ -22,10 +22,12 @@ module Braintree
|
|
|
22
22
|
attr_reader :currency_iso_code
|
|
23
23
|
attr_reader :cvv_response_code
|
|
24
24
|
attr_reader :gateway_rejection_reason
|
|
25
|
+
attr_reader :graphql_id
|
|
25
26
|
attr_reader :id
|
|
26
27
|
attr_reader :merchant_account_id
|
|
27
28
|
attr_reader :network_response_code
|
|
28
29
|
attr_reader :network_response_text
|
|
30
|
+
attr_reader :network_transaction_id
|
|
29
31
|
attr_reader :processor_response_code
|
|
30
32
|
attr_reader :processor_response_text
|
|
31
33
|
attr_reader :processor_response_type
|
data/lib/braintree/customer.rb
CHANGED
|
@@ -4,7 +4,8 @@ module Braintree
|
|
|
4
4
|
include Braintree::Util::IdEquality
|
|
5
5
|
|
|
6
6
|
attr_reader :addresses
|
|
7
|
-
attr_reader :amex_express_checkout_cards
|
|
7
|
+
attr_reader :amex_express_checkout_cards # Deprecated
|
|
8
|
+
# NEXT_MAJOR_VERSION rename Android Pay to Google Pay
|
|
8
9
|
attr_reader :android_pay_cards
|
|
9
10
|
attr_reader :apple_pay_cards
|
|
10
11
|
attr_reader :coinbase_accounts
|
|
@@ -15,9 +16,10 @@ module Braintree
|
|
|
15
16
|
attr_reader :email
|
|
16
17
|
attr_reader :fax
|
|
17
18
|
attr_reader :first_name
|
|
19
|
+
attr_reader :graphql_id
|
|
18
20
|
attr_reader :id
|
|
19
21
|
attr_reader :last_name
|
|
20
|
-
attr_reader :masterpass_cards
|
|
22
|
+
attr_reader :masterpass_cards # Deprecated
|
|
21
23
|
attr_reader :paypal_accounts
|
|
22
24
|
attr_reader :phone
|
|
23
25
|
attr_reader :samsung_pay_cards
|
|
@@ -112,6 +114,7 @@ module Braintree
|
|
|
112
114
|
@coinbase_accounts = (@coinbase_accounts || []).map { |pm| CoinbaseAccount._new gateway, pm }
|
|
113
115
|
@apple_pay_cards = (@apple_pay_cards || []).map { |pm| ApplePayCard._new gateway, pm }
|
|
114
116
|
@europe_bank_accounts = (@europe_bank_Accounts || []).map { |pm| EuropeBankAccount._new gateway, pm }
|
|
117
|
+
# NEXT_MAJOR_VERSION rename Android Pay to Google Pay
|
|
115
118
|
@android_pay_cards = (@android_pay_cards || []).map { |pm| AndroidPayCard._new gateway, pm }
|
|
116
119
|
@amex_express_checkout_cards = (@amex_express_checkout_cards || []).map { |pm| AmexExpressCheckoutCard._new gateway, pm }
|
|
117
120
|
@venmo_accounts = (@venmo_accounts || []).map { |pm| VenmoAccount._new gateway, pm }
|
data/lib/braintree/dispute.rb
CHANGED
|
@@ -181,6 +181,7 @@ module Braintree
|
|
|
181
181
|
FileTypeIsInvalid = "84903"
|
|
182
182
|
FileIsMalformedOrEncrypted = "84904"
|
|
183
183
|
FileIsTooLong = "84905"
|
|
184
|
+
FileIsEmpty = "84906"
|
|
184
185
|
end
|
|
185
186
|
|
|
186
187
|
module PayPalAccount
|
|
@@ -302,6 +303,7 @@ module Braintree
|
|
|
302
303
|
AmountMustBeGreaterThanZero = "81531"
|
|
303
304
|
AmountNotSupportedByProcessor = "815193"
|
|
304
305
|
BillingAddressConflict = "91530"
|
|
306
|
+
BillingPhoneNumberIsInvalid = "915206"
|
|
305
307
|
CannotBeVoided = "91504"
|
|
306
308
|
CannotCancelRelease = "91562"
|
|
307
309
|
CannotCloneCredit = "91543"
|
|
@@ -323,29 +325,21 @@ module Braintree
|
|
|
323
325
|
CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
|
|
324
326
|
ChannelIsTooLong = "91550"
|
|
325
327
|
CreditCardIsRequired = "91508"
|
|
326
|
-
CustomFieldIsInvalid = "91526"
|
|
327
|
-
CustomFieldIsTooLong = "81527"
|
|
328
328
|
CustomerDefaultPaymentMethodCardTypeIsNotAccepted = "81509"
|
|
329
329
|
CustomerDoesNotHaveCreditCard = "91511"
|
|
330
330
|
CustomerIdIsInvalid = "91510"
|
|
331
|
+
CustomFieldIsInvalid = "91526"
|
|
332
|
+
CustomFieldIsTooLong = "81527"
|
|
333
|
+
DiscountAmountCannotBeNegative = "915160"
|
|
334
|
+
DiscountAmountFormatIsInvalid = "915159"
|
|
335
|
+
DiscountAmountIsTooLarge = "915161"
|
|
331
336
|
FailedAuthAdjustmentAllowRetry = "95603"
|
|
332
337
|
FailedAuthAdjustmentHardDecline = "95602"
|
|
333
338
|
FinalAuthSubmitForSettlementForDifferentAmount = "95601"
|
|
334
339
|
HasAlreadyBeenRefunded = "91512"
|
|
335
340
|
IdealPaymentNotComplete = "815141"
|
|
336
|
-
PaymentInstrumentWithExternalVaultIsInvalid = "915176"
|
|
337
|
-
TooManyLineItems = "915157"
|
|
338
|
-
LineItemsExpected = "915158"
|
|
339
|
-
DiscountAmountFormatIsInvalid = "915159"
|
|
340
|
-
DiscountAmountCannotBeNegative = "915160"
|
|
341
|
-
DiscountAmountIsTooLarge = "915161"
|
|
342
|
-
ShippingAmountFormatIsInvalid = "915162"
|
|
343
|
-
ShippingAmountCannotBeNegative = "915163"
|
|
344
|
-
ShippingAmountIsTooLarge = "915164"
|
|
345
|
-
ShipsFromPostalCodeIsTooLong = "915165"
|
|
346
|
-
ShipsFromPostalCodeIsInvalid = "915166"
|
|
347
|
-
ShipsFromPostalCodeInvalidCharacters = "915167"
|
|
348
341
|
IdealPaymentsCannotBeVaulted = "915150"
|
|
342
|
+
LineItemsExpected = "915158"
|
|
349
343
|
MerchantAccountDoesNotMatch3DSecureMerchantAccount = "91584"
|
|
350
344
|
MerchantAccountDoesNotMatchIdealPaymentMerchantAccount = "915143"
|
|
351
345
|
MerchantAccountDoesNotSupportMOTO = "91558"
|
|
@@ -353,14 +347,12 @@ module Braintree
|
|
|
353
347
|
MerchantAccountIdDoesNotMatchSubscription = "915180"
|
|
354
348
|
MerchantAccountIdIsInvalid = "91513"
|
|
355
349
|
MerchantAccountIsSuspended = "91514"
|
|
356
|
-
OrderIdIsTooLong = "91501"
|
|
357
|
-
OrderIdIsRequiredWithIdealPayment = "91502"
|
|
358
350
|
OrderIdDoesNotMatchIdealPaymentOrderId = "91503"
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
PayPalVaultRecordMissingData = "91583"
|
|
351
|
+
OrderIdIsRequiredWithIdealPayment = "91502"
|
|
352
|
+
OrderIdIsTooLong = "91501"
|
|
362
353
|
PaymentInstrumentNotSupportedByMerchantAccount = "91577"
|
|
363
354
|
PaymentInstrumentTypeIsNotAccepted = "915101"
|
|
355
|
+
PaymentInstrumentWithExternalVaultIsInvalid = "915176"
|
|
364
356
|
PaymentMethodConflict = "91515"
|
|
365
357
|
PaymentMethodConflictWithVenmoSDK = "91549"
|
|
366
358
|
PaymentMethodDoesNotBelongToCustomer = "91516"
|
|
@@ -368,24 +360,29 @@ module Braintree
|
|
|
368
360
|
PaymentMethodNonceCardTypeIsNotAccepted = "91567"
|
|
369
361
|
PaymentMethodNonceConsumed = "91564"
|
|
370
362
|
PaymentMethodNonceHasNoValidPaymentInstrumentType = "91569"
|
|
371
|
-
UsBankAccountNonceMustBePlaidVerified = "915171"
|
|
372
|
-
UsBankAccountNotVerified = "915172"
|
|
373
363
|
PaymentMethodNonceLocked = "91566"
|
|
374
364
|
PaymentMethodNonceUnknown = "91565"
|
|
375
365
|
PaymentMethodTokenCardTypeIsNotAccepted = "91517"
|
|
376
366
|
PaymentMethodTokenIsInvalid = "91518"
|
|
367
|
+
PayPalAuthExpired = "91579"
|
|
368
|
+
PayPalNotEnabled = "91576"
|
|
369
|
+
PayPalVaultRecordMissingData = "91583"
|
|
377
370
|
ProcessorAuthorizationCodeCannotBeSet = "91519"
|
|
378
371
|
ProcessorAuthorizationCodeIsInvalid = "81520"
|
|
379
372
|
ProcessorDoesNotSupportAuths = "915104"
|
|
380
|
-
ProcessorDoesNotSupportUpdatingOrderId = "915107"
|
|
381
|
-
ProcessorDoesNotSupportUpdatingDescriptor = "915108"
|
|
382
|
-
ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
|
|
383
373
|
ProcessorDoesNotSupportCredits = "91546"
|
|
374
|
+
ProcessorDoesNotSupportMotoForCardType = "915195"
|
|
384
375
|
ProcessorDoesNotSupportPartialSettlement = "915102"
|
|
376
|
+
ProcessorDoesNotSupportUpdatingDescriptor = "915108"
|
|
377
|
+
ProcessorDoesNotSupportUpdatingOrderId = "915107"
|
|
378
|
+
ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
|
|
385
379
|
ProcessorDoesNotSupportVoiceAuthorizations = "91545"
|
|
380
|
+
ProductSkuIsInvalid = "915202"
|
|
386
381
|
PurchaseOrderNumberIsInvalid = "91548"
|
|
387
382
|
PurchaseOrderNumberIsTooLong = "91537"
|
|
388
383
|
RefundAmountIsTooLarge = "91521"
|
|
384
|
+
RefundAuthHardDeclined = "915200"
|
|
385
|
+
RefundAuthSoftDeclined = "915201"
|
|
389
386
|
ServiceFeeAmountCannotBeNegative = "91554"
|
|
390
387
|
ServiceFeeAmountFormatIsInvalid = "91555"
|
|
391
388
|
ServiceFeeAmountIsTooLarge = "91556"
|
|
@@ -395,6 +392,14 @@ module Braintree
|
|
|
395
392
|
SettlementAmountIsLessThanServiceFeeAmount = "91551"
|
|
396
393
|
SettlementAmountIsTooLarge = "91522"
|
|
397
394
|
ShippingAddressDoesntMatchCustomer = "91581"
|
|
395
|
+
ShippingAmountCannotBeNegative = "915163"
|
|
396
|
+
ShippingAmountFormatIsInvalid = "915162"
|
|
397
|
+
ShippingAmountIsTooLarge = "915164"
|
|
398
|
+
ShippingMethodIsInvalid = "915203"
|
|
399
|
+
ShippingPhoneNumberIsInvalid = "915204"
|
|
400
|
+
ShipsFromPostalCodeInvalidCharacters = "915167"
|
|
401
|
+
ShipsFromPostalCodeIsInvalid = "915166"
|
|
402
|
+
ShipsFromPostalCodeIsTooLong = "915165"
|
|
398
403
|
SubMerchantAccountRequiresServiceFeeAmount = "91553"
|
|
399
404
|
SubscriptionDoesNotBelongToCustomer = "91529"
|
|
400
405
|
SubscriptionIdIsInvalid = "91528"
|
|
@@ -403,21 +408,28 @@ module Braintree
|
|
|
403
408
|
TaxAmountFormatIsInvalid = "81535"
|
|
404
409
|
TaxAmountIsTooLarge = "81536"
|
|
405
410
|
ThreeDSecureAuthenticationFailed = "81571"
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
ThreeDSecureCavvIsRequired = "915116"
|
|
410
|
-
ThreeDSecureXidIsRequired = "915115"
|
|
411
|
-
ThreeDSecureEciFlagIsInvalid = "915114"
|
|
412
|
-
ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
|
|
411
|
+
ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "915198"
|
|
412
|
+
ThreeDSecureAuthenticationIdIsInvalid = "915196"
|
|
413
|
+
ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "915199"
|
|
413
414
|
ThreeDSecureAuthenticationResponseIsInvalid = "915120"
|
|
414
|
-
ThreeDSecureDirectoryResponseIsInvalid = "915121"
|
|
415
415
|
ThreeDSecureCavvAlgorithmIsInvalid = "915122"
|
|
416
|
+
ThreeDSecureCavvIsRequired = "915116"
|
|
417
|
+
ThreeDSecureDirectoryResponseIsInvalid = "915121"
|
|
418
|
+
ThreeDSecureEciFlagIsInvalid = "915114"
|
|
419
|
+
ThreeDSecureEciFlagIsRequired = "915113"
|
|
416
420
|
ThreeDSecureMerchantAccountDoesNotSupportCardType = "915131"
|
|
421
|
+
ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
|
|
422
|
+
ThreeDSecureTokenIsInvalid = "91568"
|
|
423
|
+
ThreeDSecureTransactionDataDoesntMatchVerify = "91570"
|
|
424
|
+
ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "915197"
|
|
425
|
+
ThreeDSecureXidIsRequired = "915115"
|
|
426
|
+
TooManyLineItems = "915157"
|
|
427
|
+
TransactionSourceIsInvalid = "915133"
|
|
417
428
|
TypeIsInvalid = "91523"
|
|
418
429
|
TypeIsRequired = "91524"
|
|
419
430
|
UnsupportedVoiceAuthorization = "91539"
|
|
420
|
-
|
|
431
|
+
UsBankAccountNonceMustBePlaidVerified = "915171"
|
|
432
|
+
UsBankAccountNotVerified = "915172"
|
|
421
433
|
|
|
422
434
|
module Options
|
|
423
435
|
SubmitForSettlementIsRequiredForCloning = "91544"
|
|
@@ -760,6 +772,28 @@ module Braintree
|
|
|
760
772
|
AccountTypeIsInvalid = "942184"
|
|
761
773
|
AccountTypeNotSupported = "942185"
|
|
762
774
|
end
|
|
775
|
+
|
|
776
|
+
ThreeDSecureAuthenticationIdIsInvalid = "942196"
|
|
777
|
+
ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "942198"
|
|
778
|
+
ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
|
|
779
|
+
ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "942199"
|
|
780
|
+
ThreeDSecureAuthenticationFailed = "94271"
|
|
781
|
+
ThreeDSecureTokenIsInvalid = "94268"
|
|
782
|
+
ThreeDSecureVerificationDataDoesntMatchVerify = "94270"
|
|
783
|
+
MerchantAccountDoesNotSupport3DSecure = "942169"
|
|
784
|
+
MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
|
|
785
|
+
AmountDoesNotMatch3DSecureAmount = "94285"
|
|
786
|
+
|
|
787
|
+
module ThreeDSecurePassThru
|
|
788
|
+
EciFlagIsRequired = "942113"
|
|
789
|
+
EciFlagIsInvalid = "942114"
|
|
790
|
+
CavvIsRequired = "942116"
|
|
791
|
+
ThreeDSecureVersionIsRequired = "942117"
|
|
792
|
+
ThreeDSecureVersionIsInvalid = "942119"
|
|
793
|
+
AuthenticationResponseIsInvalid = "942120"
|
|
794
|
+
DirectoryResponseIsInvalid = "942121"
|
|
795
|
+
CavvAlgorithmIsInvalid = "942122"
|
|
796
|
+
end
|
|
763
797
|
end
|
|
764
798
|
|
|
765
799
|
module UsBankAccountVerification
|
|
@@ -770,5 +804,14 @@ module Braintree
|
|
|
770
804
|
UnableToConfirmDepositAmounts = "96105"
|
|
771
805
|
InvalidDepositAmounts = "96106"
|
|
772
806
|
end
|
|
807
|
+
|
|
808
|
+
module RiskData
|
|
809
|
+
CustomerBrowserIsTooLong = "94701"
|
|
810
|
+
CustomerDeviceIdIsTooLong = "94702"
|
|
811
|
+
CustomerLocationZipInvalidCharacters = "94703"
|
|
812
|
+
CustomerLocationZipIsInvalid = "94704"
|
|
813
|
+
CustomerLocationZipIsTooLong = "94705"
|
|
814
|
+
CustomerTenureIsTooLong = "94706"
|
|
815
|
+
end
|
|
773
816
|
end
|
|
774
817
|
end
|
|
@@ -19,10 +19,16 @@ module Braintree
|
|
|
19
19
|
request['variables'] = variables
|
|
20
20
|
|
|
21
21
|
response = _http_do Net::HTTP::Post, @config.graphql_base_url, request.to_json, nil, graphql_connection, @graphql_headers
|
|
22
|
-
data =
|
|
22
|
+
data = _parse_response(response)
|
|
23
23
|
Util.raise_exception_for_graphql_error(data)
|
|
24
24
|
|
|
25
25
|
data
|
|
26
26
|
end
|
|
27
|
+
|
|
28
|
+
def _parse_response(response)
|
|
29
|
+
body = response.body
|
|
30
|
+
body = Zlib::GzipReader.new(StringIO.new(body)).read if response.header['Content-Encoding'] == "gzip"
|
|
31
|
+
JSON.parse(body, :symbolize_names => true)
|
|
32
|
+
end
|
|
27
33
|
end
|
|
28
34
|
end
|
|
@@ -5,11 +5,12 @@ module Braintree
|
|
|
5
5
|
CreditCard = 'credit_card'
|
|
6
6
|
CoinbaseAccount = 'coinbase_account'
|
|
7
7
|
ApplePayCard = 'apple_pay_card'
|
|
8
|
+
# NEXT_MAJOR_VERSION rename Android Pay to Google Pay
|
|
8
9
|
AndroidPayCard = 'android_pay_card'
|
|
9
10
|
VenmoAccount = 'venmo_account'
|
|
10
11
|
UsBankAccount = 'us_bank_account'
|
|
11
12
|
VisaCheckoutCard = 'visa_checkout_card'
|
|
12
|
-
MasterpassCard = 'masterpass_card'
|
|
13
|
+
MasterpassCard = 'masterpass_card' # Deprecated
|
|
13
14
|
SamsungPayCard = 'samsung_pay_card'
|
|
14
15
|
LocalPayment = 'local_payment'
|
|
15
16
|
PayPalHere = 'paypal_here'
|
|
@@ -52,6 +52,7 @@ module Braintree
|
|
|
52
52
|
elsif response.has_key?(:apple_pay_card)
|
|
53
53
|
ApplePayCard._new(@gateway, response[:apple_pay_card])
|
|
54
54
|
elsif response.has_key?(:android_pay_card)
|
|
55
|
+
# NEXT_MAJOR_VERSION rename Android Pay to Google Pay
|
|
55
56
|
AndroidPayCard._new(@gateway, response[:android_pay_card])
|
|
56
57
|
elsif response.has_key?(:venmo_account)
|
|
57
58
|
VenmoAccount._new(@gateway, response[:venmo_account])
|
|
@@ -172,12 +173,25 @@ module Braintree
|
|
|
172
173
|
{:options => options},
|
|
173
174
|
{:billing_address => billing_address_params}
|
|
174
175
|
]
|
|
176
|
+
signature << {
|
|
177
|
+
:three_d_secure_pass_thru => [
|
|
178
|
+
:eci_flag,
|
|
179
|
+
:cavv,
|
|
180
|
+
:xid,
|
|
181
|
+
:three_d_secure_version,
|
|
182
|
+
:authentication_response,
|
|
183
|
+
:directory_response,
|
|
184
|
+
:cavv_algorithm,
|
|
185
|
+
:ds_transaction_id,
|
|
186
|
+
]
|
|
187
|
+
}
|
|
175
188
|
|
|
176
189
|
case type
|
|
177
190
|
when :create
|
|
178
191
|
options << :fail_on_duplicate_payment_method
|
|
179
192
|
signature << :customer_id
|
|
180
193
|
signature << :paypal_refresh_token
|
|
194
|
+
# NEXT_MAJOR_VERSION remove this from the signature
|
|
181
195
|
signature << :paypal_vault_without_upgrade
|
|
182
196
|
when :update
|
|
183
197
|
billing_address_params << {:options => [:update_existing]}
|
|
@@ -19,12 +19,14 @@ module Braintree
|
|
|
19
19
|
attr_reader :nonce
|
|
20
20
|
attr_reader :three_d_secure_info
|
|
21
21
|
attr_reader :type
|
|
22
|
+
attr_reader :authentication_insight
|
|
22
23
|
|
|
23
24
|
def initialize(gateway, attributes) # :nodoc:
|
|
24
25
|
@gateway = gateway
|
|
25
26
|
@nonce = attributes.fetch(:nonce)
|
|
26
27
|
@type = attributes.fetch(:type)
|
|
27
28
|
@details = attributes.fetch(:details)
|
|
29
|
+
@authentication_insight = attributes.fetch(:authentication_insight, nil)
|
|
28
30
|
@three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
|
|
29
31
|
@bin_data = BinData.new(attributes[:bin_data]) if attributes[:bin_data]
|
|
30
32
|
end
|