Forums

Sending Confirmation Email after an Order has been placed

mapme 13 Jul, 2010
Hi,

I am very new to the area of processing payments online and returning the payment details to a chronoform. hopefully someone can help me with this.

I have set up a Chronoform that gathers various customer information. At the end of the form there is a "Pay now" button which will open a URL to a payment engine based on values submitted in the form. in other words the cost paid will be determined by what was entered in the Chronoform.

My problem is consolidating a list of successful payments against the Chronoform data. For example, how can I relate a Successful Payment URL back to the original chronoform database row to update a value saying that payment has been made? Otherwise my client will receive payments and not know who they came from!

A side-effect of this is that I wish to send a Confirmation Email with an order ID (cf_id will be fine for this). If I set the Email to run after the form is submitted then the person might not actually pay. I need to send the email after payment has been receive from my payment engine and the Chronoform row has been updated.

Is this possible or am i asking too much? Again, I am very new to Chornoforms in terms of talking to payment engines.

thanks for all your help as usual.

brendan
GreyHead 14 Jul, 2010
Hi Brendan,

It takes a bit of pre-work to sort out the work-flow for this.

Do your pre-processing in the OnSubmit Before box - to add up the total payable, build the Return URL, etc.

I recommend that you don't use the DB cf-Id as an identifier, (a) it messes up the work-flow and serial id's have some potential security problems. Instead generate a unique random string identifier here.

Basically, then you have to store everything in the database *before* you redirect the user to the payment gateway as at that point you lose all continuity. At this point you need to set a status indicator to 'pending'.

Redirect the uer to the Payment Gatewsy with a return URL to the same form but adding &task=extra and &id=your_unique_id. The ReDiretc plugin can help you with this.

The &task=extra means that ChronoForms will pass the form info to the Extra Code 1 box on the Form Code tab. Add the PHP there to verify the transaction, check the payment success or failure, update the database and send any emails you may need (this all has to be hand-coded as there is no direct ChronoForms functionality available from there).

Note, you can't use the standard Form URL without the &task=extra parameter as it will fail the security checks and be rejected.

Bob
mapme 14 Jul, 2010
Thanks Bob,
Hmmmm, I'll admit that this one looks well over my head!
Anyone interested in helping with this as a contractor?
Brendan
This topic is locked and no more replies can be posted.