Jump to content

Create PayPal Subscription via WHMCS API?


_Mike

Recommended Posts

Hi,

 

Here's what I'm trying to do. If you can point me in the right direction, I will love you forever.

 

What I Have

I have a fully custom checkout process for a recurring product (as in, my checkout code is all custom HTML/php, and passes to the WHMCS API where needed to create accounts, add invoices, etc.). It works just dandy with credit card payments.

 

This Works...

1. charge credit card (for first month's payment) via my own PayPalPro script (no subscription created)

2. addclient to create a WHMCS account (including CC info to use for recurring charges)

3. addorder with recurring bill period (passing WHMCS product id so it pulls the price automatically)

4. addinvoicepayment including the recent PayPal transaction id (from that initial amount charge), so we have it on file

5. acceptorder marks the invoice as paid

6. Do my other custom stuff, send out my own emails, ring the "new sale" bell, etc.

 

MY PROBLEM

How do I let them pay with their PayPal account through my custom checkout process? How do I add a new PayPal subscription to WHMCS through the WHMCS API?

 

SOLUTIONS I'VE CONSIDERED

A. Send them to PayPal, then back to [my custom script], then proceed with steps 2-7 above.

(But then WHMCS wouldn't be able to cancel the subscription, from my understanding, because it was created externally and wouldn't be linked to the WHMCS account --- right?)

 

B. Create WHMCS account/order/invoice, send them to PayPal to create subscription, then back to viewinvoice.php as per the advice in this thread.

(Assuming viewinvoice.php will fulfill the order reliably, how do I then do my other custom post-order stuff? Is there a hook to add that without hacking viewinvoice.php directly? I checked out viewinvoice.tpl, but couldn't figure out how to target the PayPal subscription success case specifically.)

 

C. Use option B, then let a cron or something detect new orders do all my post-order stuff (send out the custom emails, etc.).

 

D. Pay for access to the unencrypted WHMCS source code and copy whatever code WHMCS uses for itself to link PayPal subscriptions to accounts.

 

If you're still reading, I like you. Thanks for taking the time to consider this. It's hard to wrap my head around how WHMCS technically handles money sometimes. Any advice is greatly appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated