Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Passing different values to my payment gateway


The_Q?

Recommended Posts

Hi, I'm new to os-commerce & know VERY LITTLE about php. My background does include some experience with VBA & SQL, so I got tasked with understanding & implementing a shopping cart for the company, and upto now it's gone surprisingly well. I've just hit a little snag... I want to change one of the value's being sent to my payment gateway. I've installed the payment module for the gateway (Netcash) & tested and processed a payment already, so I know it all works. Basically instead of sending across my store's name I want to send the contents of the comments box... here's a snippet of the payment module:

 

function process_button() {

global $order, $currencies, $currency, $customer_id;

 

$my_currency = 'ZAR';

 

$process_button_string = tep_draw_hidden_field('m_1', MODULE_PAYMENT_NETCASH_USERNAME) .

tep_draw_hidden_field('m_2', MODULE_PAYMENT_NETCASH_PASSWORD) .

tep_draw_hidden_field('m_3', MODULE_PAYMENT_NETCASH_PIN) .

tep_draw_hidden_field('p1', MODULE_PAYMENT_NETCASH_USER_ID) .

tep_draw_hidden_field('p2', $customer_id . '-' . date('Ymdhis')) .

tep_draw_hidden_field('p3', STORE_NAME) .

tep_draw_hidden_field('p4', number_format($order->info['total'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .

tep_draw_hidden_field('m_4', $customer_id ) .

tep_draw_hidden_field('p10', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')) .

tep_draw_hidden_field('Budget', 'Y').

tep_draw_hidden_field('m_10', 'osCsid=' . $sid);

 

return $process_button_string;

}

 

And here's a snippet of the rendered php:

<input type="hidden" name="m_1" value="USERNAME REMOVED">

<input type="hidden" name="m_2" value="password">

<input type="hidden" name="m_3" value="pin">

<input type="hidden" name="p1" value="userid">

<input type="hidden" name="p2" value="UniqueGeneratedReference">

<input type="hidden" name="p3" value="iPeg DSL">

<input type="hidden" name="p4" value="599.50">

<input type="hidden" name="m_4" value="2">

<input type="hidden" name="p10" value="http://www.ipeg.co.za/catalog/checkout_confirmation.php">

<input type="hidden" name="Budget" value="Y">

<input type="hidden" name="m_10" value="osCsid=">

<input type="image" src="includes/languages/english/images/buttons/button_confirm_order.gif" border="0" alt="Confirm Order" title=" Confirm Order ">

 

Instead of my Store Name being submitted across, I want to send this:

2572_71982197387_539692387_2234230_4939384_n.jpg

 

Don't know where to start! Any assistance will be greatly appreciated...

Link to comment
Share on other sites

I sorted this out 2 minutes ago. For the benefit of anyone wanting to do something similar here's the changes I made to my payment module:

 

tep_draw_hidden_field('p3', STORE_NAME) .

~ CHANGED TO ~

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

 

After trawling the the checkout_confirmation.php, I found the code $order->info['comments'] - which set the value of the comment box. I tried in vain to pass that value to process_button function in the payment module. Desperate, I copy-pasted as above & voila! I still don't understand WHY it works - I just know that it does.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...