PayPal定期付款API IPN的txn_type支付失败

5
我正在使用Paypal Pro实现定期付款API。我的问题是,当付款失败并且我收到IPN时,它的txn_type将是什么?我应该期待哪些IPN?这样我就可以在我的IPN处理类中处理它们。请注意保留HTML标记。
2个回答

9
使用定期付款时可能获得的txn_type包括:
recurring_payment_profile_created(创建循环付款配置文件)
recurring_payment_profile_cancel(取消循环付款配置文件)
recurring_payment_profile_modify(修改循环付款配置文件)
recurring_payment(循环付款)
recurring_payment_skipped(循环付款跳过)
recurring_payment_failed(循环付款失败)
recurring_payment_suspended_due_to_max_failed_payment(由于最大失败付款而暂停循环付款)
在大多数情况下,当一笔付款失败时,您会收到跳过通知。我很少看到实际的失败通知。我从未得到过任何关于这个问题的答案。
以下是一些示例。
Array
(
    [payment_cycle] => Monthly
    [txn_type] => recurring_payment_skipped
    [last_name] => Testerson
    [next_payment_date] => 03:00:00 Oct 24, 2012 PDT
    [residence_country] => US
    [initial_payment_amount] => 0.00
    [rp_invoice_id] => 3250
    [currency_code] => USD
    [time_created] => 15:42:49 Sep 19, 2012 PDT
    [verify_sign] => AH1WkYze3JQ1xNtDm31SsDJxLeGrAxPpeVKBrMHLFmRVOWXnZep95xOm
    [period_type] =>  Regular
    [payer_status] => unverified
    [test_ipn] => 1
    [tax] => 0.00
    [payer_email] => test@hey.com
    [first_name] => Tester
    [receiver_email] => usb_1329725429_biz@angelleye.com
    [payer_id] => TP7CXHP6TVNSS
    [product_type] => 1
    [shipping] => 0.00
    [amount_per_cycle] => 1.95
    [profile_status] => Active
    [charset] => windows-1252
    [notify_version] => 3.7
    [amount] => 1.95
    [outstanding_balance] => 0.00
    [recurring_payment_id] => I-0SAH6FDN3JJA
    [product_name] => USBSwiper Monthly Subscription
    [ipn_track_id] => f2380796ce7c
)



Array
(
    [payment_cycle] => Monthly
    [txn_type] => recurring_payment_failed
    [last_name] => Garcia
    [next_payment_date] => 02:00:00 Feb 12, 2012 PST
    [residence_country] => US
    [initial_payment_amount] => 0.00
    [rp_invoice_id] => 939
    [currency_code] => USD
    [time_created] => 16:29:33 Jan 29, 2010 PST
    [verify_sign] => A5rGTRcXhg6p48uIMYaPQKo7dsKqAO89FRXvCmuAfV5EYGWkAAD0vbPc
    [period_type] =>  Regular
    [payer_status] => unverified
    [tax] => 0.00
    [payer_email] => testpayer@hey.com
    [first_name] => Maria
    [receiver_email] => testreceiver@hey.com
    [payer_id] => EJ8JBQ63VHECL
    [product_type] => 1
    [shipping] => 0.00
    [amount_per_cycle] => 4.95
    [profile_status] => Active
    [charset] => windows-1252
    [notify_version] => 3.4
    [amount] => 4.95
    [outstanding_balance] => 14.85
    [recurring_payment_id] => I-S3APFHH0KFJ2
    [product_name] => USBSwiper Monthly Subscription
    [ipn_track_id] => Gi2zp.DfhsYitm8Kd0Dn3g
)

Array
(
    [payment_cycle] => Monthly
    [txn_type] => recurring_payment_suspended_due_to_max_failed_payment
    [last_name] => Nom_3
    [next_payment_date] => N/A
    [residence_country] => CA
    [initial_payment_amount] => 0.00
    [rp_invoice_id] => 3245
    [currency_code] => USD
    [time_created] => 10:53:25 Mar 14, 2012 PDT
    [verify_sign] => AptDZCkTZINE6OhArrkjyIYauY8GAGO.XoBdyMW5t7SoHPSC8DOFS9kB
    [period_type] =>  Regular
    [payer_status] => unverified
    [test_ipn] => 1
    [tax] => 0.00
    [payer_email] => sandbox@hey.com
    [first_name] => Prenom_3
    [receiver_email] => usb_1329725429_biz@angelleye.com
    [payer_id] => TP7CXHP6TVNSS
    [product_type] => 1
    [shipping] => 0.00
    [amount_per_cycle] => 1.95
    [profile_status] => Suspended
    [charset] => windows-1252
    [notify_version] => 3.4
    [amount] => 1.95
    [outstanding_balance] => 1.95
    [recurring_payment_id] => I-CEBHH0K0V7T1
    [product_name] => USBSwiper Monthly Subscription
    [ipn_track_id] => d09d07fdd833
)

