[TEP-COMMIT] [CVS catalog] Updated secpay module to send order details and use digest functionality as default for security
anonymous-OfajU3CKLf1/[email protected] 26 Mar 2004 18:34:00 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit in catalog/catalog/includes/modules/payment on MAIN
secpay.php +13 -1 1.36 -> 1.37
Updated secpay module to send order details and use digest functionality as default for security
----------
catalog /catalog /includes /modules /payment
secpay.php 1.36 -> 1.37
diff -u -r1.36 -r1.37
--- secpay.php 2004/03/14 21:52:51 1.36
+++ secpay.php 2004/03/26 18:33:59 1.37
@@ -98,8 +98,18 @@
break;
}
+ for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ $order_details .= 'prod=' . $order->products[$i]['name'] . ',item_amout=' . number_format($order->products[$i]['final_price'] * $osC_Currencies->value($sec_currency), $osC_Currencies->currencies[$sec_currency]['decimal_places'], '.', '') . 'x' . $order->products[$i]['qty'] . ';';
+ }
+
+ $order_details .= 'TAX=' . number_format($order->info['tax'] * $osC_Currencies->value($sec_currency), $osC_Currencies->currencies[$sec_currency]['decimal_places'], '.', '') . ';';
+ $order_details .= 'SHIPPING=' . number_format($order->info['shipping_cost'] * $osC_Currencies->value($sec_currency), $osC_Currencies->currencies[$sec_currency]['decimal_places'], '.', '') . ';';
+
+ $trans_id = STORE_NAME . date('Ymdhis');
+ $digest = md5($trans_id . number_format($order->info['total'] * $osC_Currencies->value($sec_currency), $osC_Currencies->currencies[$sec_currency]['decimal_places'], '.', '') . MODULE_PAYMENT_SECPAY_DIGEST_KEY);
+
$process_button_string = tep_draw_hidden_field('merchant', MODULE_PAYMENT_SECPAY_MERCHANT_ID) .
- tep_draw_hidden_field('trans_id', STORE_NAME . date('Ymdhis')) .
+ tep_draw_hidden_field('trans_id', $trans_id) .
tep_draw_hidden_field('amount', number_format($order->info['total'] * $osC_Currencies->value($sec_currency), $osC_Currencies->currencies[$sec_currency]['decimal_places'], '.', '')) .
tep_draw_hidden_field('bill_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) .
tep_draw_hidden_field('bill_addr_1', $order->billing['street_address']) .
@@ -118,6 +128,8 @@
tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) .
tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) .
tep_draw_hidden_field('currency', $sec_currency) .
+ tep_draw_hidden_field('order', $order_details) .
+ tep_draw_hidden_field('digest', $digest) .
tep_draw_hidden_field('callback', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . ';' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', false)) .
tep_draw_hidden_field('backcallback', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', false)) .
tep_draw_hidden_field($osC_Session->name, $osC_Session->id) .
CVSspam 0.2.8
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click