activemerchant/active_merchant

View on GitHub

Showing 999 of 1,496 total issues

Class DigitzsGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

    class DigitzsGateway < Gateway
      include Empty

      self.test_url = 'https://beta.digitzsapi.com/sandbox'
      self.live_url = 'https://beta.digitzsapi.com/v3'
Severity: Minor
Found in lib/active_merchant/billing/gateways/digitzs.rb - About 4 hrs to fix

    Class PaymentExpressGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class PaymentExpressGateway < Gateway
          self.default_currency = 'NZD'
          # PS supports all major credit cards; Visa, Mastercard, Amex, Diners, BankCard & JCB.
          # Various white label cards can be accepted as well; Farmers, AirNZCard and Elders etc.
          # Please note that not all acquirers and Eftpos networks can support some of these card types.
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/payment_express.rb - About 4 hrs to fix

      Class NetbanxGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class NetbanxGateway < Gateway
            # Netbanx is the new REST based API for Optimal Payments / Paysafe
            self.test_url = 'https://api.test.netbanx.com/'
            self.live_url = 'https://api.netbanx.com/'
      
      
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/netbanx.rb - About 4 hrs to fix

        Class QvalentGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class QvalentGateway < Gateway
              self.display_name = 'Qvalent'
              self.homepage_url = 'https://www.qvalent.com/'
        
              self.test_url = 'https://ccapi.client.support.qvalent.com/post/CreditCardAPIReceiver'
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/qvalent.rb - About 4 hrs to fix

          Class SageGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class SageGateway < Gateway
                include Empty
          
                self.display_name = 'http://www.sagepayments.com'
                self.homepage_url = 'Sage Payment Solutions'
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/sage.rb - About 4 hrs to fix

            Class TrustCommerceGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class TrustCommerceGateway < Gateway
                  self.live_url = self.test_url = 'https://vault.trustcommerce.com/trans/'
            
                  SUCCESS_TYPES = %w[approved accepted]
            
            
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/trust_commerce.rb - About 4 hrs to fix

              Class MokaGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class MokaGateway < Gateway
                    self.test_url = 'https://service.refmoka.com'
                    self.live_url = 'https://service.moka.com'
              
                    self.supported_countries = %w[GB TR US]
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/moka.rb - About 4 hrs to fix

                File paysafe.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module ActiveMerchant #:nodoc:
                  module Billing #:nodoc:
                    class PaysafeGateway < Gateway
                      self.test_url = 'https://api.test.paysafe.com'
                      self.live_url = 'https://api.paysafe.com'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/paysafe.rb - About 3 hrs to fix

                  Method add_card_or_token_customer_data has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def add_card_or_token_customer_data(xml, credit_card, options)
                          xml.hps :CardHolderData do
                            if credit_card.respond_to?(:number)
                              xml.hps :CardHolderFirstName, credit_card.first_name if credit_card.first_name
                              xml.hps :CardHolderLastName, credit_card.last_name if credit_card.last_name
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/hps.rb - About 3 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method add_transaction_details has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def add_transaction_details(xml, options, pre_order = false)
                          requires!(options, :order_id) if pre_order
                          xml.tag!('v1:TransactionDetails') do
                            xml.tag!('v1:OrderId', options[:order_id]) if options[:order_id]
                            xml.tag!('v1:MerchantTransactionId', options[:merchant_transaction_id]) if options[:merchant_transaction_id]
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/ipg.rb - About 3 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method build_new_order_xml has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def build_new_order_xml(action, money, payment_source, parameters = {})
                          requires!(parameters, :order_id)
                          @use_secondary_url = parameters[:use_secondary_url] if parameters[:use_secondary_url]
                          xml = xml_envelope
                          xml.tag! :Request do
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/orbital.rb - About 3 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  File ogone.rb has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'rexml/document'
                  
                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      # = Ogone DirectLink Gateway
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/ogone.rb - About 3 hrs to fix

                    File realex.rb has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'nokogiri'
                    require 'digest/sha1'
                    
                    module ActiveMerchant
                      module Billing
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/realex.rb - About 3 hrs to fix

                      File deepstack.rb has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module ActiveMerchant #:nodoc:
                        module Billing #:nodoc:
                          class DeepstackGateway < Gateway
                            self.test_url = 'https://api.sandbox.deepstack.io'
                            self.live_url = 'https://api.deepstack.io'
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/deepstack.rb - About 3 hrs to fix

                        Class SecurionPayGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class SecurionPayGateway < Gateway
                              self.test_url = 'https://api.securionpay.com/'
                              self.live_url = 'https://api.securionpay.com/'
                        
                              self.supported_countries = %w(AD BE BG CH CY CZ DE DK EE ES FI FO FR GI GL GR GS GT HR HU IE IS IT LI LR LT
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/securion_pay.rb - About 3 hrs to fix

                          Class WorldNetGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class WorldNetGateway < Gateway
                                self.test_url = 'https://testpayments.worldnettps.com/merchant/xmlpayment'
                                self.live_url = 'https://payments.worldnettps.com/merchant/xmlpayment'
                          
                                self.homepage_url = 'http://worldnettps.com/'
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/world_net.rb - About 3 hrs to fix

                            Class IxopayGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class IxopayGateway < Gateway
                                  self.test_url = 'https://secure.ixopay.com/transaction'
                                  self.live_url = 'https://secure.ixopay.com/transaction'
                            
                                  self.supported_countries = %w(AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW)
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/ixopay.rb - About 3 hrs to fix

                              Class OppGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class OppGateway < Gateway
                                    # = Open Payment Platform
                                    #
                                    #  The Open Payment Platform includes a powerful omni-channel transaction processing API,
                                    #   enabling you to quickly and flexibly build new applications and services on the platform.
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/opp.rb - About 3 hrs to fix

                                Class EwayRapidGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                    class EwayRapidGateway < Gateway
                                      self.test_url = 'https://api.sandbox.ewaypayments.com/'
                                      self.live_url = 'https://api.ewaypayments.com/'
                                
                                      self.money_format = :cents
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/eway_rapid.rb - About 3 hrs to fix

                                  Class HiPayGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                      class HiPayGateway < Gateway
                                        # to add more check => payment_product_list: https://developer.hipay.com/api-explorer/api-online-payments#/payments/generateHostedPaymentPage
                                        PAYMENT_PRODUCT = {
                                          'visa' => 'visa',
                                          'master' => 'mastercard'
                                  Severity: Minor
                                  Found in lib/active_merchant/billing/gateways/hi_pay.rb - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language