<commit_before>require "active_support/concern"
# @module FlexCommerce::PaypalExpress::Api
module FlexCommerce
  module PaypalExpress
    # A concern for use in paypal express services that need access to the API
    module Api
      extend ActiveSupport::Concern

      private

      def convert_amount(amount)
        (amount * 100.0).round.to_i
      end

      def gateway
        verify_credentials

        @gateway ||= gateway_class.new(
          test: test_mode,
          login: paypal_login,
          password: <PASSWORD>,
          signature: paypal_signature)
      end

      def verify_credentials
        unless paypal_login.present? && paypal_password.present? && paypal_signature.present? then
          raise "Please ensure all Paypal Credentails are set in your env file." 
        end
      end

      # DEFAULT value for test mode is true.
      def test_mode
        FlexCommerceApi.config.order_test_mode == true
      end

      # PAYPAL CREDENTAILS

      def paypal_login
        FlexCommerceApi.config.paypal_login
      end

      def paypal_password
        <PASSWORD>CommerceApi.config.paypal_password
      end

      def paypal_signature
        FlexCommerceApi.config.paypal_signature
      end
    end
  end
end<commit_msg>set the order test mode<commit_after>require "active_support/concern"
# @module FlexCommerce::PaypalExpress::Api
module FlexCommerce
  module PaypalExpress
    # A concern for use in paypal express services that need access to the API
    module Api
      extend ActiveSupport::Concern

      private

      def convert_amount(amount)
        (amount * 100.0).round.to_i
      end

      def gateway
        verify_credentials

        @gateway ||= gateway_class.new(
          test: test_mode,
          login: paypal_login,
          password: <PASSWORD>,
          signature: paypal_signature)
      end

      def verify_credentials
        unless paypal_login.present? && paypal_password.present? && paypal_signature.present? then
          raise "Please ensure all Paypal Credentails are set in your env file." 
        end
      end

      # DEFAULT value for test mode is true.
      def test_mode
        FlexCommerceApi.config.order_test_mode || true
      end

      # PAYPAL CREDENTAILS

      def paypal_login
        FlexCommerceApi.config.paypal_login
      end

      def paypal_password
        <PASSWORD>.config.paypal_password
      end

      def paypal_signature
        FlexCommerceApi.config.paypal_signature
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.05319571258435887, 'fraction_numerical': 0.0031758634378721714, 'mean_word_length': 2.302752293577982, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6115584', 'n_tokens_mistral': 741, 'n_tokens_neox': 694, 'n_words': 195}