Skip to content

Commit

Permalink
2.102.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed May 13, 2020
1 parent b8f3f48 commit 24feda5
Show file tree
Hide file tree
Showing 23 changed files with 941 additions and 80 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Only open an issue here if you think you've found an issue with our SDK. If you need help troubleshooting your integration, reach out to Braintree Support at https://help.braintreepayments.com. -->

### General information

* SDK/Library version: <!-- Example: 4.7.2 -->
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.102.0
* Add `threeDSecurePassThru` parameters to `Customer.create`, `PaymentMethod.create`, `CreditCard.create`, `Customer.update`, `PaymentMethod.update`, and `CreditCard.update`
* Add `recurring_customer_consent`and `recurring_max_amount` options to `authentication_insight`to payment method nonce create
* Add ThreeDSecure test payment method nonces
* Add test `AuthenticationId`s
* Add `DisputeAccepted`, `DisputeDisputed`, and `DisputeExpired` webhook constants
* Add `Authentication Insight` to payment method nonce create
* Add `FileIsEmpty` error to `DocumentUpload`
* Add `retrieval_reference_number` to `Transaction`

# 2.101.0
* Add `RefundAuthHardDeclined` and `RefundAuthSoftDeclined` to validation errors
* Add `is_network_tokenized?` to android_pay_card and android_pay_details
Expand Down
13 changes: 13 additions & 0 deletions lib/braintree/credit_card_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ def self._signature(type) # :nodoc:
{:billing_address => billing_address_params}
]

signature << {
:three_d_secure_pass_thru => [
:eci_flag,
:cavv,
:xid,
:three_d_secure_version,
:authentication_response,
:directory_response,
:cavv_algorithm,
:ds_transaction_id,
]
}

case type
when :create
signature << :customer_id
Expand Down
23 changes: 23 additions & 0 deletions lib/braintree/error_codes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ module DocumentUpload
FileTypeIsInvalid = "84903"
FileIsMalformedOrEncrypted = "84904"
FileIsTooLong = "84905"
FileIsEmpty = "84906"
end

module PayPalAccount
Expand Down Expand Up @@ -767,6 +768,28 @@ module Options
AccountTypeIsInvalid = "942184"
AccountTypeNotSupported = "942185"
end

ThreeDSecureAuthenticationIdIsInvalid = "942196"
ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "942198"
ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "942197"
ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "942199"
ThreeDSecureAuthenticationFailed = "94271"
ThreeDSecureTokenIsInvalid = "94268"
ThreeDSecureVerificationDataDoesntMatchVerify = "94270"
MerchantAccountDoesNotSupport3DSecure = "942169"
MerchantAcountDoesNotMatch3DSecureMerchantAccount = "94284"
AmountDoesNotMatch3DSecureAmount = "94285"

module ThreeDSecurePassThru
EciFlagIsRequired = "942113"
EciFlagIsInvalid = "942114"
CavvIsRequired = "942116"
ThreeDSecureVersionIsRequired = "942117"
ThreeDSecureVersionIsInvalid = "942119"
AuthenticationResponseIsInvalid = "942120"
DirectoryResponseIsInvalid = "942121"
CavvAlgorithmIsInvalid = "942122"
end
end

module UsBankAccountVerification
Expand Down
12 changes: 12 additions & 0 deletions lib/braintree/payment_method_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ def self._signature(type) # :nodoc:
{:options => options},
{:billing_address => billing_address_params}
]
signature << {
:three_d_secure_pass_thru => [
:eci_flag,
:cavv,
:xid,
:three_d_secure_version,
:authentication_response,
:directory_response,
:cavv_algorithm,
:ds_transaction_id,
]
}

case type
when :create
Expand Down
2 changes: 2 additions & 0 deletions lib/braintree/payment_method_nonce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ def self.find(*args)
attr_reader :nonce
attr_reader :three_d_secure_info
attr_reader :type
attr_reader :authentication_insight

def initialize(gateway, attributes) # :nodoc:
@gateway = gateway
@nonce = attributes.fetch(:nonce)
@type = attributes.fetch(:type)
@details = attributes.fetch(:details)
@authentication_insight = attributes.fetch(:authentication_insight, nil)
@three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
@bin_data = BinData.new(attributes[:bin_data]) if attributes[:bin_data]
end
Expand Down
15 changes: 13 additions & 2 deletions lib/braintree/payment_method_nonce_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ def initialize(gateway)
@config.assert_has_access_token_or_keys
end

def create(payment_method_token)
response = @config.http.post("#{@config.base_merchant_path}/payment_methods/#{payment_method_token}/nonces")
def create(payment_method_token, args = { payment_method_nonce: {} })
Util.verify_keys(PaymentMethodNonceGateway._create_signature, args)

response = @config.http.post("#{@config.base_merchant_path}/payment_methods/#{payment_method_token}/nonces", args)
payment_method_nonce = PaymentMethodNonce._new(@gateway, response.fetch(:payment_method_nonce))
SuccessfulResult.new(:payment_method_nonce => payment_method_nonce)
end

def self._create_signature
[ {
:payment_method_nonce=> [
:merchant_account_id, :authentication_insight,
{:authentication_insight_options => [:amount, :recurring_customer_consent, :recurring_max_amount]}
]
}]
end

def create!(*args)
return_object_or_raise(:payment_method_nonce) { create(*args) }
end
Expand Down
21 changes: 21 additions & 0 deletions lib/braintree/test/authentication_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Braintree
module Test
module AuthenticationId
ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-id"
ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-id"
ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-id"
ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-id"
ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-id"
ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-id"
ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-id"
ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-id"
ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-id"
ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-id"
ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-id"
ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-id"
ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-id"
ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-id"
ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-id"
end
end
end
14 changes: 14 additions & 0 deletions lib/braintree/test/nonce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ module Nonce
VenmoAccount = "fake-venmo-account-nonce"
VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-nonce"
ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-nonce"
ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-nonce"
ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-nonce"
ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-nonce"
ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-nonce"
ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-nonce"
ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-nonce"
ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-nonce"
ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-nonce"
ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-nonce"
ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-nonce"
ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-nonce"
ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-nonce"
TransactableVisa = "fake-valid-visa-nonce"
TransactableAmEx = "fake-valid-amex-nonce"
TransactableMasterCard = "fake-valid-mastercard-nonce"
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ module Status
attr_reader :venmo_account_details
attr_reader :visa_checkout_card_details
attr_reader :voice_referral_number
attr_reader :retrieval_reference_number

def self.create(*args)
Configuration.gateway.transaction.create(*args)
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Braintree
module Version
Major = 2
Minor = 101
Minor = 102
Tiny = 0

String = "#{Major}.#{Minor}.#{Tiny}"
Expand Down
3 changes: 3 additions & 0 deletions lib/braintree/webhook_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ module Kind
DisputeOpened = "dispute_opened"
DisputeLost = "dispute_lost"
DisputeWon = "dispute_won"
DisputeAccepted = "dispute_accepted"
DisputeDisputed = "dispute_disputed"
DisputeExpired = "dispute_expired"

SubscriptionCanceled = "subscription_canceled"
SubscriptionChargedSuccessfully = "subscription_charged_successfully"
Expand Down
Loading

0 comments on commit 24feda5

Please sign in to comment.