payment-gateway - Stripe - 如何使用免费计划处理订阅且注册时无需信用卡

标签 payment-gateway credit-card saas payment-processing stripe-payments

我们开始在 Redsmin 上实现 Stripe (我们的项目之一)我认为我们可能错过了一些东西。其工作原理如下:

  1. 要使用我们的产品,用户必须选择一个计划(免费、s、m、xl、xxl...),然后输入其登录名/密码,然后就可以免费试用 30 天。当用户提交表单时,我们的服务器调用 Stripe create_customer 使用指定的计划且无需信用卡(因为我们希望提供 30 天免费且无需信用卡),并且我们使用返回的 customer_id 更新我们这边的用户模型。和subscription_id .

  2. 我们设置了一个 Webhook 来接收 strip 事件,因此 30 天后我们的 Webhook 应该收到 customer.subscription.updated事件 object.status == active我说得对吗?

  3. 但是,由于我们在注册时没有为用户指定关联卡,因此我们应该很快就会收到另一个 customer.subscription.updated事件与 object.status == unpaid正确的?然后,在我们这边,我们停用用户帐户并强制其转到我们的计划选择页面。

  4. 从那时起,用户可以选择免费计划或我们的高级计划之一:

  5. #Scenario 1 如果用户选择免费计划,我们只需在我们这边重新激活其帐户,而不执行任何其他操作,因为我们将 stripe 上的免费计划配置为 0 美元。 我们的免费计划是否实现了正确的流程?还有更好的方法吗?

  6. #Scenario 2 如果用户选择高级计划,我们会将其重定向到信用卡表单,该表单随后将发送到 Stripe,并且我们会使用以下内容更新 stripe 客户帐户:临时卡 token 。 接下来我们应该做什么?:

    • 我们应该等待 stripe 向我们发送事件吗?如果有,是什么事件? customer.subscription.updatedcharge.succeededobject.status 的值是多少然后呢?
    • 我们是否应该直接重新激活我们这边的用户帐户并等待 stripe 的确认?如果是这样,我们应该等待的事件名称和数据是什么?

最佳答案

在第 2 部分中,您将执行以下操作:

We set up a webhook to receive stripe events so after 30 days our webhook should receive a customer.subscription.updated event with a object.status == active am I right?

您还可以考虑实现 customer.subscription.Trial_will_end Webhook,此 Webhook 将在客户试用结束前三天发送,并允许您向客户发送更新通知他们的付款信息。

这样,如果用户决定去更新他们的付款信息,Stripe 将能够在客户试用结束后立即收取付款,并且他们将能够继续使用您的服务而不会中断。

#Scenario 1 If the user select the free plan, we just reactivate its account on our side and do nothing else because we configured the free plan on stripe to cost 0$. Did we implemented the right process with our free plan? are there better ways?

据我所知,这是使用 Stripe 实现免费计划的最佳方式,我可能会确保除非需要,否则不会向客户发送任何发票。我怀疑如果用户使用免费计划,他们是否会期望在每个计费周期收到发票。

#Scenario 2 If the user select a premium plan, we redirect him to a credit card form, that will be then sent to Stripe, and we update the stripe customer account with the temporary card token. What should we do next?:

  • Should we wait for stripe to send us an event, if so, what event? customer.subscription.updated? charge.succeeded? What will be the value of object.status then?
  • Should we directly reactivate the user account on our side and wait for a confirmation from stripe? If so, what would be the event name and data we should wait for?

一旦用户选择了套餐并更新了他们的付款信息,只要 Stripe 的订阅更新响应成功,我就会立即激活他们的帐户。

只要您从 Stripe 仪表板配置了订阅首选项,您就应该能够让 Stripe 处理付款失败时的操作。只需确保您实现了 customer.subscription.updated Webhook,因为如果 Stripe 将订阅标记为未付费或已取消,这将是 Stripe 向您发送的 Webhook,以便您相应地更新自己的记录。

关于payment-gateway - Stripe - 如何使用免费计划处理订阅且注册时无需信用卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19467287/

相关文章:

java - 查看 SSLFactory 使用的 keystore ?异常 : "sun....certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

javascript - SaaS系统的概念

c# - 软件即服务的最佳应用程序设计

paypal - 您可以将 Google Checkout 用作简单的付款接收方吗? IE。不需要完整的订单?

IOS Paypal : How to allow user to Enter any amount on payment page of PayPal

c# - 万事达卡的正则表达式

iOS 原生信用卡自动填充功能与移动结账冲突

php - 比特币支付,OP_RETURN 参数

javascript - payone 与 creditcardcheck 集成

python - 带 SaaS 的集成开发环境