简体   繁体   English

如何使用贝宝订阅按钮返回个人资料ID?

[英]How to return profile id using paypal subscription button?

我正在使用Paypal订阅按钮来订阅该项目,我已经成功订阅了该项目,但作为响应,我得到了(交易ID,签名,抄送,交易状态,成本,currency_code custom_msg),但我需要该特定订阅的profile_id(订阅ID)还。因为当我取消订阅该项目时,我需要profile_id来取消订阅它。

You could use IPN to get the details of the transaction back to your system. 您可以使用IPN将事务的详细信息返回给系统。 This will contain the transaction as well as the profile id. 这将包含交易以及配置文件ID。 You will receive an IPN each time the profile bills. 每次配置文件结算时,您都会收到一个IPN。

Finally got the solution, I have used paypal_nvp gem with GetTransactionDetails API to find the profile id for particular subscription. 终于找到了解决方案,我将paypal_nvp gem与GetTransactionDetails API结合使用来查找特定订阅的配置文件ID。

    p = PaypalNVP.new(true{ :user => "o.bonn_1237393081_biz_api1.solisoft.net", :pass => "1237393093", :cert => "AU2Yv5COwWPCfeYLv34Z766F-gfNAzX6LaQE6VZkHMRq35Gmite-bMXu", :url => "https://api-3t.sandbox.paypal.com/nvp" })
       data = {
        :method => "GetTransactionDetails",
        :TRANSACTIONID =>params[:tx]
       }
       response = p.call_paypal(data)

 profile_id = response["SUBSCRIPTIONID"]

for further information you can go to https://github.com/solisoft/paypal_nvp url 有关更多信息,请访问https://github.com/solisoft/paypal_nvp网址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM