我正在使用Laravel构建Saas应用程序,我担心这种情况。
我正在集成Namecheap域名购买API和Paypal支付网关API。
我的逻辑是这样的
-Show Available Domains:
-Customer picks one:
-Customer pays with paypal (redirect to paypal page):
-If payment is success, I will call domain register API.
-If success, then I will show success message.上面是一个完美的例子,一切都像我预期的那样工作。
但这是我的担忧。
...
-Customer pays with paypal (redirect to paypal page):
-Payment was success, I will call domain register API.
-Domain register API is not success: (maybe i need to refund?)其他选项:
-Customer pays with paypal (redirect to paypal page):
-Before do actual payment on my side, I will call domain register API.
-If domain register AIP is success, I will do actual payment process.在这种情况下,如果实际支付过程失败,那么客户将能够免费获得域名。
有没有人能给我一些建议来解决这些问题?
谢谢
发布于 2020-09-03 04:01:15
我确信你是预先检查可用性,但你应该总是在注册域名之前处理付款。如果注册失败,您可以立即退款或提供选择其他域名或任何工作。
对于付款审批,最佳PayPal审批流程为:https://developer.paypal.com/demo/checkout/#/pattern/server
这将在您的服务器上调用两个路由,一个用于“设置事务”,另一个用于“捕获事务”,记录如下:https://developer.paypal.com/docs/checkout/reference/server-integration/
如果捕获未成功,则应在此处传播要处理的失败消息appropriately.
https://stackoverflow.com/questions/63712650
复制相似问题