【问题标题】:What kind of ipn response is recieved on subscription deactivation from within paypal?从贝宝内取消订阅会收到什么样的 ipn 响应?
【发布时间】:2017-03-15 07:19:18
【问题描述】:

我首先向客户收取即时付款费用,然后创建订阅配置文件。这是我收到的 ipn。

我猜这是为了即时付款:

[2016-10-31 16:26:11] local.INFO: IPN RESPONSE:Array
(
    [mc_gross] => 9.99
    [invoice] => 49
    [protection_eligibility] => Ineligible
    [item_number1] => 
    [payer_id] => FA5XLVU3CLN92
    [tax] => 0.00
    [payment_date] => 09:26:06 Oct 31, 2016 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [mc_shipping] => 0.00
    [mc_handling] => 0.00
    [first_name] => omer
    [mc_fee] => 0.59
    [notify_version] => 3.8
    [custom] => 
    [payer_status] => verified
    [business] => business@gmail.com
    [num_cart_items] => 1
    [mc_handling1] => 0.00
    [verify_sign] => A8SKEyFJtpw0I2pUVRQ9wRhpVLh9AnPjeq8ltcpWBhIHlTZuf.ak4aa-
    [payer_email] => customer@gmail.com
    [mc_shipping1] => 0.00
    [tax1] => 0.00
    [txn_id] => 3J610862594926351
    [payment_type] => instant
    [last_name] => farooq
    [item_name1] => Product 1
    [receiver_email] => business@gmail.com
    [payment_fee] => 0.59
    [quantity1] => 1
    [receiver_id] => RSDJM66ZP7LZ8
    [txn_type] => cart
    [mc_gross_1] => 9.99
    [mc_currency] => USD
    [residence_country] => US
    [test_ipn] => 1
    [transaction_subject] => 49
    [payment_gross] => 9.99
    [ipn_track_id] => af46df962d1bf
    [cmd] => _notify-validate
)

这个应该是订阅配置文件:

[2016-10-31 16:27:09] local.INFO: IPN RESPONSE:Array
(
    [payment_cycle] => every 12 Months
    [txn_type] => recurring_payment_profile_created
    [last_name] => farooq
    [next_payment_date] => 03:00:00 Oct 31, 2016 PDT
    [residence_country] => US
    [initial_payment_amount] => 0.00
    [currency_code] => USD
    [time_created] => 09:26:08 Oct 31, 2016 PDT
    [verify_sign] => AwD4sJJmdrzDKNGw7KMAMuZSx1AHAJkBGoIT8Zl86XtmqM9xpRo7woGm
    [period_type] =>  Regular
    [payer_status] => verified
    [test_ipn] => 1
    [tax] => 0.00
    [payer_email] => customer@gmail.com
    [first_name] => omer
    [receiver_email] => business@gmail.com
    [payer_id] => FA5XLVU3CLN92
    [product_type] => 1
    [shipping] => 0.00
    [amount_per_cycle] => 9.99
    [profile_status] => Active
    [charset] => windows-1252
    [notify_version] => 3.8
    [amount] => 9.99
    [outstanding_balance] => 0.00
    [recurring_payment_id] => I-R159BJH8WJHF
    [product_name] => 49
    [ipn_track_id] => 45f60995a00
    [cmd] => _notify-validate
)

现在我的问题是,如果有人使用他的贝宝帐户停用他的订阅怎么办?显然,我认为我不会在下一个计费周期收到 ipn 响应。还是 paypal 会回复您说订阅已停用?

我是否一直在寻找是否在某个计费日期收到了 ipn,如果我没有收到 ipn,我只是假设他们可能已经从 paypal 中停用了订阅。

这是最好的方法吗?如果可能的话,您能解释一下您是如何在您的系统上工作的吗?

【问题讨论】:

    标签: php paypal paypal-ipn paypal-subscriptions


    【解决方案1】:

    实际上,几年前我写过一篇文章,解释了可以为订阅生成的所有不同类型的 IPN。如果您想阅读完整答案,我已将其转贴on my personal blog,但这是简短答案:您将获得带有txn_type=recurring_payment_profile_cancel 的IPN。这应该会在买家取消订阅后立即发生。

    现在...如果买家在订阅过程中取消订阅,您将在结算周期结束时获得第二个带有txn_type=recurring_payment_expired 的 IPN。例如,如果您的订阅每 12 个月计费一次,而买家在 6 个月后取消,您将在他们取消订阅时获得一个带有 txn_type=recurring_payment_profile_cancel 的 IPN,并在最后获得另一个带有 txn_type=recurring_payment_expired 的 IPN 12 个月(例如,PayPal 应该为接下来的 12 个月开具账单的时间)。这个想法是买家已经支付了 12 个月的费用,即使他们在 6 个月后就取消了。 recurring_payment_expired IPN 本质上是一个通知,告诉您“嘿,此人的订阅已到期 - 现在您应该停用您提供给他们的任何产品/服务”。

    【讨论】:

    • 感谢@matt,这篇博文非常有帮助。没想到会有这么多回复。不过,我有一个简单的问题,recurring_payment_failed 是否意味着买家的 paypal 帐户中没有足够的余额?
    • 不一定,因为买家可以使用其他资金来源(例如他们的银行账户或信用卡)支付订阅费用。这只是意味着我们由于某种原因未能为付款提供资金。 (信用卡被拒是最可能的原因,但不是唯一原因。)
    • 这就是我的想法。谢谢@matt :)
    猜你喜欢
    • 2012-04-26
    • 2013-03-06
    • 2012-05-16
    • 2014-06-30
    • 2014-07-27
    • 2020-11-09
    • 2013-11-23
    • 2014-11-30
    • 2012-11-23
    相关资源
    最近更新 更多