gpt4 book ai didi

ruby-on-rails - 如何从响应中找到 PayPal 定期付款的当前状态?

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:00 25 4
gpt4 key购买 nike

我正在使用此处找到的 paypal-sdk-rest gem 开发一个应用程序:https://github.com/paypal/PayPal-Ruby-SDK

当状态改变时,PayPal 向我服务器上的 Controller 发送一条 HTTP Post 消息。我让这个 Controller 保存了响应,这样我就可以了。

这是通过的:

{
"payment_cycle":"Monthly",
"txn_type":"recurring_payment_profile_created",
"last_name":"name of the buyer",
"next_payment_date":"03:00:00 Sep 23, 2015 PDT",
"residence_country":"BR",
"initial_payment_amount":"0.00",
"currency_code":"BRL",
"time_created":"06:56:01 Sep 23, 2015 PDT",
"verify_sign":"a long code",
"period_type":" Regular",
"payer_status":"unverified",
"tax":"0.00",
"payer_email":"an email",
"first_name":"the name",
"receiver_email":"an email",
"payer_id":"a short code",
"product_type":"1",
"shipping":"0.00",
"amount_per_cycle":"25.00",
"profile_status":"Active",
"charset":"windows-1252",
"notify_version":"3.8",
"amount":"25.00",
"outstanding_balance":"0.00",
"recurring_payment_id":"a short code",
"product_name":"Prata",
"ipn_track_id":"a short code",
"controller":"notifications",
"action":"create"
}

我必须检查这笔付款的状态,并在我的服务器上更新。我需要知道它是否已获批准,是否由于某种原因待定或被拒绝。

我如何知道付款状态?

Obs:这个响应中 payer_status 和 profile_status 有什么区别?

最佳答案

付款人状态表示帐户持有人是否已通过 PayPal 验证。配置文件状态表示配置文件的状态。事件状态表示配置文件已创建且当前处于事件状态。

来自 PayPal 开发人员 Handling Recurring Payments文档:

The recurring payments actions you may take depend on the status of the profile.

A recurring payments profile can have one of the following status values:

ActiveProfile
PendingProfile
ExpiredProfile
SuspendedProfile
CancelledProfile

If PayPal successfully creates the profile, the profile has an ActiveProfile status. However, if a non-recurring initial payment fails and you set FAILEDINITAMTACTION to CancelOnFailure in the CreateRecurringPaymentsProfile request, PayPal creates the profile with a status of PendingProfile. The profile remains in this status until the initial payment either completes successfully or fails.

A profile has a status of ExpiredProfile when PayPal completes the total billing cycles for the optional trial and the regular payment periods.

您可以使用 GetRecurringPaymentsProfileDetails API 调用以获取付款配置文件的详细信息。它会告诉您交易是否成功以及下一个账单日期。

关于ruby-on-rails - 如何从响应中找到 PayPal 定期付款的当前状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32743157/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com