diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 4b75390..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -service_name: travis-ci -src_dir: lib/authorize_net/api diff --git a/.github/workflows/ruby-workflow.yml b/.github/workflows/ruby-workflow.yml new file mode 100644 index 0000000..1f4c0f1 --- /dev/null +++ b/.github/workflows/ruby-workflow.yml @@ -0,0 +1,72 @@ +name: Authorize.net Ruby CI +on: + push: + pull_request: + workflow_dispatch: +env: + sdk_ruby: 'sdk-ruby' + sample_code_ruby: 'sample-code-ruby' +jobs: + workflow-job: + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, macos-latest, windows-latest] + ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] + exclude: + - operating-system: macos-latest + ruby-version: '2.4' + - operating-system: macos-latest + ruby-version: '2.5' + include: + - operating-system: macos-13 + ruby-version: '2.4' + - operating-system: macos-13 + ruby-version: '2.5' + runs-on: ${{matrix.operating-system}} + env: + API_LOGIN_ID: 5KP3u95bQpv + API_TRANSACTION_KEY: 346HZ32z3fP4hTG2 + MD5_VALUE: 'MD5_TEST' + steps: + - name: Creating separate folders for SDK and Sample Codes + run: | + rm -rf $sdk_ruby + rm -rf $sample_code_ruby + mkdir $sdk_ruby $sample_code_ruby + + - name: Checkout authorizenet/sdk-ruby + uses: actions/checkout@v4 + with: + path: ${{env.sdk_ruby}} + + + - name: Checkout authorizenet/sample-code-ruby + uses: actions/checkout@v4 + with: + repository: 'authorizenet/sample-code-ruby' + ref: 'future' # Remove this line before pushing to master branch + path: ${{env.sample_code_ruby}} + + + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby-version}} + + + - name: Install and Test + run: | + cd $sdk_ruby + bundle install + rake gem + PACKAGE_VERSION=$(cat authorizenet.gemspec | grep -w s.version | cut -d '"' -f 2) + bundle exec rake spec + + cd ../$sample_code_ruby + gem install ../$sdk_ruby/authorizenet-$PACKAGE_VERSION.gem + bundle install + bundle exec rspec spec/sample_code_spec.rb \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 5424b7a..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,19 +0,0 @@ -AllCops: - TargetRubyVersion: 2.2 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - Exclude: - - 'sample-code-ruby/**/*' - -Style/FrozenStringLiteralComment: - Enabled: false - -# Check quotes usage according to lint rule below. -Style/StringLiterals: - Enabled: true - EnforcedStyle: single_quotes - AutoCorrect: false - -Style/ConditionalAssignment: - Enabled: true - AutoCorrect: false diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 25f68ed..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,6 +0,0 @@ -checks: - ruby: - code_rating: true - duplicate_code: true -tools: - external_code_coverage: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5cafe28..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: ruby - -sudo: - false - -rvm: - # RETIRING 2.2 and 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - 3.0 - -gemfile: - - gemfiles/rails_42.gemfile - - gemfiles/rails_50.gemfile - - gemfiles/rails_51.gemfile - - gemfiles/rails_52.gemfile - -matrix: - allow_failures: - - gemfile: gemfiles/rails_42.gemfile - -before_script: - - git submodule update --remote --recursive - -script: - - bundle exec rake spec:testrunner - -env: - global: - - API_LOGIN_ID=5KP3u95bQpv - - API_TRANSACTION_KEY=346HZ32z3fP4hTG2 - - MD5_VALUE='MD5_TEST' - diff --git a/Appraisals b/Appraisals deleted file mode 100644 index 3b875c3..0000000 --- a/Appraisals +++ /dev/null @@ -1,15 +0,0 @@ -appraise "rails-42" do - gem "rails", "4.2.6" -end - -appraise "rails-50" do - gem 'rails', '~> 5.0', '>= 5.0.3' -end - -appraise "rails-51" do - gem 'rails', '~> 5.1', '>= 5.1.1' -end - -appraise "rails-52" do - gem 'rails', '~> 5.2.0.beta2' -end diff --git a/README.md b/README.md index d9561a0..2608008 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ # Authorize.Net Ruby SDK +[![Authorize.net Ruby CI](https://github.com/AuthorizeNet/sdk-ruby/actions/workflows/ruby-workflow.yml/badge.svg?branch=master)](https://github.com/AuthorizeNet/sdk-ruby/actions/workflows/ruby-workflow.yml) [![Version ][rubygems_badge]][rubygems] -[![Travis CI ][travis_badge]][travis] -[![Coverage ][coverage_badge]][coverage] -[![Scrutinizer ][scrutinizer_badge]][scrutinizer] Starting Release 1.8.6 November 2015 the Authorize.Net API has been [reorganized to be more merchant focused](https://developer.authorize.net/api/upgrade_guide/). AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of sdk-ruby/lib/authorize_net/api. ## Requirements -* Ruby 2.2.2 or higher +* Ruby 2.4 or higher * RubyGem 1.3.7 or higher (to build the gem) * RDoc 1.0 or higher (to build documentation) * Rake 0.8.7 or higher (to use the rake tasks) @@ -39,7 +37,7 @@ The Authorize.Net API only support connections using the TLS 1.2 security protoc ``` > bundle install > rake gem - > sudo gem install ./authorizenet-1.9.3.gem + > sudo gem install ./authorizenet-.gem ``` @@ -111,10 +109,6 @@ To run the integration tests in the sandbox: ``` rake spec ``` -To run the unit tests: -``` -rake spec:ci -``` To run rspec tests, create a spec/credentials.yml with the following credentials and the values obtained as described below. ```ruby @@ -156,10 +150,4 @@ Authorize.Net is phasing out the MD5 based `transHash` element in favor of the S This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file. [rubygems_badge]: https://badge.fury.io/rb/authorizenet.svg -[rubygems]: https://rubygems.org/gems/authorizenet -[travis_badge]: https://travis-ci.org/AuthorizeNet/sdk-ruby.svg?branch=master -[travis]: https://travis-ci.org/AuthorizeNet/sdk-ruby -[coverage_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/coverage.png?b=master -[coverage]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master -[scrutinizer_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/quality-score.png?b=master -[scrutinizer]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master +[rubygems]: https://rubygems.org/gems/authorizenet \ No newline at end of file diff --git a/Rakefile b/Rakefile index d79fff4..970e06c 100644 --- a/Rakefile +++ b/Rakefile @@ -9,48 +9,12 @@ RSpec::Core::RakeTask.new(:spec) do |spec| end namespace "spec" do - desc "Run the CIM spec" - RSpec::Core::RakeTask.new('cim') do |spec| - spec.pattern = FileList['spec/cim_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - - desc "Run the ARB spec" - RSpec::Core::RakeTask.new('arb') do |spec| - spec.pattern = FileList['spec/arb_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - - desc "Run the AIM spec" - RSpec::Core::RakeTask.new('aim') do |spec| - spec.pattern = FileList['spec/aim_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - desc "Run the API spec" RSpec::Core::RakeTask.new('api') do |spec| spec.pattern = FileList['spec/api_spec.rb'] spec.rspec_opts = ['--options', 'spec/spec.opts'] end - desc "Run the CI Unit Test spec" - RSpec::Core::RakeTask.new('ci') do |spec| - spec.pattern = FileList['spec/authorize_net_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - - desc "Run the SIM spec" - RSpec::Core::RakeTask.new('sim') do |spec| - spec.pattern = FileList['spec/sim_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - - desc "Run the Reporting spec" - RSpec::Core::RakeTask.new('reporting') do |spec| - spec.pattern = FileList['spec/reporting_spec.rb'] - spec.rspec_opts = ['--options', 'spec/spec.opts'] - end - desc "Run the Sample code Test Runner" RSpec::Core::RakeTask.new('testrunner') do |spec| spec.pattern = FileList['sample-code-ruby/spec/sample_code_spec.rb'] diff --git a/authorizenet.gemspec b/authorizenet.gemspec index 5dbec85..38de589 100644 --- a/authorizenet.gemspec +++ b/authorizenet.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "authorizenet" - s.version = "2.0.1" + s.version = "2.0.2" s.platform = Gem::Platform::RUBY s.date = "2021-03-31" s.summary = "Authorize.Net Payments SDK" @@ -12,16 +12,13 @@ Gem::Specification.new do |s| s.license = "https://github.com/AuthorizeNet/sdk-ruby/blob/master/LICENSE.txt" s.required_ruby_version = '>= 2.4.0' - s.required_rubygems_version = '>= 1.3.6' + s.required_rubygems_version = '>= 1.3.7' 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', '~> 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/gemfiles/.bundle/config b/gemfiles/.bundle/config deleted file mode 100644 index c127f80..0000000 --- a/gemfiles/.bundle/config +++ /dev/null @@ -1,2 +0,0 @@ ---- -BUNDLE_RETRY: "1" diff --git a/gemfiles/rails_42.gemfile b/gemfiles/rails_42.gemfile deleted file mode 100644 index 4ed4b1f..0000000 --- a/gemfiles/rails_42.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "4.2.6" - -gemspec path: "../" diff --git a/gemfiles/rails_50.gemfile b/gemfiles/rails_50.gemfile deleted file mode 100644 index f7fdd2e..0000000 --- a/gemfiles/rails_50.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 5.0", ">= 5.0.3" - -gemspec path: "../" diff --git a/gemfiles/rails_51.gemfile b/gemfiles/rails_51.gemfile deleted file mode 100644 index 3d22a4c..0000000 --- a/gemfiles/rails_51.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 5.1", ">= 5.1.1" - -gemspec path: "../" diff --git a/gemfiles/rails_52.gemfile b/gemfiles/rails_52.gemfile deleted file mode 100644 index fce2ac8..0000000 --- a/gemfiles/rails_52.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 5.2.0.beta2" - -gemspec path: "../" diff --git a/lib/authorize_net/api/schema.rb b/lib/authorize_net/api/schema.rb index 85c608a..6c76c09 100644 --- a/lib/authorize_net/api/schema.rb +++ b/lib/authorize_net/api/schema.rb @@ -57,7 +57,7 @@ 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 @@ -244,14 +244,14 @@ class ContactDetailType include ROXML xml_accessor :email xml_accessor :firstName - xml_accessor :lastName + xml_accessor :lastName def initialize(email = nil, firstName = nil, lastName = nil) @email = email @firstName = firstName @lastName = lastName end end - + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}transRetailInfoType # marketType - SOAP::SOAPString # deviceType - SOAP::SOAPString @@ -757,7 +757,7 @@ def initialize(invoiceNumber = nil, description = nil, discountAmount = nil, tax @amexDataTAA2 = amexDataTAA2 @amexDataTAA3 = amexDataTAA3 @amexDataTAA4 = amexDataTAA4 - + end end @@ -1242,13 +1242,13 @@ def initialize(amount = nil, name = nil, description = nil) #{AnetApi/xml/v1/schema/AnetApiSchema.xsd}subsequentAuthInformation # originalNetworkTransId - SOAP::SOAPString # originalAuthAmount - SOAP::SOAPDecimal - # reason - MerchantInitTransReasonEnum + # reason - MerchantInitTransReasonEnum class SubsequentAuthInformation include ROXML xml_accessor :originalNetworkTransId - xml_accessor :originalAuthAmount - xml_accessor :reason #, as: MerchantInitTransReasonEnum - + xml_accessor :originalAuthAmount + xml_accessor :reason #, as: MerchantInitTransReasonEnum + def initialize(originalNetworkTransId = nil, originalAuthAmount = nil, reason = nil) @originalNetworkTransId = originalNetworkTransId @reason = reason @@ -1272,16 +1272,18 @@ class CustomerPaymentProfileType xml_accessor :driversLicense, as: DriversLicenseType xml_accessor :taxId xml_accessor :defaultPaymentProfile - xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation + xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation + xml_accessor :excludeFromAccountUpdater - def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil, subsequentAuthInformation = nil) + def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil, subsequentAuthInformation = nil, excludeFromAccountUpdater = nil) @customerType = customerType @billTo = billTo @payment = payment @driversLicense = driversLicense @taxId = taxId @defaultPaymentProfile = defaultPaymentProfile - @subsequentAuthInformation = subsequentAuthInformation + @subsequentAuthInformation = subsequentAuthInformation + @excludeFromAccountUpdater = excludeFromAccountUpdater end end @@ -1291,6 +1293,8 @@ def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = # payment - PaymentType # driversLicense - DriversLicenseType # taxId - SOAP::SOAPString + # defaultPaymentProfile - SOAP::SOAPBoolean + # subsequentAuthInformation - SubsequentAuthInformation # customerPaymentProfileId - (any) class CustomerPaymentProfileExType include ROXML @@ -1299,14 +1303,18 @@ class CustomerPaymentProfileExType xml_accessor :payment, as: PaymentType xml_accessor :driversLicense, as: DriversLicenseType xml_accessor :taxId + xml_accessor :defaultPaymentProfile + xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation xml_accessor :customerPaymentProfileId - def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, customerPaymentProfileId = nil) + def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil, subsequentAuthInformation = nil, customerPaymentProfileId = nil) @customerType = customerType @billTo = billTo @payment = payment @driversLicense = driversLicense @taxId = taxId + @defaultPaymentProfile = defaultPaymentProfile + @subsequentAuthInformation = subsequentAuthInformation @customerPaymentProfileId = customerPaymentProfileId end end @@ -1327,6 +1335,7 @@ def initialize(subscriptionId = nil) # billTo - CustomerAddressType # customerProfileId - (any) # customerPaymentProfileId - (any) + # defaultPaymentProfile - SOAP::SOAPBoolean # payment - PaymentMaskedType # driversLicense - DriversLicenseMaskedType # taxId - SOAP::SOAPString @@ -1342,10 +1351,11 @@ class CustomerPaymentProfileMaskedType xml_accessor :driversLicense, as: DriversLicenseMaskedType xml_accessor :taxId xml_accessor :subscriptionIds, as: SubscriptionIdList - xml_accessor :originalNetworkTransId - xml_accessor :originalAuthAmount + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount + xml_accessor :excludeFromAccountUpdater - def initialize(customerType = nil, billTo = nil, customerProfileId = nil, customerPaymentProfileId = nil, payment = nil, driversLicense = nil, taxId = nil, subscriptionIds = nil, defaultPaymentProfile = nil, originalNetworkTransId = nil, originalAuthAmount = 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, excludeFromAccountUpdater = nil) @customerType = customerType @billTo = billTo @customerProfileId = customerProfileId @@ -1355,8 +1365,9 @@ def initialize(customerType = nil, billTo = nil, customerProfileId = nil, custom @taxId = taxId @subscriptionIds = subscriptionIds @defaultPaymentProfile = defaultPaymentProfile - @originalAuthAmount = originalAuthAmount - @originalNetworkTransId = originalNetworkTransId + @originalAuthAmount = originalAuthAmount + @originalNetworkTransId = originalNetworkTransId + @excludeFromAccountUpdater = excludeFromAccountUpdater end end @@ -1474,7 +1485,7 @@ def initialize(merchantCustomerId = nil, description = nil, email = nil, custome @profileType = profileType end end - + # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}lineItemType # itemId - SOAP::SOAPString @@ -1531,7 +1542,7 @@ class LineItemType xml_accessor :discountAmount, as: BigDecimal xml_accessor :taxIncludedInTotal xml_accessor :taxIsAfterDiscount - + def initialize(itemId = nil, name = nil, description = nil, quantity = nil, unitPrice = nil, taxable = nil, unitOfMeasure = nil,typeOfSupply = nil, taxRate = nil, taxAmount = nil, nationalTax = nil, localTax = nil, vatRate = nil, alternateTaxId = nil, alternateTaxType = nil, alternateTaxTypeApplied = nil, alternateTaxRate = nil, alternateTaxAmount = nil, totalAmount = nil, commodityCode = nil, productCode = nil, productSKU = nil, discountRate = nil, discountAmount = nil, taxIncludedInTotal = nil, taxIsAfterDiscount = nil) @itemId = itemId @name = name @@ -1559,7 +1570,7 @@ def initialize(itemId = nil, name = nil, description = nil, quantity = nil, unit @discountAmount = discountAmount @taxIncludedInTotal = taxIncludedInTotal @taxIsAfterDiscount = taxIsAfterDiscount - + end end @@ -1577,20 +1588,20 @@ def initialize(lineItems = []) # isFirstRecurringPayment - SOAP::SOAPBoolean # isFirstSubsequentAuth - SOAP::SOAPBoolean # isSubsequentAuth - SOAP::SOAPBoolean - # isStoredCredentials - SOAP::SOAPBoolean + # isStoredCredentials - SOAP::SOAPBoolean class ProcessingOptions include ROXML xml_accessor :isFirstRecurringPayment xml_accessor :isFirstSubsequentAuth xml_accessor :isSubsequentAuth xml_accessor :isStoredCredentials - + def initialize(isFirstRecurringPayment = nil, isFirstSubsequentAuth = nil, isSubsequentAuth = nil, isStoredCredentials = nil) @isFirstRecurringPayment = isFirstRecurringPayment @isFirstSubsequentAuth = isFirstSubsequentAuth @isSubsequentAuth = isSubsequentAuth @isStoredCredentials = isStoredCredentials - + end end @@ -1599,13 +1610,13 @@ 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 :authorizationIndicator #, as: AuthIndicatorEnum - + def initialize(authorizationIndicator = nil) @authorizationIndicator = authorizationIndicator end @@ -1644,7 +1655,7 @@ class ProfileTransOrderType xml_accessor :splitTenderId xml_accessor :processingOptions xml_accessor :subsequentAuthInformation - xml_accessor :authorizationIndicatorType + 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, authorizationIndicatorType = nil) @amount = amount @@ -1662,7 +1673,7 @@ def initialize(amount = nil, tax = nil, shipping = nil, duty = nil, lineItems = @splitTenderId = splitTenderId @processingOptions = processingOptions @subsequentAuthInformation = subsequentAuthInformation - @authorizationIndicatorType = authorizationIndicatorType + @authorizationIndicatorType = authorizationIndicatorType end end @@ -2219,7 +2230,7 @@ def initialize(name = nil, action = nil) # nationalTaxAmount - SOAP::SOAPDecimal # localTaxAmount - SOAP::SOAPDecimal # alternateTaxAmount - SOAP::SOAPDecimal - # alternateTaxId - SOAP::SOAPString + # alternateTaxId - SOAP::SOAPString # vatTaxRate - SOAP::SOAPDecimal # vatTaxAmount - SOAP::SOAPDecimal class OtherTaxType @@ -2356,7 +2367,7 @@ def initialize(tag = nil) xml_accessor :surcharge, as: ExtendedAmountType xml_accessor :employeeId xml_accessor :tip, as: ExtendedAmountType - xml_accessor :otherTax, as: OtherTaxType + xml_accessor :otherTax, as: OtherTaxType xml_accessor :shipFrom, as: NameAndAddressType xml_accessor :networkTransId xml_accessor :originalNetworkTransId @@ -2653,7 +2664,7 @@ def initialize(tlvData = nil, tags = nil) xml_accessor :emvResponse, as: EmvResponse xml_accessor :transHashSha2 xml_accessor :profile, as: CustomerProfileIdType - xml_accessor :networkTransId + xml_accessor :networkTransId def initialize(responseCode = nil, rawResponseCode = nil, authCode = nil, avsResultCode = nil, cvvResultCode = nil, cavvResultCode = nil, transId = nil, refTransID = nil, transHash = nil, testRequest = nil, accountNumber = nil, accountType = nil, splitTenderId = nil, prePaidCard = nil, messages = nil, errors = nil, splitTenderPayments = nil, userFields = nil, shipTo = nil, secureAcceptance = nil, emvResponse = nil, transHashSha2 = nil, profile = nil,networkTransId = nil) @responseCode = responseCode @@ -3119,8 +3130,8 @@ class SettingNameEnum < ::String TestRequest = SettingNameEnum.new("testRequest") TypeEmailReceipt = SettingNameEnum.new("typeEmailReceipt") HostedProfilePaymentOptions = SettingNameEnum.new("hostedProfilePaymentOptions") - HostedProfileSaveButtonText = SettingNameEnum.new("hostedProfileSaveButtonText") - HostedPaymentVisaCheckoutOptions = SettingNameEnum.new("hostedPaymentVisaCheckoutOptions") + HostedProfileSaveButtonText = SettingNameEnum.new("hostedProfileSaveButtonText") + HostedPaymentVisaCheckoutOptions = SettingNameEnum.new("hostedPaymentVisaCheckoutOptions") end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ARBGetSubscriptionListSearchTypeEnum @@ -3457,6 +3468,7 @@ def initialize(refId = nil, messages = nil, sessionToken = nil, customerProfileI # refId - SOAP::SOAPString # customerProfileId - (any) # address - CustomerAddressType + # defaultShippingAddress - SOAP::SOAPBoolean class CreateCustomerShippingAddressRequest include ROXML xml_accessor :merchantAuthentication @@ -3502,7 +3514,9 @@ def initialize(refId = nil, messages = nil, sessionToken = nil, customerProfileI # refId - SOAP::SOAPString # transId - (any) # customer - CustomerProfileBaseType - # customerProfileId - NumericStringsType + # customerProfileId - (any) + # defaultPaymentProfile - SOAP::SOAPBoolean + # defaultShippingAddress - SOAP::SOAPBoolean # profileType - CustomerProfileTypeEnum class CreateCustomerProfileFromTransactionRequest include ROXML @@ -3510,7 +3524,7 @@ class CreateCustomerProfileFromTransactionRequest xml_accessor :refId xml_accessor :transId xml_accessor :customer, as: CustomerProfileBaseType - xml_accessor :customerProfileId, as: NumericStringsType + xml_accessor :customerProfileId # This should NOT be NumericStringsType because NumericStringsType is an array type, not the base type. xml_accessor :defaultPaymentProfile xml_accessor :defaultShippingAddress xml_accessor :profileType @@ -3647,6 +3661,7 @@ def initialize(merchantAuthentication = nil, refId = nil, customerProfileId = ni # refId - SOAP::SOAPString # messages - MessagesType # sessionToken - SOAP::SOAPString + # defaultShippingAddress - SOAP::SOAPBoolean # address - CustomerAddressExType # subscriptionIds - SubscriptionIdList class GetCustomerShippingAddressResponse @@ -3676,7 +3691,7 @@ class UpdateCustomerProfileRequest include ROXML xml_accessor :merchantAuthentication xml_accessor :refId - xml_accessor :profile, as: CustomerProfileExType + xml_accessor :profile, as: CustomerProfileInfoExType def initialize(merchantAuthentication = nil, refId = nil, profile = nil) @merchantAuthentication = merchantAuthentication @@ -3750,6 +3765,7 @@ def initialize(refId = nil, messages = nil, sessionToken = nil, validationDirect # refId - SOAP::SOAPString # customerProfileId - (any) # address - CustomerAddressExType + # defaultShippingAddress - SOAP::SOAPBoolean class UpdateCustomerShippingAddressRequest include ROXML xml_accessor :merchantAuthentication @@ -4699,7 +4715,7 @@ class TransactionRequestType xml_accessor :subsequentAuthInformation, as: SubsequentAuthInformation xml_accessor :otherTax, as: OtherTaxType xml_accessor :shipFrom, as: NameAndAddressType - xml_accessor :authorizationIndicatorType, as: AuthorizationIndicatorType + 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, authorizationIndicatorType = nil) @transactionType = transactionType @@ -4736,7 +4752,7 @@ def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment @subsequentAuthInformation= subsequentAuthInformation @otherTax = otherTax @shipFrom = shipFrom - @authorizationIndicatorType = authorizationIndicatorType + @authorizationIndicatorType = authorizationIndicatorType end end @@ -4781,6 +4797,7 @@ def initialize(refId = nil, messages = nil, sessionToken = nil, transactionRespo end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}customerPaymentProfileListItemType + # defaultPaymentProfile - SOAP::SOAPBoolean # customerPaymentProfileId - SOAP::SOAPInt # customerProfileId - SOAP::SOAPInt # billTo - CustomerAddressType @@ -4794,18 +4811,20 @@ class CustomerPaymentProfileListItemType xml_accessor :customerProfileId xml_accessor :billTo, as: CustomerAddressType xml_accessor :payment, as: PaymentMaskedType - xml_accessor :originalNetworkTransId - xml_accessor :originalAuthAmount - + xml_accessor :originalNetworkTransId + xml_accessor :originalAuthAmount + xml_accessor :excludeFromAccountUpdater + - def initialize(customerPaymentProfileId = nil, customerProfileId = nil, billTo = nil, payment = nil, defaultPaymentProfile = nil, originalNetworkTransId = nil, originalAuthAmount = nil) + def initialize(customerPaymentProfileId = nil, customerProfileId = nil, billTo = nil, payment = nil, defaultPaymentProfile = nil, originalNetworkTransId = nil, originalAuthAmount = nil, excludeFromAccountUpdater = nil) @customerPaymentProfileId = customerPaymentProfileId @customerProfileId = customerProfileId @billTo = billTo @payment = payment @defaultPaymentProfile = defaultPaymentProfile - @originalNetworkTransId = originalNetworkTransId - @originalAuthAmount = originalAuthAmount + @originalNetworkTransId = originalNetworkTransId + @originalAuthAmount = originalAuthAmount + @excludeFromAccountUpdater = excludeFromAccountUpdater end end @@ -5269,7 +5288,7 @@ class PaymentMethodsTypeEnum < ::String VisaCheckout = PaymentMethodsTypeEnum.new("VisaCheckout") ApplePay = PaymentMethodsTypeEnum.new("ApplePay") AndroidPay = PaymentMethodsTypeEnum.new("AndroidPay") - GooglePay = PaymentMethodsTypeEnum.new("GooglePay") + GooglePay = PaymentMethodsTypeEnum.new("GooglePay") end # {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfPaymentMethod diff --git a/spec/api_spec.rb b/spec/api_spec.rb index d780bf1..0306aa4 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -1,4 +1,5 @@ require "spec_helper" +require "active_support" include AuthorizeNet::API describe Transaction do @@ -543,7 +544,7 @@ @api_login, @api_key = '5KP3u95bQpv', '346HZ32z3fP4hTG2' # FIXME: this spec added in #72 depends on a hard coded test account. transaction = AuthorizeNet::API::Transaction.new(@api_login, @api_key, gateway: @gateway) - batchId = "4551107" + batchId = "15181378" @getTransactionListRequest = GetTransactionListRequest.new @getTransactionListRequest.batchId = batchId diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 92dc31f..ac10e8e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,18 +1,19 @@ -require 'simplecov' -SimpleCov.start +# require 'simplecov' +# SimpleCov.start -require 'scrutinizer/ocular' -Scrutinizer::Ocular.watch! +# require 'scrutinizer/ocular' +# Scrutinizer::Ocular.watch! require "authorizenet" require "yaml" +require "active_support" -ActiveSupport::Deprecation.behavior = lambda do |msg, stack| - # when running this test suite ignore our own deprecation warnings - unless /use AuthorizeNet::API::Transaction/ =~ msg - ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:stderr].call(msg,stack) - end -end +# ActiveSupport::Deprecation.behavior = lambda do |msg, stack| +# # when running this test suite ignore our own deprecation warnings +# unless /use AuthorizeNet::API::Transaction/ =~ msg +# ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:stderr].call(msg, stack, ActiveSupport::Deprecation.new) +# end +# end Dir['./spec/support/**/*.rb'].each { |f| require f }