Jamie,

The way the WorldPay interface works is as follows:

When a customer clicks the final 'Confirm' button in the checkout process a 'Purchase Token' is sent to WorldPay. This contains data such as the customers name and address, the value of the purchase etc. Most of this data is returned to the callback URL via the WorldPay response.

I addition to the standard data you can include any data you want and, provided you use the correct naming conventions, WorldPay will use this data either in your WorldPay customised customer pages or return it unchanged in their response (or both).

Unfortunately you cannot send your order number in the purchase token since the order is not created until a 'Success' response is received from WorldPay. If we were to create the order before sending the purchase token to WorldPay and the customer cancelled the order on the WorldPay screens or their card was rejected we would have an order to fulfill but no payment will have been processed.

I'm afraid you are stuck with WorldPay's Transaction ID as this is their unique identifier for the transaction.

The ZenCart Order Number appears on the callback 'Success' page. This is the earliest time that it can appear since it is newly created as part of the callback process. If you have set a range for each of your installations then each installation should have a unique set of Order Numbers. The Order Number is not provided in the WorldPay callback response it is created by Zencart as a result of a 'Success' response from WorldPay.

I'm not sure what it is you want to use these references for. I do know that it can be difficult to cross reference ZenCart orders with transactions detailed in the WorldPay Statement. The WorldPay statement details the WorldPay Transaction ID and The ZenCart Cart ID. Although both these references appear on the callback page and in the Worldpay email they are not stored in the Orders table within the database. I think what you may really be after is for the WordPay Transaction ID to be stored in the Orders table and displayed in the Orders screens within the ZenCart admin. I know others have asked for this and I have in mind to do this when I revisit the module this month.

If you want the Transction ID to be in the format "ABC-190893444" you will need to amend the following file:

includes/templates/template_default/templates/tpl_wpcallback_default.php

Change line 31 from:

Code:
	if(isset($HTTP_POST_VARS['transId'])) {$transId = $HTTP_POST_VARS[transId];}
to:

Code:
	if(isset($HTTP_POST_VARS['transId'])) {$transId = 'ABC-' . $HTTP_POST_VARS[transId];}
This will display the transaction ID as "ABC-190893444" on the callback page but will not store this value anywhere and the WorldPay Statement will still show the Transaction ID as "190893444" so I don't know if this will have achieved much.

You can find out more about how the WorldPay Select Junior integration works on the support section of the WorldPay website at www.worldpay.co.uk

I hope this helps.

Regards,

Alan