Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shopify: Improve efficiency of the webhook processing #1849

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Conversation

devkiran
Copy link
Collaborator

@devkiran devkiran commented Jan 2, 2025

This pull request includes several changes to improve the handling of Shopify webhook events and the integration with Shopify. The most important changes include adding return messages for various webhook handlers, modifying the orderPaid function to handle different cases of clickId, and renaming and updating the Shopify pixel route.

Shopify Webhook Improvements:

  • Added return messages for various webhook handlers to provide a response after processing. (apps/web/app/api/shopify/integration/webhook/app-uninstalled.ts, apps/web/app/api/shopify/integration/webhook/customers-data-request.ts, apps/web/app/api/shopify/integration/webhook/customers-redact.ts, apps/web/app/api/shopify/integration/webhook/shop-redact.ts) [1] [2] [3] [4]
  • Modified the orderPaid function to handle different cases of clickId, including when it is empty, found, or not found. (apps/web/app/api/shopify/integration/webhook/order-paid.ts) [1] [2] [3]
  • Updated the main webhook route to return the response from the specific webhook handler and improved error handling. (apps/web/app/api/shopify/integration/webhook/route.ts) [1] [2]

Shopify Pixel Route:

  • Renamed and updated the Shopify pixel route to handle rate limiting and validate the clickId if provided. (apps/web/app/api/shopify/pixel/route.ts renamed from apps/web/app/api/track/shopify/route.ts) [1] [2]

Environment Configuration:

  • Added SHOPIFY_WEBHOOK_SECRET to the environment configuration example file. (apps/web/.env.example)

Description created by Copilot

Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Jan 2, 2025 6:24pm

@steven-tey steven-tey merged commit 0add5c4 into main Jan 2, 2025
4 of 5 checks passed
@steven-tey steven-tey deleted the shopify branch January 2, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants