docs: fix provider ID in payment's webhook URL (#10157)

This commit is contained in:
Shahed Nasser
2024-11-19 15:29:34 +02:00
committed by GitHub
parent 9dff05cdde
commit 156494c646
3 changed files with 114 additions and 4 deletions
@@ -24,7 +24,7 @@ In this document, youll 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:
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Stripe Payment Type</Table.HeaderCell>
<Table.HeaderCell>Webhook Endpoint URL</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
Basic Stripe Payment
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
Bancontact Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-bancontact_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
BLIK Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-blik_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
giropay Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-giropay_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
iDEAL Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-ideal_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
Przelewy24 Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-przelewy24_stripe`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
PromptPay Payments
</Table.Cell>
<Table.Cell>
`{medusa_url}/hooks/payment/stripe-promptpay_stripe`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
---
## Useful Guides
- [Storefront guide: Add Stripe payment method during checkout](../../../../storefront-development/checkout/payment/stripe/page.mdx).
@@ -18,7 +18,14 @@ This is useful in many cases such as when a payment is being processed asynchron
The Payment Modules 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)
+2 -2
View File
@@ -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",