Skip to content

Commit

Permalink
Handle TaxTransaction (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
forsbergplustwo authored Oct 12, 2023
2 parents 63e904a + 6372172 commit d9b6f3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/import/adaptor/shopify_payments_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/http_client.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit d9b6f3d

Please sign in to comment.