Skip to content

Commit

Permalink
2.101.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Feb 20, 2020
1 parent 989b8f5 commit b8f3f48
Show file tree
Hide file tree
Showing 26 changed files with 447 additions and 174 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.101.0
* Add `RefundAuthHardDeclined` and `RefundAuthSoftDeclined` to validation errors
* Add `is_network_tokenized?` to android_pay_card and android_pay_details
* Add handling for `gzip` encoding to `graphql_client`
* Add Graphql ID to `CreditCardVerification`, `Customer`, `Dispute`, and `Transaction`
* Add `three_d_secure_authentication_id` to `ThreeDSecureInfo`
* Add `three_d_secure_authentication_id` support to transaction
* Add level 2 processing options `purchase_order_number`, `tax_amount`, and `tax_exempt` to Transaction submit_for_settlement
* Add level 3 processing options `shipping_amount`, `discount_amount`, `ships_from_postal_code`, and `line_items` to Transaction submit_for_settlement

# 2.100.0
* Add `ProcessorDoesNotSupportMotoForCardType` to validation errors
* Add `bin` to `apple_pay_details` and `android_pay_details`
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM debian:jessie

RUN apt-get update
RUN apt-get -y install gnupg curl procps build-essential libxml2-dev
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN curl -sSL https://get.rvm.io | bash
RUN bash -l -c "rvm requirements"
RUN bash -l -c "rvm install 2.4.4"
Expand Down
4 changes: 4 additions & 0 deletions lib/braintree/android_pay_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def default?
@default
end

def is_network_tokenized?
@is_network_tokenized
end

def card_type
virtual_card_type
end
Expand Down
4 changes: 4 additions & 0 deletions lib/braintree/base_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def copy_instance_variables_from_object(object)

def set_instance_variables_from_hash(hash)
hash.each do |key, value|
if key == :global_id
instance_variable_set "@graphql_id", value
end

