hi again
i’m running into two problems,
probably obvious but they are both eluding me... and i seem to be going around in circles... so am back for help!!
first one is getting the order number...
i’ve placed the following in
PHP Code:
function process_button()
and it caused the button and everything below it (on the 3of3 checkout page) to disappear,
PHP Code:
$last_order_id = $db->Execute("SELECT * FROM " . TABLE_ORDERS . " ORDER BY orders_id DESC limit 1");
$new_order_id = $last_order_id->fields['orders_id'];
$new_order_id = ($new_order_id + 1);
$new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6);
in order to get to the 3rd party i’m using an arbitrary number
PHP Code:
round(microtime(true) * 10000)
so i get to the 3rd party....
the second problem i’m encountering is when returning to the store.
using a dummy card number the payment is naturally declined,
the transaction responses use posturl for
• transaction_status – either A (Approved) or D (Declined)
• transaction_value_pence – as passed and processed
• order_number – as passed
• date_time - Date and time of order (YYYY-MM-DD HH:MM:SS)
these are passed (as $_POST’s)
and returnurl
the order_number (ono)
this is passed as $_GET
the URLs are set as
PHP Code:
$posturl = zen_href_link(FILENAME_CHECKOUT_PROCESS);
$returnurl= zen_href_link(FILENAME_CHECKOUT_PROCESS);
and then added to and sent to the 3rd party using the
PHP Code:
$process_button_string;
i know the values are getting sent, and then sent back...
...i’ve sent the store to an intercept page where i just echo my $_POST values
and i’ve sent their $_POST and $_GET values to another intercept page which simply echo’s them, (instead of returning to my store).
returning to the store (without diverting to the intercept echo pages) i get
domainname.com/storefolder/index.php?main_page=checkout_process?ono=13712341508486 (the url as seen in the browser address bar)
and the store centre column displays a 404 page not found error
so the obvious questions are
why am i not able to query the order number, or more precisely,
why does the line
PHP Code:
$new_order_id = $last_order_id->fields['orders_id'];
cause the button and everything below to disappear?
and
am i setting the right URLs (posturl and returnurl)?
if not where should i be returning to? (NB: i’ve tried FILENAME_CHECKOUT_PAYMENT too),
if i’m using the correct URLs, then, where do i start defining the action to take (A or !A)? (NB: currently this is in function before_process() but it’s having no effect)
i’ve tried using the posturl intercept page to add the code and point to FILENAME_CHECKOUT_PROCESS (also FILENAME_CHECKOUT_PAYMENT) but it still fails to process the responses
phew, hope you managed to follow the above!
any pointers would be very very much appreciated to get me moving onward again