diff --git a/.travis.yml b/.travis.yml index 2e792bf..5cafe28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,12 @@ sudo: false rvm: - - 2.2 - - 2.3 + # RETIRING 2.2 and 2.3 - 2.4 + - 2.5 + - 2.6 + - 2.7 + - 3.0 gemfile: - gemfiles/rails_42.gemfile @@ -16,7 +19,7 @@ gemfile: matrix: allow_failures: - - gemfile: gemfiles/rails_42.gemfile + - gemfile: gemfiles/rails_42.gemfile before_script: - git submodule update --remote --recursive diff --git a/authorizenet.gemspec b/authorizenet.gemspec index 9aa47dd..5dbec85 100644 --- a/authorizenet.gemspec +++ b/authorizenet.gemspec @@ -1,8 +1,8 @@ Gem::Specification.new do |s| s.name = "authorizenet" - s.version = "2.0.0" + s.version = "2.0.1" s.platform = Gem::Platform::RUBY - s.date = "2019-03-05" + s.date = "2021-03-31" s.summary = "Authorize.Net Payments SDK" s.description = "Authorize.Net SDK includes standard payments, recurring billing, and customer profiles" s.authors = ["Authorize.Net"] @@ -11,16 +11,17 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/AuthorizeNet/sdk-ruby" s.license = "https://github.com/AuthorizeNet/sdk-ruby/blob/master/LICENSE.txt" - s.required_ruby_version = '>= 2.2.2' + s.required_ruby_version = '>= 2.4.0' s.required_rubygems_version = '>= 1.3.6' - s.add_runtime_dependency 'activesupport', '>= 4.2.6' + s.add_runtime_dependency 'activesupport', '>= 5.2.4.5' s.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.4' s.add_runtime_dependency 'roxml', '>= 3.3.1' + s.add_runtime_dependency 'rexml', '>= 3.2.0' s.add_development_dependency('appraisal') - s.add_development_dependency 'rake', '~> 0.8', '>= 0.8.7' - s.add_development_dependency 'rspec', '~> 2.1' + s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3' + s.add_development_dependency 'rspec', '~> 3.9.0' s.add_development_dependency 'simplecov' s.add_development_dependency 'scrutinizer-ocular' end diff --git a/lib/authorize_net/api/constants.yml b/lib/authorize_net/api/constants.yml index 05dbb08..7e7a6c7 100644 --- a/lib/authorize_net/api/constants.yml +++ b/lib/authorize_net/api/constants.yml @@ -1 +1 @@ -clientId: sdk-ruby-2.0.0 +clientId: sdk-ruby-2.0.1 diff --git a/lib/authorize_net/api/schema.rb b/lib/authorize_net/api/schema.rb index b219652..85c608a 100644 --- a/lib/authorize_net/api/schema.rb +++ b/lib/authorize_net/api/schema.rb @@ -57,6 +57,10 @@ class ArrayOfFDSFilter < ::Array # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfPermissionType class ArrayOfPermissionType < ::Array end + + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfContactDetail + class ArrayOfContactDetail < ::Array + end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}driversLicenseType # number - SOAP::SOAPString @@ -1187,12 +1191,79 @@ def initialize(customerType = nil, billTo = nil) end end + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}profileTransAmountType + # amount - SOAP::SOAPDecimal + # tax - ExtendedAmountType + # shipping - ExtendedAmountType + # duty - ExtendedAmountType + # lineItems - LineItemType + class ProfileTransAmountType + include ROXML + xml_accessor :amount + xml_accessor :tax + xml_accessor :shipping + xml_accessor :duty + xml_accessor :lineItems + + def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = []) + @amount = amount + @tax = tax + @shipping = shipping + @duty = duty + @lineItems = lineItems + end + end + + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}merchantInitTransReasonEnum + class MerchantInitTransReasonEnum < ::String + resubmission = MerchantInitTransReasonEnum.new("resubmission") + delayedCharge = MerchantInitTransReasonEnum.new("delayedCharge") + reauthorization = MerchantInitTransReasonEnum.new("reauthorization") + noShow = MerchantInitTransReasonEnum.new("noShow") + end + + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}extendedAmountType + # amount - SOAP::SOAPDecimal + # name - SOAP::SOAPString + # description - SOAP::SOAPString + class ExtendedAmountType + include ROXML + xml_accessor :amount, as: BigDecimal + xml_accessor :name + xml_accessor :description + + def initialize(amount = nil, name = nil, description = nil) + @amount = amount + @name = name + @description = description + end + end + + #{AnetApi/xml/v1/schema/AnetApiSchema.xsd}subsequentAuthInformation + # originalNetworkTransId - SOAP::SOAPString + # originalAuthAmount - SOAP::SOAPDecimal + # reason - MerchantInitTransReasonEnum + class SubsequentAuthInformation + include ROXML + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount + xml_accessor :reason #, as: MerchantInitTransReasonEnum + + def initialize(originalNetworkTransId = nil, originalAuthAmount = nil, reason = nil) + @originalNetworkTransId = originalNetworkTransId + @reason = reason + @originalAuthAmount = originalAuthAmount + end + end + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}customerPaymentProfileType # customerType - CustomerTypeEnum # billTo - CustomerAddressType # payment - PaymentType # driversLicense - DriversLicenseType # taxId - SOAP::SOAPString + # defaultPaymentProfile - SOAP::SOAPBoolean + # subsequentAuthInformation - SubsequentAuthInformation class CustomerPaymentProfileType include ROXML xml_accessor :customerType @@ -1201,14 +1272,16 @@ class CustomerPaymentProfileType xml_accessor :driversLicense, as: DriversLicenseType xml_accessor :taxId xml_accessor :defaultPaymentProfile + xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation - def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil) + def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil, subsequentAuthInformation = nil) @customerType = customerType @billTo = billTo @payment = payment @driversLicense = driversLicense @taxId = taxId @defaultPaymentProfile = defaultPaymentProfile + @subsequentAuthInformation = subsequentAuthInformation end end @@ -1269,8 +1342,10 @@ class CustomerPaymentProfileMaskedType xml_accessor :driversLicense, as: DriversLicenseMaskedType xml_accessor :taxId xml_accessor :subscriptionIds, as: SubscriptionIdList + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount - def initialize(customerType = nil, billTo = nil, customerProfileId = nil, customerPaymentProfileId = nil, payment = nil, driversLicense = nil, taxId = nil, subscriptionIds = nil, defaultPaymentProfile = nil) + def initialize(customerType = nil, billTo = nil, customerProfileId = nil, customerPaymentProfileId = nil, payment = nil, driversLicense = nil, taxId = nil, subscriptionIds = nil, defaultPaymentProfile = nil, originalNetworkTransId = nil, originalAuthAmount = nil) @customerType = customerType @billTo = billTo @customerProfileId = customerProfileId @@ -1280,6 +1355,8 @@ def initialize(customerType = nil, billTo = nil, customerProfileId = nil, custom @taxId = taxId @subscriptionIds = subscriptionIds @defaultPaymentProfile = defaultPaymentProfile + @originalAuthAmount = originalAuthAmount + @originalNetworkTransId = originalNetworkTransId end end @@ -1397,23 +1474,7 @@ def initialize(merchantCustomerId = nil, description = nil, email = nil, custome @profileType = profileType end end - - # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}extendedAmountType - # amount - SOAP::SOAPDecimal - # name - SOAP::SOAPString - # description - SOAP::SOAPString - class ExtendedAmountType - include ROXML - xml_accessor :amount, as: BigDecimal - xml_accessor :name - xml_accessor :description - - def initialize(amount = nil, name = nil, description = nil) - @amount = amount - @name = name - @description = description - end - end + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}lineItemType # itemId - SOAP::SOAPString @@ -1512,37 +1573,6 @@ def initialize(lineItems = []) end end - # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}profileTransAmountType - # amount - SOAP::SOAPDecimal - # tax - ExtendedAmountType - # shipping - ExtendedAmountType - # duty - ExtendedAmountType - # lineItems - LineItemType - class ProfileTransAmountType - include ROXML - xml_accessor :amount - xml_accessor :tax - xml_accessor :shipping - xml_accessor :duty - xml_accessor :lineItems - - def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = []) - @amount = amount - @tax = tax - @shipping = shipping - @duty = duty - @lineItems = lineItems - end - end - - # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}merchantInitTransReasonEnum - class MerchantInitTransReasonEnum < ::String - resubmission = MerchantInitTransReasonEnum.new("resubmission") - delayedCharge = MerchantInitTransReasonEnum.new("delayedCharge") - reauthorization = MerchantInitTransReasonEnum.new("reauthorization") - noShow = MerchantInitTransReasonEnum.new("noShow") - end - #{AnetApi/xml/v1/schema/AnetApiSchema.xsd}processingOptions # isFirstRecurringPayment - SOAP::SOAPBoolean # isFirstSubsequentAuth - SOAP::SOAPBoolean @@ -1564,18 +1594,20 @@ def initialize(isFirstRecurringPayment = nil, isFirstSubsequentAuth = nil, isSub end end - #{AnetApi/xml/v1/schema/AnetApiSchema.xsd}subsequentAuthInformation - # originalNetworkTransId - SOAP::SOAPString - # reason - MerchantInitTransReasonEnum - class SubsequentAuthInformation + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}authIndicatorEnum + class AuthIndicatorEnum < ::String + Pre = AuthIndicatorEnum.new("pre") + Final = AuthIndicatorEnum.new("final") + end + + #{AnetApi/xml/v1/schema/AnetApiSchema.xsd}authorizationIndicatorType + # authorizationIndicator - AuthIndicatorEnum + class AuthorizationIndicatorType include ROXML - xml_accessor :originalNetworkTransId - xml_accessor :reason #, as: MerchantInitTransReasonEnum + xml_accessor :authorizationIndicator #, as: AuthIndicatorEnum - def initialize(originalNetworkTransId = nil, reason = nil) - @originalNetworkTransId = originalNetworkTransId - @reason = reason - + def initialize(authorizationIndicator = nil) + @authorizationIndicator = authorizationIndicator end end @@ -1612,8 +1644,9 @@ class ProfileTransOrderType xml_accessor :splitTenderId xml_accessor :processingOptions xml_accessor :subsequentAuthInformation + xml_accessor :authorizationIndicatorType - def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = [], customerProfileId = nil, customerPaymentProfileId = nil, customerShippingAddressId = nil, order = nil, taxExempt = nil, recurringBilling = nil, cardCode = nil, splitTenderId = nil, processingOptions = nil, subsequentAuthInformation = nil) + def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = [], customerProfileId = nil, customerPaymentProfileId = nil, customerShippingAddressId = nil, order = nil, taxExempt = nil, recurringBilling = nil, cardCode = nil, splitTenderId = nil, processingOptions = nil, subsequentAuthInformation = nil, authorizationIndicatorType = nil) @amount = amount @tax = tax @shipping = shipping @@ -1629,6 +1662,7 @@ def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = @splitTenderId = splitTenderId @processingOptions = processingOptions @subsequentAuthInformation = subsequentAuthInformation + @authorizationIndicatorType = authorizationIndicatorType end end @@ -2250,6 +2284,10 @@ def initialize(nationalTaxAmount = nil, localTaxAmount = nil, alternateTaxAmount # profile - CustomerProfileIdType # otherTax - OtherTaxType # shipFrom - NameAndAddressType + # networkTransId - SOAP::SOAPString + # originalNetworkTransId - SOAP::SOAPString + # originalAuthAmount - SOAP::SOAPDecimal + # authorizationIndicator - SOAP::SOAPString class TransactionDetailsType include ROXML # inner class for member: EmvDetails @@ -2320,8 +2358,12 @@ def initialize(tag = nil) xml_accessor :tip, as: ExtendedAmountType xml_accessor :otherTax, as: OtherTaxType xml_accessor :shipFrom, as: NameAndAddressType + xml_accessor :networkTransId + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount + xml_accessor :authorizationIndicator - def initialize(transId = nil, refTransId = nil, splitTenderId = nil, submitTimeUTC = nil, submitTimeLocal = nil, transactionType = nil, transactionStatus = nil, responseCode = nil, responseReasonCode = nil, subscription = nil, responseReasonDescription = nil, authCode = nil, aVSResponse = nil, cardCodeResponse = nil, cAVVResponse = nil, fDSFilterAction = nil, fDSFilters = nil, batch = nil, order = nil, requestedAmount = nil, authAmount = nil, settleAmount = nil, tax = nil, shipping = nil, duty = nil, lineItems = nil, prepaidBalanceRemaining = nil, taxExempt = nil, payment = nil, customer = nil, billTo = nil, shipTo = nil, recurringBilling = nil, customerIP = nil, product = nil, marketType = nil, mobileDeviceId = nil, returnedItems = nil, solution = nil, emvDetails = nil, profile = nil, surcharge = nil, employeeId = nil, tip = nil, otherTax= nil, shipFrom = nil) + def initialize(transId = nil, refTransId = nil, splitTenderId = nil, submitTimeUTC = nil, submitTimeLocal = nil, transactionType = nil, transactionStatus = nil, responseCode = nil, responseReasonCode = nil, subscription = nil, responseReasonDescription = nil, authCode = nil, aVSResponse = nil, cardCodeResponse = nil, cAVVResponse = nil, fDSFilterAction = nil, fDSFilters = nil, batch = nil, order = nil, requestedAmount = nil, authAmount = nil, settleAmount = nil, tax = nil, shipping = nil, duty = nil, lineItems = nil, prepaidBalanceRemaining = nil, taxExempt = nil, payment = nil, customer = nil, billTo = nil, shipTo = nil, recurringBilling = nil, customerIP = nil, product = nil, marketType = nil, mobileDeviceId = nil, returnedItems = nil, solution = nil, emvDetails = nil, profile = nil, surcharge = nil, employeeId = nil, tip = nil, otherTax= nil, shipFrom = nil, networkTransId = nil, originalNetworkTransId = nil, originalAuthAmount = nil, authorizationIndicator = nil) @transId = transId @refTransId = refTransId @splitTenderId = splitTenderId @@ -2368,6 +2410,10 @@ def initialize(transId = nil, refTransId = nil, splitTenderId = nil, submitTimeU @tip = tip @otherTax = otherTax @shipFrom = shipFrom + @networkTransId = networkTransId + @originalNetworkTransId = originalNetworkTransId + @originalAuthAmount = originalAuthAmount + @authorizationIndicator = authorizationIndicator end end @@ -3073,6 +3119,8 @@ class SettingNameEnum < ::String TestRequest = SettingNameEnum.new("testRequest") TypeEmailReceipt = SettingNameEnum.new("typeEmailReceipt") HostedProfilePaymentOptions = SettingNameEnum.new("hostedProfilePaymentOptions") + HostedProfileSaveButtonText = SettingNameEnum.new("hostedProfileSaveButtonText") + HostedPaymentVisaCheckoutOptions = SettingNameEnum.new("hostedPaymentVisaCheckoutOptions") end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ARBGetSubscriptionListSearchTypeEnum @@ -4613,6 +4661,7 @@ def initialize(customerProfileSummaryType = nil, paymentSimpleType = nil, accoun # subsequentAuthInformation - SubsequentAuthInformation # otherTax - OtherTaxType # shipFrom - NameAndAddressType + # authorizationIndicatorType - AuthorizationIndicatorType class TransactionRequestType include ROXML @@ -4650,8 +4699,9 @@ class TransactionRequestType xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation xml_accessor :otherTax, as: OtherTaxType xml_accessor :shipFrom, as: NameAndAddressType + xml_accessor :authorizationIndicatorType, as: AuthorizationIndicatorType - def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment = nil, profile = nil, solution = nil, callId = nil, authCode = nil, refTransId = nil, splitTenderId = nil, order = nil, lineItems = nil, tax = nil, duty = nil, shipping = nil, taxExempt = nil, poNumber = nil, customer = nil, billTo = nil, shipTo = nil, customerIP = nil, cardholderAuthentication = nil, retail = nil, transactionSettings = nil, userFields = nil, surcharge = nil, merchantDescriptor = nil, subMerchant = nil, tip = nil, employeeId = nil, processingOptions = nil, subsequentAuthInformation= nil, otherTax = nil, shipFrom = nil) + def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment = nil, profile = nil, solution = nil, callId = nil, authCode = nil, refTransId = nil, splitTenderId = nil, order = nil, lineItems = nil, tax = nil, duty = nil, shipping = nil, taxExempt = nil, poNumber = nil, customer = nil, billTo = nil, shipTo = nil, customerIP = nil, cardholderAuthentication = nil, retail = nil, transactionSettings = nil, userFields = nil, surcharge = nil, merchantDescriptor = nil, subMerchant = nil, tip = nil, employeeId = nil, processingOptions = nil, subsequentAuthInformation= nil, otherTax = nil, shipFrom = nil, authorizationIndicatorType = nil) @transactionType = transactionType @amount = amount @currencyCode = currencyCode @@ -4686,6 +4736,7 @@ def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment @subsequentAuthInformation= subsequentAuthInformation @otherTax = otherTax @shipFrom = shipFrom + @authorizationIndicatorType = authorizationIndicatorType end end @@ -4734,6 +4785,8 @@ def initialize(refId = nil, messages = nil, sessionToken = nil, transactionRespo # customerProfileId - SOAP::SOAPInt # billTo - CustomerAddressType # payment - PaymentMaskedType + # originalNetworkTransId - SOAP::SOAPString + # originalAuthAmount - SOAP::SOAPDecimal class CustomerPaymentProfileListItemType include ROXML xml_accessor :defaultPaymentProfile @@ -4741,13 +4794,18 @@ class CustomerPaymentProfileListItemType xml_accessor :customerProfileId xml_accessor :billTo, as: CustomerAddressType xml_accessor :payment, as: PaymentMaskedType + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount + - def initialize(customerPaymentProfileId = nil, customerProfileId = nil, billTo = nil, payment = nil, defaultPaymentProfile = nil) + def initialize(customerPaymentProfileId = nil, customerProfileId = nil, billTo = nil, payment = nil, defaultPaymentProfile = nil, originalNetworkTransId = nil, originalAuthAmount = nil) @customerPaymentProfileId = customerPaymentProfileId @customerProfileId = customerProfileId @billTo = billTo @payment = payment @defaultPaymentProfile = defaultPaymentProfile + @originalNetworkTransId = originalNetworkTransId + @originalAuthAmount = originalAuthAmount end end @@ -5211,6 +5269,7 @@ class PaymentMethodsTypeEnum < ::String VisaCheckout = PaymentMethodsTypeEnum.new("VisaCheckout") ApplePay = PaymentMethodsTypeEnum.new("ApplePay") AndroidPay = PaymentMethodsTypeEnum.new("AndroidPay") + GooglePay = PaymentMethodsTypeEnum.new("GooglePay") end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfPaymentMethod