Friday 14 April 2017

Whether or not my PayPal subscription system is working like it's supposed to

I have integrated a PayPal subscription system using the Express Checkout offered by PayPal in my Node app, mainly because I don't want to send card details to my server and back and stay PCI compliant.

Everything in my code works and does what it's supposed to. No errors. However, when I log into my Sandbox account, I can't see any subscription details. This is what the transaction details look like:

enter image description here

Payment is initialized and then executed. Billing plans are created and finally, the billing agreement is completed. Also, the correct amount of money is deducted from my sandbox balance.

The only issue I have is that when this portion of the code is run:

paypal.billingPlan.update(billingPlan.id, billingPlanUpdateAttributes, (err, updatedPlan) => {
   if(err) {
     console.log(err);
   } else {
console.log(updatedPlan);
}});

When I run this in the callback after creating the plan, I get this displayed (this is the updatedPlan object from above):

{ httpStatusCode: 200 }

Essentially, all I get printed is the status code with no other JSON data. The rest of the functions I call all return a nice, full JSON object with id's that I can save for things like canceling subscriptions in the future.

Does this look ready for you? The PayPal API is fairly confusing to work with, so I want to make sure this is working like it's supposed to.

Thanks



via Mabeh Al-Zuq Yadeek

No comments:

Post a Comment