# frozen_string_literal: true require 'wells_fargo/version' require 'wells_fargo/api' module WellsFargo Configuration = Struct.new( :url, :client_cert, :client_key, :gateway_entity_id, :gateway_company_id, :consumer_key, :consumer_secret ) module_function def config @config ||= Configuration.new end def configure yield config end def client @client ||= API.new( config.url, config.to_h.slice( :client_cert, :client_key, :consumer_key, :consumer_secret, :gateway_company_id, :gateway_entity_id ) ) end end