paypal - “不支持订阅配置文件”

发布于 2024-08-14 20:46:09 字数 476 浏览 3 评论 0原文

我正在使用网站付款标准来创建订阅的定期付款。

我需要找出下一个账单日期是什么时候,所以看起来我可以使用 GetRecurringPaymentsProfileDetails nvp api 和定期付款配置文件 id。

但是,当我发送定期付款配置文件 ID 时,我收到失败消息:

{'ack':'Failure',.... l_longmessage0: 'Subscription profiles not supported by Recurring Payment APIs.',
'l_shortmessage0': 'Subscription Profiles not supported.',....

这是否意味着无法通过 GetRecurringPaymentsProfilesDetails NVP api 检索订阅按钮定期付款配置文件?

如果是这种情况,是否有其他 api 可以获取订阅配置文件的详细信息?

I'm using website payments standard to create recurring payments for subscriptions.

I need to find out when the next billing date is, so it looks like I can use GetRecurringPaymentsProfileDetails nvp api with the recurring payment profile id.

But when I send the recurring payment profile id I get a failure back:

{'ack':'Failure',.... l_longmessage0: 'Subscription profiles not supported by Recurring Payment APIs.',
'l_shortmessage0': 'Subscription Profiles not supported.',....

Does this mean that subscription button recurring payment profiles cannot be retrieved via the GetRecurringPaymentsProfilesDetails NVP api?

If that is the case, is there some other api to get this detail for a subscription profile?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

未央 2024-08-21 20:46:09

GetRecurringPaymentsProfileDetails 不支持通过付款标准创建的订阅配置文件,它仅支持通过 nvp api 创建的定期付款配置文件。

截至撰写本文时,还没有可获取订阅详细信息的 API。如果你想知道当前的状态,你必须使用 IPN 监听器来自己捕获和跟踪所有状态变化。

GetRecurringPaymentsProfileDetails does not support subscription profiles created through payments standard, it only supports recurring payment profiles created through the nvp api.

As of this writing, there is no api to get the subscription details. If you want to know the current status, you have to use an IPN listener to capture and track all status changes yourself.

十六岁半 2024-08-21 20:46:09

您可以使用 /v1/ payments/billing-agreements/{billingid}/transactions?start_date=YYY-MM-DD$end_date=YYY-MM-DD 劫持 API...然后您就可以了检查最近的交易是否符合您的时间段。

You can hijack API by using /v1/payments/billing-agreements/{billingid}/transactions?start_date=YYY-MM-DD$end_date=YYY-MM-DD... then you juste have to check if last transactions fit your period.

思慕 2024-08-21 20:46:09

我是通过这种方式得到的:

let options = {
 method: 'post', headers: {'content-type':'application/json','Access-Control-Allow-Credentials':true},
 auth:{'username':process.env.PAYPALID,'password':process.env.PAYPALPASSWORD},
 url: 'https://api.paypal.com/v1/oauth2/token',
 data: 'grant_type=client_credentials',
}
axios(options).then((response)=>{let paypaltoken=response.data.access_token
axios.get('https://api.paypal.com/v1/payments/billing-agreements/'+agreementid+'/transactions?start_date=2018-01-01&end_date=2019-07-07', { headers: { 'Authorization':'Bearer '+paypaltoken, 'Content-Type':'application/json', } })
.then((transaction)=>{console.log(transaction.data)})
.catch(err => {console.error(err);console.log('err: '+JSON.stringify(err)); res.send (err) })
})
.catch(err => {console.error(err);console.log('err: '+JSON.stringify(err)); res.send (err) })

那么如果你只获取 transaction.data,你将得到一系列事务对象,其 status 是 == Completed 仅当交易正常,也就是说,它还没有被取消,所以只需检查最后一个以进行计划控制。
status 为 == Canceled 时,您就知道该协议不再有效。

如果您收到每月付款,另一种方法是将第一个日期设置为距“now()”2 个月,将第二个日期设置为“now()”。如果您没有收到任何交易,则状态可能不是活动的,但请仔细检查:随机可能存在一些信用卡问题。在这种情况下,我认为 status 可能是 == 到 delayed 或其他东西,但我无法测试它,所以我不知道。这个想法来自这个问题相对的第二个答案值得我以及西里尔·阿尔法罗(Cyril ALFARO)表示感谢。

请注意,根据您的情况,您可能需要在标头中添加 'Access-Control-Allow-Credentials':true 而不是请求中的其他 withCredentials: true 或类似内容。

I am getting it through this way:

let options = {
 method: 'post', headers: {'content-type':'application/json','Access-Control-Allow-Credentials':true},
 auth:{'username':process.env.PAYPALID,'password':process.env.PAYPALPASSWORD},
 url: 'https://api.paypal.com/v1/oauth2/token',
 data: 'grant_type=client_credentials',
}
axios(options).then((response)=>{let paypaltoken=response.data.access_token
axios.get('https://api.paypal.com/v1/payments/billing-agreements/'+agreementid+'/transactions?start_date=2018-01-01&end_date=2019-07-07', { headers: { 'Authorization':'Bearer '+paypaltoken, 'Content-Type':'application/json', } })
.then((transaction)=>{console.log(transaction.data)})
.catch(err => {console.error(err);console.log('err: '+JSON.stringify(err)); res.send (err) })
})
.catch(err => {console.error(err);console.log('err: '+JSON.stringify(err)); res.send (err) })

then if you get just the transaction.data, you will get a series of transaction objects, whose status is == Completed only if the transaction went ok, that is, it has not been cancelled, so just check the last for plan controlling purposes.
When status is == Canceled you know the agreement is not active anymore.

Another way to do it if you receive monthly payments is to set the first date to 2 months from "now()" and the second date to "now()". If you get no transactions then the status could be not active, but double-check: there is the random possibility there could have been some credit card problem. In that case I suppose status could be == to delayed or something else, but I had no possibilities to test it so I don't know. The idea came from this question and the relative second answer which deserves my gratitude as well as Cyril ALFARO.

Note that according to your case you may need to add 'Access-Control-Allow-Credentials':true in the headers instead of other withCredentials: true or similar in the request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文