我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

Configuring a webhook to notify you of plan changes

After creating a draft GitHub Marketplace listing, you can configure a webhook that notifies you when changes to customer account plans occur. After you configure the webhook, you can handle the marketplace_purchase event types in your app.

本文内容

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。

The GitHub Marketplace event webhook can only be set up from your application's GitHub Marketplace listing page. You can configure all other events from your application's developer settings page. If you haven't created a GitHub Marketplace listing, read "Creating a draft GitHub Marketplace listing" to learn how.

Creating a webhook

To create a webhook for your GitHub Marketplace listing, click Webhook in the left sidebar of your GitHub Marketplace listing page. You'll see the following webhook configuration options needed to configure your webhook:

Payload URL

有效负载 URL 是接收 web 挂钩 POST 请求的服务器的 URL。

Content type

Web 挂钩可通过不同的内容类型传递:

  • application/json 内容类型将直接传递 JSON 有效负载,作为 POST 请求的正文。
  • application/x-www-form-urlencoded 内容类型将发送 JSON 有效负载,作为名为 payload 的表单参数。

选择最适合您需求的项。 GitHub recommends using the application/json content type.

Secret

Setting a webhook secret allows you to ensure that POST requests sent to the payload URL are from GitHub. When you set a secret, you'll receive the X-Hub-Signature and X-Hub-Signature-256 headers in the webhook POST request. For more information on how to use a secret with a signature header to secure your webhook payloads, see "Securing your webhooks."

已激活

By default, webhook deliveries are "Active." You can choose to disable the delivery of webhook payloads during development by deselecting "Active." If you've disabled webhook deliveries, you will need to select "Active" before you submit your app for review.

Viewing webhook deliveries

Once you've configured your GitHub Marketplace webhook, you'll be able to inspect POST request payloads from the Webhook page of your application's GitHub Marketplace listing. GitHub 不会重新发送失败的递送尝试。 确保您的应用程序可以接收 GitHub 发送的所有 web 挂钩有效负载。

Inspect recent GitHub Marketplace webhook deliveries

此文档对您有帮助吗?

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。