instance_variable_set "@#{key}", value
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/credit_card_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module Status
attr_reader :currency_iso_code
attr_reader :cvv_response_code
attr_reader :gateway_rejection_reason
attr_reader :graphql_id
attr_reader :id
attr_reader :merchant_account_id
attr_reader :network_response_code
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Customer
attr_reader :email
attr_reader :fax
attr_reader :first_name
attr_reader :graphql_id
attr_reader :id
attr_reader :last_name
attr_reader :masterpass_cards
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/dispute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Dispute # :nodoc:
attr_reader :date_opened
attr_reader :date_won
attr_reader :evidence
attr_reader :graphql_id
attr_reader :id
attr_reader :kind
attr_reader :merchant_account_id
Expand Down
74 changes: 40 additions & 34 deletions lib/braintree/error_codes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,70 +323,63 @@ module Transaction
CannotUpdateTransactionDetailsNotSubmittedForSettlement = "915129"
ChannelIsTooLong = "91550"
CreditCardIsRequired = "91508"
CustomFieldIsInvalid = "91526"
CustomFieldIsTooLong = "81527"
CustomerDefaultPaymentMethodCardTypeIsNotAccepted = "81509"
CustomerDoesNotHaveCreditCard = "91511"
CustomerIdIsInvalid = "91510"
CustomFieldIsInvalid = "91526"
CustomFieldIsTooLong = "81527"
DiscountAmountCannotBeNegative = "915160"
DiscountAmountFormatIsInvalid = "915159"
DiscountAmountIsTooLarge = "915161"
FailedAuthAdjustmentAllowRetry = "95603"
FailedAuthAdjustmentHardDecline = "95602"
FinalAuthSubmitForSettlementForDifferentAmount = "95601"
HasAlreadyBeenRefunded = "91512"
IdealPaymentNotComplete = "815141"
PaymentInstrumentWithExternalVaultIsInvalid = "915176"
TooManyLineItems = "915157"
LineItemsExpected = "915158"
DiscountAmountFormatIsInvalid = "915159"
DiscountAmountCannotBeNegative = "915160"
DiscountAmountIsTooLarge = "915161"
ShippingAmountFormatIsInvalid = "915162"
ShippingAmountCannotBeNegative = "915163"
ShippingAmountIsTooLarge = "915164"
ShipsFromPostalCodeIsTooLong = "915165"
ShipsFromPostalCodeIsInvalid = "915166"
ShipsFromPostalCodeInvalidCharacters = "915167"
IdealPaymentsCannotBeVaulted = "915150"
LineItemsExpected = "915158"
MerchantAccountDoesNotMatch3DSecureMerchantAccount = "91584"
MerchantAccountDoesNotMatchIdealPaymentMerchantAccount = "915143"
MerchantAccountDoesNotSupportMOTO = "91558"
MerchantAccountDoesNotSupportRefunds = "91547"
MerchantAccountIdDoesNotMatchSubscription = "915180"
MerchantAccountIdIsInvalid = "91513"
MerchantAccountIsSuspended = "91514"
OrderIdIsTooLong = "91501"
OrderIdIsRequiredWithIdealPayment = "91502"
OrderIdDoesNotMatchIdealPaymentOrderId = "91503"
PayPalAuthExpired = "91579"
PayPalNotEnabled = "91576"
PayPalVaultRecordMissingData = "91583"
OrderIdIsRequiredWithIdealPayment = "91502"
OrderIdIsTooLong = "91501"
PaymentInstrumentNotSupportedByMerchantAccount = "91577"
PaymentInstrumentTypeIsNotAccepted = "915101"
PaymentInstrumentWithExternalVaultIsInvalid = "915176"
PaymentMethodConflict = "91515"
PaymentMethodConflictWithVenmoSDK = "91549"
PaymentMethodDoesNotBelongToCustomer = "91516"
PaymentMethodDoesNotBelongToSubscription = "91527"
PaymentMethodNonceCardTypeIsNotAccepted = "91567"
PaymentMethodNonceConsumed = "91564"
PaymentMethodNonceHasNoValidPaymentInstrumentType = "91569"
UsBankAccountNonceMustBePlaidVerified = "915171"
UsBankAccountNotVerified = "915172"
PaymentMethodNonceLocked = "91566"
PaymentMethodNonceUnknown = "91565"
PaymentMethodTokenCardTypeIsNotAccepted = "91517"
PaymentMethodTokenIsInvalid = "91518"
PayPalAuthExpired = "91579"
PayPalNotEnabled = "91576"
PayPalVaultRecordMissingData = "91583"
ProcessorAuthorizationCodeCannotBeSet = "91519"
ProcessorAuthorizationCodeIsInvalid = "81520"
ProcessorDoesNotSupportAuths = "915104"
ProcessorDoesNotSupportUpdatingOrderId = "915107"
ProcessorDoesNotSupportUpdatingDescriptor = "915108"
ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
ProcessorDoesNotSupportCredits = "91546"
ProcessorDoesNotSupportMotoForCardType = "915195"
ProcessorDoesNotSupportPartialSettlement = "915102"
ProcessorDoesNotSupportUpdatingDescriptor = "915108"
ProcessorDoesNotSupportUpdatingOrderId = "915107"
ProcessorDoesNotSupportUpdatingTransactionDetails = "915130"
ProcessorDoesNotSupportVoiceAuthorizations = "91545"
ProcessorDoesNotSupportMotoForCardType = "915195"
PurchaseOrderNumberIsInvalid = "91548"
PurchaseOrderNumberIsTooLong = "91537"
RefundAmountIsTooLarge = "91521"
RefundAuthHardDeclined = "915200"
RefundAuthSoftDeclined = "915201"
ServiceFeeAmountCannotBeNegative = "91554"
ServiceFeeAmountFormatIsInvalid = "91555"
ServiceFeeAmountIsTooLarge = "91556"
Expand All @@ -396,6 +389,12 @@ module Transaction
SettlementAmountIsLessThanServiceFeeAmount = "91551"
SettlementAmountIsTooLarge = "91522"
ShippingAddressDoesntMatchCustomer = "91581"
ShippingAmountCannotBeNegative = "915163"
ShippingAmountFormatIsInvalid = "915162"
ShippingAmountIsTooLarge = "915164"
ShipsFromPostalCodeInvalidCharacters = "915167"
ShipsFromPostalCodeIsInvalid = "915166"
ShipsFromPostalCodeIsTooLong = "915165"
SubMerchantAccountRequiresServiceFeeAmount = "91553"
SubscriptionDoesNotBelongToCustomer = "91529"
SubscriptionIdIsInvalid = "91528"
Expand All @@ -404,21 +403,28 @@ module Transaction
TaxAmountFormatIsInvalid = "81535"
TaxAmountIsTooLarge = "81536"
ThreeDSecureAuthenticationFailed = "81571"
ThreeDSecureTokenIsInvalid = "91568"
ThreeDSecureTransactionDataDoesntMatchVerify = "91570"
ThreeDSecureEciFlagIsRequired = "915113"
ThreeDSecureCavvIsRequired = "915116"
ThreeDSecureXidIsRequired = "915115"
ThreeDSecureEciFlagIsInvalid = "915114"
ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
ThreeDSecureAuthenticationIdDoesntMatchNonceThreeDSecureAuthentication = "915198"
ThreeDSecureAuthenticationIdIsInvalid = "915196"
ThreeDSecureAuthenticationIdWithThreeDSecurePassThruIsInvalid = "915199"
ThreeDSecureAuthenticationResponseIsInvalid = "915120"
ThreeDSecureDirectoryResponseIsInvalid = "915121"
ThreeDSecureCavvAlgorithmIsInvalid = "915122"
ThreeDSecureCavvIsRequired = "915116"
ThreeDSecureDirectoryResponseIsInvalid = "915121"
ThreeDSecureEciFlagIsInvalid = "915114"
ThreeDSecureEciFlagIsRequired = "915113"
ThreeDSecureMerchantAccountDoesNotSupportCardType = "915131"
ThreeDSecureThreeDSecureVersionIsInvalid = "915119"
ThreeDSecureTokenIsInvalid = "91568"
ThreeDSecureTransactionDataDoesntMatchVerify = "91570"
ThreeDSecureTransactionPaymentMethodDoesntMatchThreeDSecureAuthenticationPaymentMethod = "915197"
ThreeDSecureXidIsRequired = "915115"
TooManyLineItems = "915157"
TransactionSourceIsInvalid = "915133"
TypeIsInvalid = "91523"
TypeIsRequired = "91524"
UnsupportedVoiceAuthorization = "91539"
TransactionSourceIsInvalid = "915133"
UsBankAccountNonceMustBePlaidVerified = "915171"
UsBankAccountNotVerified = "915172"

