Jump to content

checkout script, but only on successful payment


atDev

Recommended Posts

How can we include a php file to be run only on the successful payment rather than before they pay?

 

Hey,

 

You can't. Checkoutscript comes before any payment gateway is used, this is how its supposed to run.

 

From,

Adam

Link to comment
Share on other sites

I suppose if you are apt enough with php and mysql, you could create a query for new accounts present in the db, then cron it to trigger the action.

 

Another way perhaps: I haven't tried yet, but it may also be possible to try to run something once payment is posted from the template side, after successful payment is made, you can look for a post and trigger the action.

Link to comment
Share on other sites

You can't. Checkoutscript comes before any payment gateway is used, this is how its supposed to run.

 

Yes I realize that. My question was not about the current checkout script feature. If this is not a feature then it should be.

 

WHMCS should have a plugin system similar to vB. Having the checkoutscript only run before payment is made is useless in many cases simply because it will run for orders where users backup, where the payment is fraud, and so on.

 

Another way perhaps: I haven't tried yet, but it may also be possible to try to run something once payment is posted from the template side, after successful payment is made, you can look for a post and trigger the action.

 

Sure but it would be nice if we could simply access the code for the gateway returns and do it that way. There is always the chance a user won't return automatically to the site after they pay.

 

I suppose if you are apt enough with php and mysql, you could create a query for new accounts present in the db, then cron it to trigger the action. 

 

Yeah thats easy, but my point is having this built in, or the code accessible so we can just make our own plugin. The cron method would also not immediately run the script (for the scenario where you need to say create a support account for the user after they pay, or something along these lines).

Link to comment
Share on other sites

I can totally agree with you on all this. But for now that where it stands...

 

You'll have to ask Matt, but there is an API in the works, that hopefully will allow us do things like this too and much more ;)

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