Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Realex Forwarding & Return URL's


Recommended Posts

  • 4 months later...


Any chance to get that code you used to connect with Realex?


I installed a payment module (basically modifying an old one) and all is working fine BUT the MD5HASH thingy.


Have a look at this: the following code creates the hidden fields in the form. I manage to make all work, but the MD5HASH is not being calculated, as I just havent got a clue and add the code as is given by REALEX.



function process_button() {

global $HTTP_SERVER_VARS, $order, $customer_id;


$sequence = rand(1, 1000);

$process_button_string = tep_draw_hidden_field('customers_id', $customer_id) .

tep_draw_hidden_field('customers_name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .

tep_draw_hidden_field('customers_company', $order->customer['company']) .

tep_draw_hidden_field('customers_street_address', $order->customer['street_address']) .

tep_draw_hidden_field('customers_suburb', $order->customer['suburb']) .

tep_draw_hidden_field('customers_city', $order->customer['city']) .

tep_draw_hidden_field('customers_postcode', $order->customer['postcode']) .

tep_draw_hidden_field('customers_state', $order->customer['state']) .

tep_draw_hidden_field('customers_country', $order->customer['country']['title']) .

tep_draw_hidden_field('customers_telephone', $order->customer['telephone']) .

tep_draw_hidden_field('customers_email_address', $order->customer['email_address']) .

tep_draw_hidden_field('customers_address_format_id', $order->customer['format_id']) .

tep_draw_hidden_field('delivery_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .

tep_draw_hidden_field('delivery_company', $order->delivery['company']) .

tep_draw_hidden_field('delivery_street_address', $order->delivery['street_address']) .

tep_draw_hidden_field('delivery_suburb', $order->delivery['suburb']) .

tep_draw_hidden_field('delivery_city', $order->delivery['city']) .

tep_draw_hidden_field('delivery_postcode', $order->delivery['postcode']) .

tep_draw_hidden_field('delivery_state', $order->delivery['state']) .

tep_draw_hidden_field('delivery_country', $order->delivery['country']['title']) .

tep_draw_hidden_field('delivery_address_format_id', $order->delivery['format_id']) .

tep_draw_hidden_field('billing_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) .

tep_draw_hidden_field('billing_company', $order->billing['company']) .

tep_draw_hidden_field('billing_street_address', $order->billing['street_address']) .

tep_draw_hidden_field('billing_suburb', $order->billing['suburb']) .

tep_draw_hidden_field('billing_city', $order->billing['city']) .

tep_draw_hidden_field('billing_postcode', $order->billing['postcode']) .

tep_draw_hidden_field('billing_state', $order->billing['state']) .

tep_draw_hidden_field('billing_country', $order->billing['country']['title']) .

tep_draw_hidden_field('billing_address_format_id', $order->billing['format_id']) .

tep_draw_hidden_field('payment_method', $order->info['payment_method']) .

tep_draw_hidden_field('cc_type', $order->info['cc_type']) .

tep_draw_hidden_field('cc_owner', $order->info['cc_owner']) .

tep_draw_hidden_field('realex_cc_owner', $HTTP_POST_VARS['realex_cc_owner']) .

tep_draw_hidden_field('realex_cc_number', $HTTP_POST_VARS['realex_cc_number']) .

tep_draw_hidden_field('realex_cc_expires_month', $HTTP_POST_VARS['realex_cc_expires_month']) .

tep_draw_hidden_field('realex_cc_expires_year', $HTTP_POST_VARS['realex_cc_expires_year']) .

tep_draw_hidden_field('cc_number', $this->cc_card_number) .

tep_draw_hidden_field('cc_expires', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .

tep_draw_hidden_field('orders_status', $order->info['order_status']) .

tep_draw_hidden_field('CURRENCY', $order->info['currency']) .

tep_draw_hidden_field('currency_value', $order->info['currency_value']) .

tep_draw_hidden_field('ORDER_ID', $timestamp = strftime("%Y%m%d%H%M%S") . mt_srand((double)microtime()*1000000)."-".mt_rand(1, 999)) .

tep_draw_hidden_field('orders_status_id', $order->info['order_status']) .


tep_draw_hidden_field('card_number', $this->cc_card_number) .

tep_draw_hidden_field('card_exp_date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .

tep_draw_hidden_field('description', MODULE_PAYMENT_REALEX_TEXT_DESCRIPTION_SHOP) .

tep_draw_hidden_field('cart_id', $this->cartID) .

tep_draw_hidden_field('AMOUNT', number_format($order->info['total'], 2)) .

tep_draw_hidden_field('comments', $order->info['comments']) .

tep_draw_hidden_field('TIMESTAMP', $timestamp = strftime("%Y%m%d%H%M%S") . mt_srand((double)microtime()*1000000)) .

tep_draw_hidden_field('MD5HASH', $md5hash =(

$tmp = "$timestamp.$merchantid.$orderid.$amount.$currency".

$md5hash = md5($tmp).

$tmp = "$md5hash.$secret".

$md5hash = md5($tmp))

) .

tep_draw_hidden_field('AUTO_SETTLE_FLAG', '0') .

tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_REALEX_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));


Does the code you have help me??

Link to comment
Share on other sites

  • 3 weeks later...


Sorry, we had such a nitemare with this code we gave up and installed Protx.. Was much easier to install and they have free technical help.

Good Luck!





Any chance to get that code you used to connect with Realex?


I installed a payment module (basically modifying an old one) and all is working fine BUT the MD5HASH thingy.

Does the code you have help me??

Link to comment
Share on other sites

  • 2 weeks later...



I got it working on a cre loaded install your welcome to the files, i have to admit but most of the fixes were done by realex them selves who where very helpful i found.






My fav site


Spend most my cash there dont tell the wife:-)

Link to comment
Share on other sites

Hi All,

Please don't reply to this topic anymore.

Realex have since done some work on the code and you should talk to them or someone else.

My original post was long ago and since we have stopped using realex as we now use streamline with Protx.

Good Luck & Merry Christmas!



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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

  • Create New...