module Options
SubmitForSettlementIsRequiredForCloning = "91544"
Expand Down
8 changes: 7 additions & 1 deletion lib/braintree/graphql_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ def query(definition, variables = {}, operationName = nil)
request['variables'] = variables

response = _http_do Net::HTTP::Post, @config.graphql_base_url, request.to_json, nil, graphql_connection, @graphql_headers
data = JSON.parse(response.body, :symbolize_names => true)
data = _parse_response(response)
Util.raise_exception_for_graphql_error(data)

data
end

def _parse_response(response)
body = response.body
body = Zlib::GzipReader.new(StringIO.new(body)).read if response.header['Content-Encoding'] == "gzip"
JSON.parse(body, :symbolize_names => true)
end
end
end
1 change: 1 addition & 0 deletions lib/braintree/payment_method_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def self._signature(type) # :nodoc:
options << :fail_on_duplicate_payment_method
signature << :customer_id
signature << :paypal_refresh_token
# NEXT_MAJOR_VERSION remove this from the signature
signature << :paypal_vault_without_upgrade
when :update
billing_address_params << {:options => [:update_existing]}
Expand Down
2 changes: 2 additions & 0 deletions lib/braintree/three_d_secure_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ThreeDSecureInfo # :nodoc:
attr_reader :eci_flag
attr_reader :three_d_secure_version
attr_reader :ds_transaction_id
attr_reader :three_d_secure_authentication_id

alias_method :liability_shifted?, :liability_shifted
alias_method :liability_shift_possible?, :liability_shift_possible
Expand All @@ -30,6 +31,7 @@ def inspect
:eci_flag,
:three_d_secure_version,
:ds_transaction_id,
:three_d_secure_authentication_id,
]

formatted_attrs = attr_order.map do |attr|
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module Status
attr_reader :facilitated_details
attr_reader :facilitator_details
attr_reader :gateway_rejection_reason
attr_reader :graphql_id
attr_reader :id
# NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
# DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
Expand Down
4 changes: 4 additions & 0 deletions lib/braintree/transaction/android_pay_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def initialize(attributes)
@card_type = @virtual_card_type
@last_4 = @virtual_card_last_4
end

def is_network_tokenized?
@is_network_tokenized
end
end
end
end
9 changes: 8 additions & 1 deletion lib/braintree/transaction_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def self._create_signature # :nodoc:
:purchase_order_number, :recurring, :transaction_source, :shipping_address_id, :type, :tax_amount, :tax_exempt,
:venmo_sdk_payment_method_code, :device_session_id, :service_fee_amount, :device_data, :fraud_merchant_id,
:shipping_amount, :discount_amount, :ships_from_postal_code,
:billing_address_id, :payment_method_nonce, :three_d_secure_token,
:billing_address_id, :payment_method_nonce, :three_d_secure_token, :three_d_secure_authentication_id,
:shared_payment_method_token, :shared_billing_address_id, :shared_customer_id, :shared_shipping_address_id, :shared_payment_method_nonce,
{:line_items => [:quantity, :name, :description, :kind, :unit_amount, :unit_tax_amount, :total_amount, :discount_amount, :tax_amount, :unit_of_measure, :product_code, :commodity_code, :url]},
{:risk_data => [:customer_browser, :customer_ip]},
Expand Down Expand Up @@ -263,6 +263,13 @@ def self._submit_for_settlement_signature # :nodoc:
[
:order_id,
{:descriptor => [:name, :phone, :url]},
:purchase_order_number,
:tax_amount,
:tax_exempt,
:discount_amount,
:shipping_amount,
:ships_from_postal_code,
:line_items => [:commodity_code, :description, :discount_amount, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :url, :tax_amount],
]
end

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 = 100
Minor = 101
Tiny = 0

String = "#{Major}.#{Minor}.#{Tiny}"
Expand Down
Loading

0 comments on commit b8f3f48

Please sign in to comment.