Best practice for collecting a response from a third party So I'm in the middle of creating a plugin that allows users to make payments with GoCardless. Once payment has been made on the GoCardless website the user needs to be redirected to a PHP script that will confirm the payment was all hunkie-dorie... but....

Where do I put this script? At the moment I've put it inside a folder that is inside the htdocs folder but I'm having problems calling craft()-&gt;plugin_name-&gt;confirmPayment() from this location as craft() is undefined here.

Help greatly appreciated, thanks!
After the payment has been made, you can have the response callback go to an anonymous action method on your plugin's controller.

The URL for that would look something like this:

http://mydomain.com/index.php/actions/myPluginHanlde/myPluginController/myPluginAction


From there you can perform any additional business logic (validation, record saving, etc.), and $this-&gt;redirect(''); to a success template.