diff --git a/app/models/import/adaptor/shopify_payments_api.rb b/app/models/import/adaptor/shopify_payments_api.rb index 4bbfdb5..df45288 100644 --- a/app/models/import/adaptor/shopify_payments_api.rb +++ b/app/models/import/adaptor/shopify_payments_api.rb @@ -108,7 +108,7 @@ def payment_date(node) def revenue(node) case node.__typename - when "ReferralAdjustment", "ReferralTransaction" + when "ReferralAdjustment", "ReferralTransaction", "TaxTransaction" node.amount&.amount&.to_f else node.net_amount&.amount&.to_f @@ -126,7 +126,7 @@ def is_yearly_revenue(node) def app_title(node) case node.__typename - when "ReferralAdjustment", "ReferralTransaction", "ServiceSale", "ServiceSaleAdjustment" + when "ReferralAdjustment", "ReferralTransaction", "ServiceSale", "ServiceSaleAdjustment", "TaxTransaction" Payment::UNKNOWN_APP_TITLE when "ThemeSaleAdjustment", "ThemeSale" node.theme&.name diff --git a/lib/http_client.rb b/lib/http_client.rb index 6da19af..3c476ec 100644 --- a/lib/http_client.rb +++ b/lib/http_client.rb @@ -1,5 +1,7 @@ module ShopifyPartnerAPI class HTTPClient < GraphQL::Client::HTTP + SHOPIFY_PARTNER_API_VERSION = "2023-10" + def initialize super("https://partners.shopify.com/") end @@ -11,7 +13,7 @@ def headers(context) end def execute(document:, operation_name: nil, variables: {}, context: {}) - @uri = URI.parse("https://partners.shopify.com/#{context.fetch(:organization_id)}/api/unstable/graphql.json") + @uri = URI.parse("https://partners.shopify.com/#{context.fetch(:organization_id)}/api/#{SHOPIFY_PARTNER_API_VERSION}/graphql.json") super(document: document, operation_name: operation_name, variables: variables, context: context) end