Paypal 定期付款 IPN

Posted

技术标签:

【中文标题】Paypal 定期付款 IPN【英文标题】:Paypal Recurring Payments IPN 【发布时间】:2014-01-23 04:18:57 【问题描述】:

我在 Paypal 中设置了一个 IPN,每次使用 Payflow Pro 进行定期付款时都会点击。如何让它发回我需要的自定义 ID 的变量,以确保我可以使用它来扩展会员资格?

到目前为止,我已经尝试过 ProfileID、payer_business_name、option_name1、rp_invoice_id、invoice 和 custom,通过时都没有发回。

【问题讨论】:

【参考方案1】:

custom 变量当然应该可以工作,如果它包含在 POST 中的话。或者,您可以将任何您喜欢的变量名称=值对添加到 notify_url,只要它们不与 PayPal 的 IPN 变量冲突。

【讨论】:

这是针对定期付款的,IPN 是在 Paypal 内部设置的,不能使用它即时设置,因此 URL 中的变量将不起作用。 我已经读过notify_url 中的 URL 参数在任何设置的地方都受到尊重。你确定这不起作用吗?【参考方案2】:

rp_invoice_id 在 recurring_payments_profile_created 和常规 recurring_payment IPN 中都返回。这是两者的示例。

Array
(
    [payment_cycle] => Monthly
    [txn_type] => recurring_payment_profile_created
    [last_name] => Parr
    [next_payment_date] => 02:00:00 Jan 02, 2014 PST
    [residence_country] => US
    [initial_payment_amount] => 0.00
    [rp_invoice_id] => 5416
    [currency_code] => USD
    [time_created] => 11:40:24 Jan 02, 2014 PST
    [verify_sign] => A0AUpo6gn8Mp.jtr-HUe-oSqCFb6A0LWR7wKLHmMMUUwszTktyPfL8DU
    [period_type] =>  Regular
    [payer_status] => verified
    [tax] => 0.00
    [payer_email] => blahblah@aol.com
    [first_name] => Don
    [receiver_email] => blahblah@usbswiper.com
    [payer_id] => F5T99998MN
    [product_type] => 1
    [payer_business_name] => Testers, LLC
    [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-WK69LR0DU8DU
    [product_name] => USBSwiper Monthly Subscription
    [ipn_track_id] => 6ddc294dddb3f
)

Array
(
    [mc_gross] => 1.95
    [period_type] =>  Regular
    [outstanding_balance] => 0.00
    [next_payment_date] => 02:00:00 Feb 02, 2014 PST
    [protection_eligibility] => Ineligible
    [payment_cycle] => Monthly
    [address_status] => confirmed
    [tax] => 0.00
    [payer_id] => F59999MN
    [address_street] => 96 east granada drive
    [payment_date] => 11:41:08 Jan 02, 2014 PST
    [payment_status] => Completed
    [product_name] => USBSwiper Monthly Subscription
    [charset] => windows-1252
    [rp_invoice_id] => 5416
    [recurring_payment_id] => I-WK69LR0DU8DU
    [address_zip] => 08723
    [first_name] => Blah
    [mc_fee] => 0.34
    [address_country_code] => US
    [address_name] => Testers, LLC
    [notify_version] => 3.7
    [amount_per_cycle] => 1.95
    [payer_status] => verified
    [currency_code] => USD
    [business] => blah@usbswiper.com
    [address_country] => United States
    [address_city] => brick
    [verify_sign] => AoumLIHoQx0AdOelHJVEVpKjHTDiArY--xdOStWxP3msX12oC3zHxpWw
    [payer_email] => blahblah@aol.com
    [initial_payment_amount] => 0.00
    [profile_status] => Active
    [amount] => 1.95
    [txn_id] => 5DL77590UR008354X
    [payment_type] => instant
    [payer_business_name] => Testers, LLC
    [last_name] => Blah
    [address_state] => NJ
    [receiver_email] => blahblah@usbswiper.com
    [payment_fee] => 0.34
    [receiver_id] => M5VRAQYEFCSK6
    [txn_type] => recurring_payment
    [mc_currency] => USD
    [residence_country] => US
    [transaction_subject] => USBSwiper Monthly Subscription
    [payment_gross] => 1.95
    [shipping] => 0.00
    [product_type] => 1
    [time_created] => 11:40:24 Jan 02, 2014 PST
    [ipn_track_id] => 8e2c922895e5c
)

如果您没有在您的 IPN 中获得 rp_invoice_id,那么它一定没有正确包含在您的 API 请求中。

【讨论】:

rp_invoice_id 连接到什么?我发送了 ProfileReference 和 RPINVOICEID,它回来了。 啊,对不起,是的。 API 请求中的实际参数是 PROFILEREFERENCE。该值将作为 rp_invoice_id 在 IPN 中返回 我可以知道如何在 rest api 代码中发送这个 PROFILEREFERENCE 吗?

以上是关于Paypal 定期付款 IPN的主要内容,如果未能解决你的问题,请参考以下文章

Paypal 定期资料,定期付款不收费

Paypal 定期发票用于定期付款

带有快速结账功能的 PayPal 定期付款 - 10 个付款配置文件限制

Paypal IPN - 区分定期付款和初始付款

一次性付款的 PayPal 定期付款

使用信用卡的 PayPal 定期付款