如何在 DRF 后端使用 Stripe 自动执行客户与客户之间的可变付款

问题描述 投票:0回答:1

我对 Stripe 支付相对较新,并且在开发 Django Rest Framework (DRF) 后端应用程序时遇到了挑战。在此应用程序中,客户向各自的客户付款,每次付款的金额不同。我需要自动化此付款流程。

具体要求如下:

Customers should have the flexibility to select the date or frequency of payments to their clients.
Payments need to be automatically dispatched from the customer to the client on the specified date or at the chosen frequency.
Customers should be able to set payment frequencies, such as making payments every 15 days.

我知道 Stripe 提供订阅服务,但我的场景涉及可变的付款金额,而且我不是接收付款的人;是客户在接收它们。

有人可以提供有关如何使用 Stripe 实现此功能的指导吗?任何建议、代码片段或相关 Stripe 功能或 API 的指针将不胜感激。

提前谢谢您!

stripe-payments payment-gateway payment payment-processing
1个回答
0
投票

您的第一个和最后一个要求对我来说看起来完全相同 - 但是嘿,更少的要求对我来说更容易。

您仍然可以使用 Stripe 订阅来执行此操作,只要您的客户无法自由更改付款频率他们的订阅正在进行中,这将非常简单。
使用price_data,您可以为每个订阅生成独特的价格,具有独特的频率:
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data

您只需要让客户选择以天为单位的频率,然后将该输入作为price_data.recurring.interval_count 传递。

请注意,订阅会产生比 Stripe 付款更多的费用。
如果预算紧张,您可以随时构建自己的定期系统,然后使用 Stripe 的定期付款集成来保存和收取付款方式:
https://stripe.com/docs/ payments/save-during- payment

© www.soinside.com 2019 - 2024. All rights reserved.