From 156494c64618840cba73bd3b715713147463070e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 19 Nov 2024 15:29:34 +0200 Subject: [PATCH] docs: fix provider ID in payment's webhook URL (#10157) --- .../payment/payment-provider/stripe/page.mdx | 105 +++++++++++++++++- .../payment/webhook-events/page.mdx | 9 +- www/apps/resources/generated/edit-dates.mjs | 4 +- 3 files changed, 114 insertions(+), 4 deletions(-) diff --git a/www/apps/resources/app/commerce-modules/payment/payment-provider/stripe/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment-provider/stripe/page.mdx index fae08ff360..5fc9b795e2 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment-provider/stripe/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment-provider/stripe/page.mdx @@ -24,7 +24,7 @@ In this document, you’ll learn about the Stripe Module Provider and how to ins link: "https://support.stripe.com/questions/locate-api-keys-in-the-dashboard" }, { - text: "For deployed Medusa applications, a Stripe webhook secret. When creating the Webhook, set the endpoint URL to {medusa_url}/hooks/payment/stripe, where {medusa_url} with the URL to your deployed Medusa application.", + text: "For deployed Medusa applications, a Stripe webhook secret. When creating the Webhook, set the endpoint URL to {medusa_url}/hooks/payment/stripe_stripe, where {medusa_url} with the URL to your deployed Medusa application.", link: "https://docs.stripe.com/webhooks#add-a-webhook-endpoint" } ]} /> @@ -214,6 +214,109 @@ const paymentSession = --- +## Stripe Webhook Endpoint URLs + +As mentioned in the prerequisites, when you set up a webhook in Stripe, you set the webhook endpoint URL to `{medusa_url}/hooks/payment/stripe_stripe`. This endpoint URL is for basic payments with Stripe. + +The Stripe Module Provider supports other payment types, and the webhook endpoint URL is different for each: + + + + + Stripe Payment Type + Webhook Endpoint URL + + + + + + + Basic Stripe Payment + + + + + `{medusa_url}/hooks/payment/stripe_stripe` + + + + + + + Bancontact Payments + + + + + `{medusa_url}/hooks/payment/stripe-bancontact_stripe` + + + + + + + BLIK Payments + + + + + `{medusa_url}/hooks/payment/stripe-blik_stripe` + + + + + + + giropay Payments + + + + + `{medusa_url}/hooks/payment/stripe-giropay_stripe` + + + + + + + iDEAL Payments + + + + + `{medusa_url}/hooks/payment/stripe-ideal_stripe` + + + + + + + Przelewy24 Payments + + + + + `{medusa_url}/hooks/payment/stripe-przelewy24_stripe` + + + + + + + PromptPay Payments + + + + + `{medusa_url}/hooks/payment/stripe-promptpay_stripe` + + + + +
+ +--- + ## Useful Guides - [Storefront guide: Add Stripe payment method during checkout](../../../../storefront-development/checkout/payment/stripe/page.mdx). diff --git a/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx b/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx index 3fa1c7f9ff..737545f793 100644 --- a/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx @@ -18,7 +18,14 @@ This is useful in many cases such as when a payment is being processed asynchron The Payment Module’s main service has a [getWebhookActionAndData method](/references/payment/getWebhookActionAndData) used to handle incoming webhook events from third-party payment services. The method delegates the handling to the associated payment provider, which returns the event's details. -Medusa implements a webhook listener route at the `/hooks/payment/[provider]` API route, where `[provider]` is the ID of the provider (for example, `stripe`). Use that webhook listener in your third-party payment provider's configurations. +Medusa implements a webhook listener route at the `/hooks/payment/[identifier]_[provider]` API route, where: + +- `[identifier]` is the `identifier` static property defined in the payment provider. For example, `stripe`. +- `[provider]` is the ID of the provider. For example, `stripe`. + +For example, when integrating basic Stripe payments with the [Stripe Module Provider](../payment-provider/stripe/page.mdx), the webhook listener route is `/hooks/payment/stripe_stripe`. If you're integrating Stripe's Bancontact payments, the webhook listener route is `/hooks/payment/stripe-bancontact_stripe`. + +Use that webhook listener in your third-party payment provider's configurations. ![A diagram showcasing the steps of how the getWebhookActionAndData method words](https://res.cloudinary.com/dza7lstvk/image/upload/v1711567415/Medusa%20Resources/payment-webhook_seaocg.jpg) diff --git a/www/apps/resources/generated/edit-dates.mjs b/www/apps/resources/generated/edit-dates.mjs index 15e13414f6..06252bd373 100644 --- a/www/apps/resources/generated/edit-dates.mjs +++ b/www/apps/resources/generated/edit-dates.mjs @@ -53,10 +53,10 @@ export const generatedEditDates = { "app/commerce-modules/payment/payment/page.mdx": "2024-10-09T10:59:08.463Z", "app/commerce-modules/payment/payment-collection/page.mdx": "2024-10-09T10:56:49.510Z", "app/commerce-modules/payment/payment-flow/page.mdx": "2024-10-09T11:18:53.332Z", - "app/commerce-modules/payment/payment-provider/stripe/page.mdx": "2024-10-15T12:51:45.236Z", + "app/commerce-modules/payment/payment-provider/stripe/page.mdx": "2024-11-19T11:46:31.140Z", "app/commerce-modules/payment/payment-provider/page.mdx": "2024-10-09T11:07:27.269Z", "app/commerce-modules/payment/payment-session/page.mdx": "2024-10-09T10:58:00.960Z", - "app/commerce-modules/payment/webhook-events/page.mdx": "2024-10-09T11:11:05.413Z", + "app/commerce-modules/payment/webhook-events/page.mdx": "2024-11-19T11:45:02.167Z", "app/commerce-modules/payment/page.mdx": "2024-10-09T10:39:37.362Z", "app/commerce-modules/pricing/_events/_events-table/page.mdx": "2024-07-03T19:27:13+03:00", "app/commerce-modules/pricing/_events/page.mdx": "2024-07-03T19:27:13+03:00",