lib/paykassa.rb in paykassa-0.1.14 vs lib/paykassa.rb in paykassa-0.1.15

- old
+ new

@@ -1,23 +1,23 @@ # frozen_string_literal: true require_relative "paykassa/version" require_relative "paykassa/order" require_relative "paykassa/pay" +require 'logger' module Paykassa class Error < StandardError; end class Paykassa def initialize(domain:, sci_id:, sci_key:, api_id: nil, api_key: nil, test:, logger: nil) - - @logger=logger - puts "logger paykassa: #{@logger.inspect}" - @paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key}, logger) + @logger = Logger.new(logger) unless logger.nil? + + @paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key}, @logger) if api_id.nil? @paykassa_pay = nil else @paykassa_pay = PaykassaPay.new( domain: domain, api_id: api_id, - api_key: api_key, test: test, logger: logger + api_key: api_key, test: test, logger: @logger ) end end def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)