Array
(
    [mc_gross] => 1.95
    [period_type] =>  Regular
    [outstanding_balance] => 0.00
    [next_payment_date] => 03:00:00 Aug 18, 2013 PDT
    [protection_eligibility] => Ineligible
    [payment_cycle] => Monthly
    [address_status] => confirmed
    [tax] => 0.00
    [payer_id] => E7BTGVXBFSUAU
    [address_street] => 1 Main St
    [payment_date] => 05:00:34 Jul 18, 2013 PDT
    [payment_status] => Completed
    [product_name] => USBSwiper Monthly Subscription
    [charset] => windows-1252
    [rp_invoice_id] => 3275
    [recurring_payment_id] => I-R0KGNCTUYAVW
    [address_zip] => 95131
    [first_name] => Drew
    [mc_fee] => 0.15
    [address_country_code] => US
    [address_name] => Drew Angell's Test Store
    [notify_version] => 3.7
    [amount_per_cycle] => 1.95
    [payer_status] => verified
    [currency_code] => USD
    [business] => usb_1329725429_biz@angelleye.com
    [address_country] => United States
    [address_city] => San Jose
    [verify_sign] => AOX9jItnq2qBtXeyCB5nhWVdWyqEAScu5FToCodROuhjlKYjtDeAdlmL
    [payer_email] => sandbo_1204199080_biz@angelleye.com
    [initial_payment_amount] => 0.00
    [profile_status] => Active
    [amount] => 1.95
    [txn_id] => 9PD943662S291292G
    [payment_type] => instant
    [payer_business_name] => Drew Angell's Test Store
    [last_name] => Angell
    [address_state] => CA
    [receiver_email] => usb_1329725429_biz@angelleye.com
    [payment_fee] => 0.15
    [receiver_id] => C9TAVNJFATXCS
    [txn_type] => recurring_payment
    [mc_currency] => USD
    [residence_country] => US
    [test_ipn] => 1
    [transaction_subject] => USBSwiper Monthly Subscription
    [payment_gross] => 1.95
    [shipping] => 0.00
    [product_type] => 1
    [time_created] => 15:10:22 Jun 18, 2013 PDT
    [ipn_track_id] => 28067cf6ae8f
)

Array
(
    [payment_cycle] => Monthly
    [txn_type] => recurring_payment_profile_created
    [last_name] => Angell
    [next_payment_date] => 03:00:00 Jun 18, 2013 PDT
    [residence_country] => US
    [initial_payment_amount] => 0.00
    [rp_invoice_id] => 3275
    [currency_code] => USD
    [time_created] => 15:10:22 Jun 18, 2013 PDT
    [verify_sign] => ANrMRzzgbWP1I9ntjeVxAzQDTVjbATTckkxc4RtXKTYHoCoFDbklKPpd
    [period_type] =>  Regular
    [payer_status] => verified
    [test_ipn] => 1
    [tax] => 0.00
    [payer_email] => sandbo_1204199080_biz@angelleye.com
    [first_name] => Drew
    [receiver_email] => usb_1329725429_biz@angelleye.com
    [payer_id] => E7BTGVXBFSUAU
    [product_type] => 1
    [payer_business_name] => Drew Angell's Test Store
    [shipping] => 0.00
    [amount_per_cycle] => 1.95
    [profile_status] => Active
    [charset] => windows-1252
    [notify_version] => 3.7
    [amount] => 1.95
    [outstanding_balance] => 0.00
    [recurring_payment_id] => I-R0KGNCTUYAVW
    [product_name] => USBSwiper Monthly Subscription
    [ipn_track_id] => 1bf251e429b9c
)

感谢您的回复。这很有道理。现在我知道要注意哪些情况了。还有一件事我不确定,如果我收到Recurring_Payment_Skipped IPN,Paypal是否会将金额添加到未付余额中? - user1535672
6
是的,这笔款项将转为未清余额,并且他们的系统会在5天后自动重新尝试。系统将进行3次重试,如果所有3次重试都失败,由于付款失败次数达到上限,系统将暂停该账户,并会通知您。 - Drew Angell
谢谢,如果通过Paypal或使用ManageRecurringPaymentsProfileStatus API取消了循环配置文件,我们是否可以重新激活它? - user1535672
如果它被完全取消了,你就无法重新激活它。只有在它被暂停的情况下才能这样做。 - Drew Angell
@AndrewAngell 只是想澄清一下,当支付失败并达到最大失败次数时,您会收到失败通知,然后是暂停通知吗? - Relequestual
显示剩余2条评论

0

Andrew相同,但是更详细地解释了跳过和失败的工作原理(根据我所见):

recurring_payment_profile_created - 当创建配置文件时。需要注意recurring_payment_id,这是您需要取消/暂停/修改配置文件的内容。

recurring_payment_profile_cancel - 当取消配置文件时。

recurring_payment_profile_modify - 当修改配置文件时。

recurring_payment - 当您收到定期付款时。

recurring_payment_skipped - 当PayPal无法收取付款并将在5天后再次尝试时。

recurring_payment_failed - 当未设置MAXFAILEDPAYMENTS时,PayPal将尝试3次,如果全部失败,则为第3个IPN。

recurring_payment_suspended_due_to_max_failed_payment - 当设置了MAXFAILEDPAYMENTS时,达到最大值时,这将是IPN,而不是recurring_payment_failed。


抱歉打扰了。如果MAXFAILEDPAYMENTS未设置或设置为0,则根据文档,Paypal将尝试无限次收集资金。但是在您的答案中,您说Paypal会尝试三次?哪一个是正确的?如果MAXFAILEDPAYMENTS设置为0且Paypal在第三次尝试中未能收集资金,Paypal会暂停配置文件吗?如果没有,下一个定期付款会发生什么?下一个定期付款是否有任何未付金额? - Priska Aprilia

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接