简体   繁体   中英

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. This will contain the transaction as well as the profile id. You will receive an IPN each time the profile bills.

Finally got the solution, I have used paypal_nvp gem with GetTransactionDetails API to find the profile id for particular subscription.

    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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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