Paypal - "Subscription Profiles Not Supported"

I use the website payment standard to create recurring payments for my subscription.

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

But when I send the recurring payment profile identifier, I get a refusal:

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

Does this mean that recurring subscription button payment profiles cannot be obtained through GetRecurringPaymentsProfilesDetails NVP api?

If so, are there any other api to get this detail for the subscription profile?

+6
paypal paypal-subscriptions
source share
3 answers

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

At the time of this writing, there is no api for subscription information. If you want to know the current status, you should use an IPN listener to independently capture and track all status changes.

+7
source share

Can you capture the API with /v1/payments/billing-agreements/{billingid}/transactions?start_date=YYY-MM-DD$end_date=YYY-MM-DD ... then you need to check if the latest transactions match your period .

+1
source share

I get it 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 only the transition.data file, you will get a series of transaction objects whose status == Completed only if the transaction went fine, that is, it was not canceled, so just check the last one for plan control purposes, When status == Canceled you you know that the agreement is no longer active.

Another way to do this if you receive monthly payments is to set the first date for 2 months from "now ()" and the second date to "now ()". If you do not receive transactions, then the status may not be active, but check again: there is a random chance that there might be some problems with a credit card. In this case, I believe that status could be == delayed or something else, but I did not have the opportunity to check it, so I don’t know. The idea arose from this question and the second relative answer, which deserves my thanks as much as Cyril ALFARO.

Please note that depending on your case, you may need to add 'Access-Control-Allow-Credentials':true to the headers instead of other withCredentials: true or similar in the request.

0
source share

All Articles