From e2da2cdadf43686abc7fd33edb4ab6dcb25802a6 Mon Sep 17 00:00:00 2001 From: Alexander de Wolff Date: Wed, 9 Oct 2019 08:40:20 -0700 Subject: [PATCH] Added no_website attribute to allow usage with test accounts Currently test environment Google Merchant accounts with no website set will not work due to the `website_url()` check. --- merchant-info.json | 1 + ruby/content_config.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/merchant-info.json b/merchant-info.json index 1b7623d..b47ade1 100644 --- a/merchant-info.json +++ b/merchant-info.json @@ -1,5 +1,6 @@ { "merchantId": 12345, + "no_website": false, "accountSampleUser": "", "accountSampleAdWordsCID": 0 } diff --git a/ruby/content_config.rb b/ruby/content_config.rb index f971b5c..89440ca 100644 --- a/ruby/content_config.rb +++ b/ruby/content_config.rb @@ -41,6 +41,7 @@ def self.load(base_path) attr_accessor :path attr_accessor :merchant_id + attr_accessor :no_website attr_accessor :account_sample_user attr_accessor :account_sample_adwords_cid @@ -61,7 +62,7 @@ def is_mca() end def website_url() - if @website_url.nil? + if @website_url.nil? && (@no_website == false) puts "Attempted to use website_url field of config before initialization." puts "Please see config.rb for more information." raise "Use of website_url config field before completing service_setup" @@ -74,6 +75,7 @@ def initialize(path = nil, file = nil, options = nil) @file = file unless options.nil? @merchant_id = options["merchantId"] + @no_website = options["no_website"] @account_sample_user = options["accountSampleUser"] @account_sample_adwords_cid = options["accountSampleAdWordsCID"] end