简体   繁体   English

如何使用paypal php rest api进行每月订阅付款

[英]How to make monthly subscription payments with paypal php rest api

I want to make monthly subscription payment with paypal php rest api.我想使用 paypal php rest api 进行每月订阅付款。 Is it possible with rest api.是否可以使用rest api。 If yes then please describe how can I achieve that.如果是,那么请描述我如何实现这一目标。 Also after successful subscription how can I cancel the subscription via Api.同样在成功订阅后,我如何通过 Api 取消订阅。 Also how can update the DB if subscription payment is failed.如果订阅付款失败,如何更新数据库。

It's possible to create a subscription payment with the Paypal API.可以使用 Paypal API 创建订阅付款。

First of all you need to create a product with the catalogue api: https://developer.paypal.com/docs/api/catalog-products/v1/#products_create首先,您需要使用目录 api 创建一个产品: https : //developer.paypal.com/docs/api/catalog-products/v1/#products_create

You have to create a product regardless what you are selling (physical goods or services)无论您销售什么(实物商品或服务),您都必须创建产品

The you will use the subscriptions api to create plans that are linked to the created product: https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create您将使用订阅 api 创建链接到创建的产品的计划: https : //developer.paypal.com/docs/api/subscriptions/v1/#plans_create

Obviously a product can have multiple plans with different pricing or billing cycle显然,一个产品可以有多个具有不同定价或计费周期的计划

Finally you can integrate the Smart Payment buttons to your checkout form to allow users to subscribe to a plan: https://developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription最后,您可以将智能支付按钮集成到您的结帐表单中,以允许用户订阅计划: https : //developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription

You can read the currently complete guide of paypal subscription integration here: https://developer.paypal.com/docs/subscriptions/integrate/您可以在此处阅读当前完整的 paypal 订阅集成指南: https : //developer.paypal.com/docs/subscriptions/integrate/

After a subscription is created it can be canceled via the subscription api: https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_cancel创建订阅后,可以通过订阅 api 取消订阅: https : //developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_cancel

I don't remember how to create the recurring payment with Paypal, but as far as I know, canceling it is not possible via their api.我不记得如何使用 Paypal 创建定期付款,但据我所知,无法通过他们的 api 取消它。

On our website, we have to tell the users to cancel their subscription on paypal's website.在我们的网站上,我们必须告诉用户取消他们在贝宝网站上的订阅。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM