Sha256: 78ee567af57f0fa9329083837fb14435ef3ddbe8b8e9718680021fe2cf12cf4a

Contents?: true

Size: 1.9 KB

Versions: 8

Compression:

Stored size: 1.9 KB

Contents

# frozen_string_literal: true

require 'httparty'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/object/blank'

require 'bs2_api/version'
require 'bs2_api/configuration'

require 'bs2_api/util/response'

require 'bs2_api/errors/base'
require 'bs2_api/errors/invalid_pix_key'
require 'bs2_api/errors/invalid_bank'
require 'bs2_api/errors/invalid_customer'
require 'bs2_api/errors/missing_configuration'
require 'bs2_api/errors/refund_error'
require 'bs2_api/errors/unauthorized'
require 'bs2_api/errors/bad_request'
require 'bs2_api/errors/server_error'
require 'bs2_api/errors/confirmation_error'
require 'bs2_api/errors/missing_bank'

require 'bs2_api/entities/account'
require 'bs2_api/entities/bank'
require 'bs2_api/entities/customer'
require 'bs2_api/entities/payment'
require 'bs2_api/entities/pix_key'
require 'bs2_api/entities/async_request'
require 'bs2_api/entities/async_response'
require 'bs2_api/entities/async_status'

require 'bs2_api/pix/detail'

require 'bs2_api/payment/base'
require 'bs2_api/payment/key'
require 'bs2_api/payment/manual'
require 'bs2_api/payment/confirmation'
require 'bs2_api/payment/detail'
require 'bs2_api/payment/async'

require 'bs2_api/request/auth'

require 'bs2_api/refund/pix/create'
require 'bs2_api/refund/pix/detail'

module Bs2Api
  ENDPOINT = {
    production: 'https://api.bs2.com',
    sandbox: 'https://apihmz.bancobonsucesso.com.br'
  }.freeze

  class << self
    attr_writer :configuration

    def configuration
      @configuration ||= Configuration.new
    end

    def configure
      yield(configuration)
    end

    def endpoint
      ENDPOINT[configuration.env.to_sym]
    end

    def production?
      env == 'production'
    end

    def sandbox?
      env == 'sandbox'
    end

    def env
      configuration.env
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bs2_api-1.8.0 lib/bs2_api.rb
bs2_api-1.7.0 lib/bs2_api.rb
bs2_api-1.6.2 lib/bs2_api.rb
bs2_api-1.6.1 lib/bs2_api.rb
bs2_api-1.6.0 lib/bs2_api.rb
bs2_api-1.5.1 lib/bs2_api.rb
bs2_api-1.5.0 lib/bs2_api.rb
bs2_api-1.4.3 lib/bs2_api.rb