greasemonkey Posted March 5, 2011 Share Posted March 5, 2011 Sorry for the noob question; I'm using the moneris payment module and I'm having trouble displaying the credit card type (visa, M/C, AMEX etc) in orders.php. Anybody else out there having a similar issue? Currently, I get "Credit Card Payments"... But I would like to display' V, M or AX as written to the database in moneris_can_orders in card_type. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2011 Share Posted March 5, 2011 Scott, The Moneris Payment API (and most others) is designed so that the store owner does NOT receive any information related to the credit card transaction. This removes the onus on the store owner for PCI DSS compliance. Chris Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted March 5, 2011 Author Share Posted March 5, 2011 Hi Chris, thank you for your reply... you are correct, of course. However, it does write the credit card type to the database. V, M or AX as written to the database in moneris_can_orders in card_type The problem I have is... this way below my skill level. I was hoping someone else had already completed this type of mod and would share, or help with code. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2011 Share Posted March 5, 2011 hi Scott, I wasn't aware the API wrong any information to the database. However, if you can isolate the field you can add that field to the query and have echo it to the orders.php. Is the CC type field card_type as you have above ? Chris Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted March 5, 2011 Author Share Posted March 5, 2011 Hi Chris,thank you once again. Yes the CC card type is card_type in the DB. Its written to the DB in catalog/includes/moneris/orders_addon_campg.php. while ($moneris_order_detail = tep_db_fetch_array($moneris_order_query)) { switch (strtoupper($moneris_order_detail['card_type'])) { case 'V': $card_type = 'Visa'; break; case 'M': $card_type = 'MasterCard'; break; case 'AX': $card_type = 'American Express'; break; case 'SE': $card_type = 'Sears Card'; break; case 'C': $card_type = 'JCB'; break; case 'DC': $card_type = 'Diners Card'; break; case 'NO': $card_type = 'Novus/Discover'; break; default: $card_type = 'UNKNOWN'; break; } $order_link = "<a href='https://" . $moneris_order_detail['gateway_url'] . "/mpg/reports/order_history/index.php" . "?order_no=" . $moneris_order_detail['moneris_order_id'] . "&orig_txn_no=" . $moneris_order_detail['orig_txn_num'] . "' target='_mpg'>" . $moneris_order_detail['moneris_order_id'] . "</a>"; $message = $moneris_order_detail['message']; $message = str_replace("''", "'", $message); ?> And here; <td class="smalltext" valign="top"><b>Card Type:</b></td> <td class="smalltext"><?php echo $card_type; ?></td> I would presume this needs to be echo'ed in admin/orders.php here; <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $order->info['payment_method']; ?></td> I tried replacing this with; <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $card_type; ?></td> But got nothing... Scott Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted March 5, 2011 Author Share Posted March 5, 2011 I guess I probably need to do something in admin/includes/classes/orders.php too... Just not sure which or where... Maybe here? function query($order_id) { $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, cp_tracking from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $order = tep_db_fetch_array($order_query); And here? $this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'cp_tracking' => $order['cp_tracking'], 'last_modified' => $order['last_modified']); Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted March 5, 2011 Author Share Posted March 5, 2011 Maybe I'm going about this the wrong way. At present I'm not sure which file is writing to payment_method in the orders table. Maybe I could have the Moneris module write the credit card type to this table? Any ideas? Sorry... I konw my questions are coming from someone who (me) obviously lacks the php skills required. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.