lib/billfixers/partner/client.rb in billfixers-partner-1.2.1 vs lib/billfixers/partner/client.rb in billfixers-partner-1.2.2

- old
+ new

@@ -4,10 +4,12 @@ require 'graphlient' module Billfixers module Partner class Client - def initialize(api_key:, test_mode: false) + def initialize(api_key:) + test_mode = api_key.start_with?('test_') + endpoint = test_mode ? 'https://billfixers-partner-sandbox.herokuapp.com/partner/graphql' : 'https://billfixers.herokuapp.com/partner/graphql' @gql = Graphlient::Client.new(endpoint, schema_path: File.join(File.dirname(__FILE__), '../../../partner_schema.json'), headers: {