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

Billing customers

Apps on GitHub Marketplace should adhere to GitHub's billing guidelines and support recommended services. Following our guidelines helps customers navigate the billing process without any surprises.

本文内容

此文档对您有帮助吗?

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

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

做出贡献

或, 了解如何参与。

Understanding the billing cycle

Customers can choose a monthly or yearly billing cycle when they purchase your app. All changes customers make to the billing cycle and plan selection will trigger a marketplace_purchase event. You can refer to the marketplace_purchase webhook payload to see which billing cycle a customer selects and when the next billing date begins (effective_date). For more information about webhook payloads, see "GitHub Marketplace webhook events."

Providing billing services in your app's UI

Customers must be able to perform the following actions from your app's website:

  • Customers must be able to modify or cancel their GitHub Marketplace plans for personal and organizational accounts separately.
  • 取消从 GitHub Marketplace 购买的付费计划的客户必须被自动降级到该应用程序的免费计划(如果有)。 当客户取消 GitHub Marketplace 订阅时,GitHub 不会自动卸载应用程序,因此客户可以预期免费功能仍然有效。 强烈建议允许客户重新启用他们以前的计划。
  • 如果您用以下格式提供升级 URL,客户必须能够从应用程序的 UI 升级:https://www.github.com/marketplace/<LISTING_NAME>/upgrade/<LISTING_PLAN_NUMBER>/<CUSTOMER_ACCOUNT_ID>
  • 如果客户购买了席位(单位定价计划)或支持无限协作者的计划,他们必须能够修改哪些用户可以从应用程序的网站访问应用程序。
  • 客户必须能够在应用程序网站的帐单、个人资料或帐户设置部分立即看到其帐户的以下变动:
    • 当前计划和价格。
    • 购买的新计划。
    • 升级、降级、取消以及免费试用剩余天数。
    • 结算周期的变化(每月或每年)。
    • 固定费用和每单位计划的使用情况和剩余资源。 例如,如果定价计划是按单位计费,则应用程序的网站应显示已用单位和可用单位。

Billing services for upgrades, downgrades, and cancellations

Follow these guidelines for upgrades, downgrades, and cancellations to maintain a clear and consistent billing process. For more detailed instructions about the GitHub Marketplace purchase events, see "Billing flows."

You can use the marketplace_purchase webhook's effective_date key to determine when a plan change will occur and periodically synchronize the List accounts for a plan.

升级

When a customer upgrades their pricing plan or changes their billing cycle from monthly to yearly, you should make the change effective for them immediately. You need to apply a pro-rated discount to the new plan and change the billing cycle.

如果客户升级其计划但付款失败,GitHub 会将其 GitHub Marketplace 订阅还原到以前的状态。 GitHub 还会向客户发送一封电子邮件,通知他们失败的情况,并允许他们重新尝试购买。 您将会收到带有 changed 操作的 web 挂钩,要求您还原到以前的计划。

For information about building upgrade and downgrade workflows into your app, see "Upgrading and downgrading plans."

Downgrades and cancellations

Downgrades occur when a customer moves to a free plan from a paid plan, selects a plan with a lower cost than their current plan, or changes their billing cycle from yearly to monthly. When downgrades or cancellations occur, you don't need to provide a refund. Instead, the current plan will remain active until the last day of the current billing cycle. The marketplace_purchase event will be sent when the new plan takes effect at the beginning of the customer's next billing cycle.

When a customer cancels a plan, you must:

  • Automatically downgrade them to the free plan, if it exists.

    当客户取消 GitHub Marketplace 订阅时,GitHub 不会自动卸载应用程序,因此客户可以预期免费功能仍然有效。

  • Enable them to upgrade the plan through GitHub if they would like to continue the plan at a later time.

For information about building cancellation workflows into your app, see "Cancelling plans."

此文档对您有帮助吗?

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

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

做出贡献

或, 了解如何参与。