_Mike Posted November 22, 2013 Share Posted November 22, 2013 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.