PageRenderTime 23ms CodeModel.GetById 12ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/ZenCart/includes/modules/payment/authorizenet/authorizenet_admin_notification.php

http://goldcat.googlecode.com/
PHP | 106 lines | 74 code | 12 blank | 20 comment | 16 complexity | e0c9df4e4c53eb784c4aee8d05fe3ea5 MD5 | raw file
  1<?php
  2/**
  3 * authorizenet_admin_notification.php admin display component
  4 *
  5 * @package paymentMethod
  6 * @copyright Copyright 2003-2010 Zen Cart Development Team
  7 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  8 * @version $Id: authorizenet_admin_notification.php 15870 2010-04-11 02:18:43Z drbyte $
  9 */
 10
 11  $outputStartBlock = '';
 12  $outputMain = '';
 13  $outputAuth = '';
 14  $outputCapt = '';
 15  $outputVoid = '';
 16  $outputRefund = '';
 17  $outputEndBlock = '';
 18  $output = '';
 19
 20  // strip slashes in case they were added to handle apostrophes:
 21  foreach ($aimdata->fields as $key=>$value){
 22    $aimdata->fields[$key] = stripslashes($value);
 23  }
 24
 25    $outputStartBlock .= '<td><table class="noprint">'."\n";
 26    $outputStartBlock .= '<tr style="background-color : #bbbbbb; border-style : dotted;">'."\n";
 27    $outputEndBlock .= '</tr>'."\n";
 28    $outputEndBlock .='</table></td>'."\n";
 29
 30
 31  if (method_exists($this, '_doRefund')) {
 32    $outputRefund .= '<td><table class="noprint">'."\n";
 33    $outputRefund .= '<tr style="background-color : #dddddd; border-style : dotted;">'."\n";
 34    $outputRefund .= '<td class="main">' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_TITLE . '<br />'. "\n";
 35    $outputRefund .= zen_draw_form('aimrefund', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doRefund', 'post', '', true) . zen_hide_session_id();;
 36
 37    $outputRefund .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND . '<br />';
 38    $outputRefund .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_AMOUNT_TEXT . ' ' . zen_draw_input_field('refamt', 'enter amount', 'length="8"') . '<br />';
 39    $outputRefund .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_CC_NUM_TEXT . ' ' . zen_draw_input_field('cc_number', 'last 4 digits', 'length="20"') . '<br />';
 40    //trans ID field
 41    $outputRefund .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_TRANS_ID . ' ' . zen_draw_input_field('trans_id', 'transaction #', 'length="20"') . '<br />';
 42    // confirm checkbox
 43    $outputRefund .= MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_REFUND_CONFIRM_CHECK . zen_draw_checkbox_field('refconfirm', '', false) . '<br />';
 44    //comment field
 45    $outputRefund .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('refnote', 'soft', '50', '3', MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_DEFAULT_MESSAGE);
 46    //message text
 47    $outputRefund .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_SUFFIX;
 48    $outputRefund .= '<br /><input type="submit" name="buttonrefund" value="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_BUTTON_TEXT . '" title="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_REFUND_BUTTON_TEXT . '" />';
 49    $outputRefund .= '</form>';
 50    $outputRefund .='</td></tr></table></td>'."\n";
 51  }
 52
 53  if (method_exists($this, '_doCapt')) {
 54    $outputCapt .= '<td valign="top"><table class="noprint">'."\n";
 55    $outputCapt .= '<tr style="background-color : #dddddd; border-style : dotted;">'."\n";
 56    $outputCapt .= '<td class="main">' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_TITLE . '<br />'. "\n";
 57    $outputCapt .= zen_draw_form('aimcapture', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doCapture', 'post', '', true) . zen_hide_session_id();
 58    $outputCapt .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE . '<br />';
 59    $outputCapt .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_AMOUNT_TEXT . ' ' . zen_draw_input_field('captamt', 'enter amount', 'length="8"') . '<br />';
 60    $outputCapt .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_TRANS_ID . '<br />' . zen_draw_input_field('captauthid', 'enter auth ID', 'length="32"') . '<br />';
 61    // confirm checkbox
 62    $outputCapt .= MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CAPTURE_CONFIRM_CHECK . zen_draw_checkbox_field('captconfirm', '', false) . '<br />';
 63    //comment field
 64    $outputCapt .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('captnote', 'soft', '50', '2', MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_DEFAULT_MESSAGE);
 65    //message text
 66    $outputCapt .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_SUFFIX;
 67    $outputCapt .= '<br /><input type="submit" name="btndocapture" value="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_BUTTON_TEXT . '" title="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_CAPTURE_BUTTON_TEXT . '" />';
 68    $outputCapt .= '</form>';
 69    $outputCapt .='</td></tr></table></td>'."\n";
 70  }
 71
 72  if (method_exists($this, '_doVoid')) {
 73    $outputVoid .= '<td valign="top"><table class="noprint">'."\n";
 74    $outputVoid .= '<tr style="background-color : #dddddd; border-style : dotted;">'."\n";
 75    $outputVoid .= '<td class="main">' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_TITLE . '<br />'. "\n";
 76    $outputVoid .= zen_draw_form('aimvoid', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doVoid', 'post', '', true) . zen_hide_session_id();
 77    $outputVoid .= MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID . '<br />' . zen_draw_input_field('voidauthid', 'enter auth ID', 'length="32"');
 78    $outputVoid .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_VOID_CONFIRM_CHECK . zen_draw_checkbox_field('voidconfirm', '', false);
 79    //comment field
 80    $outputVoid .= '<br /><br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('voidnote', 'soft', '50', '3', MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_DEFAULT_MESSAGE);
 81    //message text
 82    $outputVoid .= '<br />' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_SUFFIX;
 83    // confirm checkbox
 84    $outputVoid .= '<br /><input type="submit" name="ordervoid" value="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_BUTTON_TEXT . '" title="' . MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_BUTTON_TEXT . '" />';
 85    $outputVoid .= '</form>';
 86    $outputVoid .='</td></tr></table></td>'."\n";
 87  }
 88
 89
 90
 91
 92// prepare output based on suitable content components
 93if (defined('MODULE_PAYMENT_AUTHORIZENET_AIM_STATUS') && MODULE_PAYMENT_AUTHORIZENET_AIM_STATUS != '') {
 94  $output = '<!-- BOF: aim admin transaction processing tools -->';
 95  $output .= $outputStartBlock;
 96  if (MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize' || (isset($_GET['authcapt']) && $_GET['authcapt']=='on')) {
 97    if (method_exists($this, '_doRefund')) $output .= $outputRefund;
 98    if (method_exists($this, '_doCapt')) $output .= $outputCapt;
 99    if (method_exists($this, '_doVoid')) $output .= $outputVoid;
100  } else {
101    if (method_exists($this, '_doRefund')) $output .= $outputRefund;
102    if (method_exists($this, '_doVoid')) $output .= $outputVoid;
103  }
104  $output .= $outputEndBlock;
105  $output .= '<!-- EOF: aim admin transaction processing tools -->';
106}