PayPal在成功的定期支付(用于订阅)后触发哪个事件?

huangapple go评论51阅读模式
英文:

What event is triggered from PayPal on successful recuring payment (for subscription)?

问题

I have a subscription based web site where I would like to get statistics about all the current active subscribers and how many cycles they have made. This would have been easy task if the PayPal API had an endpoint for fetching all subscriptions but this is missing from their API. So I'm tracking this in our DB. I'm successfully recording the new subscriptions and the cancellations. But I'm not sure what event I should expect from PayPal to be triggered when a subscription renews.

In PayPal's documentation I have found only few events related to the subscriptions, and none of those seems to serve my needs. There are also an event called BILLING.SUBSCRIPTION.RE-ACTIVATED but it comes from "Billing plans and agreements" which is deprecated.

In SO I have found this post which advises to check for the PAYMENT.SALE.COMPLETED, but this is not perfect as I will get all sorts of payments that hit this PayPal account (it is used not only for subscriptions but also for one-time payments).

英文:

I have a subscription based web site where I would like to get statistics about all the current active subscribers and how many cycles they have made. This would have been easy task if the PayPal API had an endpoint for fetching all subscriptions but this is missing from their API. So I'm tracking this in our DB. I'm successfully recording the new subscriptions and the cancellations. But I'm not sure what event I should expect from PayPal to be triggered when a subscription renews.

In PayPal's documentation I have found only few events related to the subscriptions, and none of those seems to serve my needs. There are also an event called BILLING.SUBSCRIPTION.RE-ACTIVATED but it comes from "Billing plans and agreements" which is deprecated.

In SO I have found this post which advises to check for the PAYMENT.SALE.COMPLETED, but this is not perfect as I will get all sort of payments that hit this PayPal account (it is used not only for subscriptions but also for one-time payments).

答案1

得分: 1

这是PAYMENT.SALE.COMPLETED

对于一次性支付,/v2/checkout/orders 集成不应触发相同的事件,只有已弃用的 /v1/payments 才会,据我所知。

您可以通过负载来判断是否为订阅支付,订阅ID以 I- 开头。

英文:

It's PAYMENT.SALE.COMPLETED

For one time payments, a /v2/checkout/orders integration shouldn't trigger that same event, only the deprecated /v1/payments does AFAIK.

You can tell whether it's a subscription payment by the payload, subscription IDs begin with I-

huangapple
  • 本文由 发表于 2023年2月14日 19:14:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75447019.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定