braintree 2.100.0 → 2.104.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/address_gateway.rb +2 -2
  3. data/lib/braintree/amex_express_checkout_card.rb +2 -0
  4. data/lib/braintree/android_pay_card.rb +5 -0
  5. data/lib/braintree/base_module.rb +4 -0
  6. data/lib/braintree/credit_card.rb +5 -1
  7. data/lib/braintree/credit_card_gateway.rb +13 -0
  8. data/lib/braintree/credit_card_verification.rb +2 -0
  9. data/lib/braintree/customer.rb +5 -2
  10. data/lib/braintree/dispute.rb +1 -0
  11. data/lib/braintree/dispute/transaction.rb +2 -0
  12. data/lib/braintree/error_codes.rb +76 -34
  13. data/lib/braintree/graphql_client.rb +7 -1
  14. data/lib/braintree/local_payment_completed.rb +1 -1
  15. data/lib/braintree/masterpass_card.rb +2 -0
  16. data/lib/braintree/payment_instrument_type.rb +2 -1
  17. data/lib/braintree/payment_method_gateway.rb +14 -0
  18. data/lib/braintree/payment_method_nonce.rb +2 -0
  19. data/lib/braintree/payment_method_nonce_gateway.rb +13 -2
  20. data/lib/braintree/payment_method_parser.rb +1 -0
  21. data/lib/braintree/risk_data.rb +4 -1
  22. data/lib/braintree/test/authentication_id.rb +21 -0
  23. data/lib/braintree/test/credit_card.rb +1 -0
  24. data/lib/braintree/test/nonce.rb +18 -0
  25. data/lib/braintree/three_d_secure_info.rb +2 -0
  26. data/lib/braintree/transaction.rb +15 -1
  27. data/lib/braintree/transaction/address_details.rb +11 -0
  28. data/lib/braintree/transaction/android_pay_details.rb +4 -0
  29. data/lib/braintree/transaction/masterpass_card_details.rb +2 -0
  30. data/lib/braintree/transaction/paypal_details.rb +2 -0
  31. data/lib/braintree/transaction_gateway.rb +12 -3
  32. data/lib/braintree/version.rb +2 -2
  33. data/lib/braintree/webhook_notification.rb +3 -0
  34. data/lib/braintree/webhook_testing_gateway.rb +243 -0
  35. data/spec/integration/braintree/client_api/spec_helper.rb +98 -46
  36. data/spec/integration/braintree/credit_card_spec.rb +120 -2
  37. data/spec/integration/braintree/credit_card_verification_spec.rb +2 -0
  38. data/spec/integration/braintree/customer_spec.rb +116 -0
  39. data/spec/integration/braintree/dispute_search_spec.rb +1 -1
  40. data/spec/integration/braintree/dispute_spec.rb +1 -0
  41. data/spec/integration/braintree/document_upload_spec.rb +12 -0
  42. data/spec/integration/braintree/merchant_spec.rb +2 -2
  43. data/spec/integration/braintree/payment_method_nonce_spec.rb +83 -2
  44. data/spec/integration/braintree/payment_method_spec.rb +113 -18
  45. data/spec/integration/braintree/paypal_account_spec.rb +1 -1
  46. data/spec/integration/braintree/transaction_spec.rb +435 -45
  47. data/spec/spec_helper.rb +1 -1
  48. data/spec/unit/braintree/credit_card_spec.rb +49 -3
  49. data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
  50. data/spec/unit/braintree/customer_spec.rb +26 -2
  51. data/spec/unit/braintree/dispute_spec.rb +3 -0
  52. data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
  53. data/spec/unit/braintree/three_d_secure_info_spec.rb +3 -1
  54. data/spec/unit/braintree/transaction/paypal_details_spec.rb +57 -0
  55. data/spec/unit/braintree/transaction_spec.rb +16 -2
  56. data/spec/unit/braintree/webhook_notification_spec.rb +48 -0
  57. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce8a0ffb1227a51cbb8d3f53339a7b9c6f4ea4cb934a1f8650fe0376394c5e3d
4
- data.tar.gz: b500561e20d50b0b30b816fe9152d2cf838555304a544508d800f4f8202e02c4
3
+ metadata.gz: 89971a45c1e0be0e048b7af1c4709c262186eae09880c4d0ce40a112782baa7d
4
+ data.tar.gz: 6f0d43792c5cac012febc1318ca045ff384dfdc536500ff0359c083abdec2829
5
5
  SHA512:
6
- metadata.gz: d86f151ea614c6c8f5f1297873efa2c8a7e1f567bd05b06fbb9aa6216ef45ccd3b3d6aef0d40204028b05a7bd8fcfa010d9b3670fdd5a88babcc81fdfb7d3a48
7
- data.tar.gz: 70efed7f2733dd6055fc868ca7ff7bf104dcc550a6499c7fe10bb7c1f17f33e4c686eee676463af6bd4725d1a298816871418accba721ad840b6b1d8821006ca
6
+ metadata.gz: 3b43b76eaf3f3f157d81c4d832162442ade1e981fc01a6a51984aec587eb51ea8e2c0b2376317d30b8fa73d83cb31250ab37bddf8d0111809790354c3970ff4f
7
+ data.tar.gz: d604e220f3d1ba2d98e17db2f4a11f7e25548cc62c808732f2b72f71064a874d98e1c4f1996a3ecccfb6ef4bd9b303ad132e2cd9f96f7703a67e5f35c42d446b
@@ -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
- :last_name, :locality, :postal_code, :region, :street_address]
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,6 @@
1
1
  module Braintree
2
+ # NEXT_MAJOR_VERSION Remove this class.
3
+ # DEPRECATED The American Express Checkout payment method is deprecated.
2
4
  class AmexExpressCheckoutCard
3
5
  include BaseModule # :nodoc:
4
6
 
@@ -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
@@ -18,6 +18,10 @@ module Braintree
18
18
 
19
19
  def set_instance_variables_from_hash(hash)
20
20
  hash.each do |key, value|
21
+ if key == :global_id
22
+ instance_variable_set "@graphql_id", value
23
+ end
24
+
21
25
  instance_variable_set "@#{key}", value
22
26
  end
23
27
  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
 
@@ -118,6 +118,19 @@ module Braintree
118
118
  {:billing_address => billing_address_params}
119
119
  ]
120
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
+
121
134
  case type
122
135
  when :create
123
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
@@ -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 }
@@ -12,6 +12,7 @@ module Braintree
12
12
  attr_reader :date_opened
13
13
  attr_reader :date_won
14
14
  attr_reader :evidence
15
+ attr_reader :graphql_id
15
16
  attr_reader :id
16
17
  attr_reader :kind
17
18
  attr_reader :merchant_account_id
@@ -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
@@ -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
- PayPalAuthExpired = "91579"
360
- PayPalNotEnabled = "91576"
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,25 +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"
386
- ProcessorDoesNotSupportMotoForCardType = "915195"
380
+ ProductSkuIsInvalid = "915202"
387
381
  PurchaseOrderNumberIsInvalid = "91548"
388
382
  PurchaseOrderNumberIsTooLong = "91537"
389
383
  RefundAmountIsTooLarge = "91521"
384
+ RefundAuthHardDeclined = "915200"
385
+ RefundAuthSoftDeclined = "915201"
390
386
  ServiceFeeAmountCannotBeNegative = "91554"
391
387
  ServiceFeeAmountFormatIsInvalid = "91555"
392
388
  ServiceFeeAmountIsTooLarge = "91556"
@@ -396,6 +392,14 @@ module Braintree
396
392
  SettlementAmountIsLessThanServiceFeeAmount = "91551"
397
393
  SettlementAmountIsTooLarge = "91522"
398
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"
399
403
  SubMerchantAccountRequiresServiceFeeAmount = "91553"
400
404
  SubscriptionDoesNotBelongToCustomer = "91529"
401
405
  SubscriptionIdIsInvalid = "91528"
@@ -404,21 +408,28 @@ module Braintree
404
408
  TaxAmountFormatIsInvalid = "81535"
405
409
  TaxAmountIsTooLarge = "81536"
406
410
  ThreeDSecureAuthenticationFailed = "81571"
407
- ThreeDSecureTokenIsInvalid = "91568"
408
- ThreeDSecureTransactionDataDoesntMatchVerify = "91570"
409
- ThreeDSecureEciFlagIsRequired = "915113"
410
- ThreeDSecureCavvIsRequired = "915116"
411
- ThreeDSecureXidIsRequired = "915115"
412
- ThreeDSecureEciFlagIsInvalid = "915114"
413
- ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
411
+ ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "915198"
412
+ ThreeDSecureAuthenticationIdIsInvalid = "915196"
413
+ ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "915199"
414
414
  ThreeDSecureAuthenticationResponseIsInvalid = "915120"
415
- ThreeDSecureDirectoryResponseIsInvalid = "915121"
416
415
  ThreeDSecureCavvAlgorithmIsInvalid = "915122"
416
+ ThreeDSecureCavvIsRequired = "915116"
417
+ ThreeDSecureDirectoryResponseIsInvalid = "915121"
418
+ ThreeDSecureEciFlagIsInvalid = "915114"
419
+ ThreeDSecureEciFlagIsRequired = "915113"
417
420
  ThreeDSecureMerchantAccountDoesNotSupportCardType = "915131"
421
+ ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
422
+ ThreeDSecureTokenIsInvalid = "91568"
423
+ ThreeDSecureTransactionDataDoesntMatchVerify = "91570"
424
+ ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "915197"
425
+ ThreeDSecureXidIsRequired = "915115"
426
+ TooManyLineItems = "915157"
427
+ TransactionSourceIsInvalid = "915133"
418
428
  TypeIsInvalid = "91523"
419
429
  TypeIsRequired = "91524"
420
430
  UnsupportedVoiceAuthorization = "91539"
421
- TransactionSourceIsInvalid = "915133"
431
+ UsBankAccountNonceMustBePlaidVerified = "915171"
432
+ UsBankAccountNotVerified = "915172"
422
433
 
423
434
  module Options
424
435
  SubmitForSettlementIsRequiredForCloning = "91544"
@@ -761,6 +772,28 @@ module Braintree
761
772
  AccountTypeIsInvalid = "942184"
762
773
  AccountTypeNotSupported = "942185"
763
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
764
797
  end
765
798
 
766
799
  module UsBankAccountVerification
@@ -771,5 +804,14 @@ module Braintree
771
804
  UnableToConfirmDepositAmounts = "96105"
772
805
  InvalidDepositAmounts = "96106"
773
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
774
816
  end
775
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 = JSON.parse(response.body, :symbolize_names => true)
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
@@ -9,7 +9,7 @@ module Braintree
9
9
 
10
10
  def initialize(attributes) # :nodoc:
11
11
  set_instance_variables_from_hash(attributes)
12
- @transaction = Transaction._new(Configuration.gateway, transaction)
12
+ @transaction = Transaction._new(Configuration.gateway, transaction) unless transaction.nil?
13
13
  end
14
14
 
15
15
  class << self
@@ -1,4 +1,6 @@
1
1
  module Braintree
2
+ # NEXT_MAJOR_VERSION Remove this class.
3
+ # DEPRECATED The Masterpass Card payment method is deprecated.
2
4
  class MasterpassCard
3
5
  include BaseModule # :nodoc:
4
6
  include Braintree::Util::TokenEquality
@@ -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]}