*/\r
global $wpdb;\r
if(isset($_REQUEST['action']))\r
-{ \r
+{\r
if($_REQUEST['action']=='submitpayment')\r
{\r
// Check the form for reCaptcha\r
),\r
'cookies' => array()\r
) );\r
- \r
+\r
$response_code = wp_remote_retrieve_response_code( $response );\r
$api_response = json_decode( wp_remote_retrieve_body( $response ), true );\r
if ( $api_response['success'] != true ) {\r
- \r
+\r
get_form_input();\r
$_SESSION['payment_msg'] = 'Captcha did not verify!';\r
- \r
+\r
header("Location:".site_url().$_SERVER['REQUEST_URI']);\r
exit;\r
} else {\r
\r
// Adjust this to point to the Authorize.Net PHP SDK\r
include dirname(__FILE__) .'/../anet_php_sdk/AuthorizeNet.php';\r
- \r
+\r
$METHOD_TO_USE = "AIM";\r
$mysetting = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."payment_setting" );\r
define("AUTHORIZENET_API_LOGIN_ID",$mysetting[0]->api_login); // Add your API LOGIN ID\r
$REQUEST = $_REQUEST;\r
if(authorizepayment($METHOD_TO_USE,$REQUEST,$address1,$city,$state,$country,$zipcode,$emailaddress,$plan))\r
{\r
+ date_default_timezone_set('America/Detroit');\r
$sql = "INSERT INTO `".$wpdb->prefix."payment` (`first_name`, `last_name`, `organization`, `address`, `city`, `country`, `state`, `zip`, `phone`, `email`, `donation_type`, `amount`, `invoice_num`,`comment`, `status`,`date`)\r
- VALUES ('".$first_name."', '".$last_name."','".$organization."','".$address."','".$city."','".$country."','".$state."','".$zip."','".$phone."','".$email."','".$donation_type."','".$amount."','".$invoice_num."','".$comment."', '1',now());";\r
+ VALUES ('".$first_name."', '".$last_name."','".$organization."','".$address."','".$city."','".$country."','".$state."','".$zip."','".$phone."','".$email."','".$donation_type."','".$amount."','".$invoice_num."','".$comment."', '1','" . date( 'Y-m-d H:i:s' ) . "');";\r
$wpdb->query($sql);\r
\r
$post = get_post($post->ID);\r
</td>\r
<td class="field_cell">\r
<select name="exp_month" class="inputbox exp_month" >\r
- <option value="1" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "1") echo "selected"; if(date('m')=='01'){?> selected="selected"<?php }?>>01</option>\r
- <option value="2" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "2") echo "selected"; if(date('m')=='02'){?> selected="selected"<?php }?>>02</option>\r
- <option value="3" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "3") echo "selected"; if(date('m')=='03'){?> selected="selected"<?php }?>>03</option>\r
- <option value="4" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "4") echo "selected"; if(date('m')=='04'){?> selected="selected"<?php }?>>04</option>\r
- <option value="5" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "5") echo "selected"; if(date('m')=='05'){?> selected="selected"<?php }?>>05</option>\r
- <option value="6" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "6") echo "selected"; if(date('m')=='06'){?> selected="selected"<?php }?>>06</option>\r
- <option value="7" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['state'] === "7") echo "selected"; if(date('m')=='07'){?> selected="selected"<?php }?>>07</option>\r
- <option value="8" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "8") echo "selected"; if(date('m')=='08'){?> selected="selected"<?php }?>>08</option>\r
- <option value="9" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "9") echo "selected"; if(date('m')=='09'){?> selected="selected"<?php }?>>09</option>\r
- <option value="10" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['state'] === "10") echo "selected"; if(date('m')=='10'){?> selected="selected"<?php }?>>10</option>\r
- <option value="11" <?php if(isset($_SESSION['state'] ) && $_SESSION['exp_month'] === "11") echo "selected"; if(date('m')=='11'){?> selected="selected"<?php }?>>11</option>\r
- <option value="12" <?php if(isset($_SESSION['exp_month'] ) && $_SESSION['exp_month'] === "12") echo "selected"; if(date('m')=='12'){?> selected="selected"<?php }?>>12</option>\r
+ <option value="1" <?php echo ($selectedMonth && $selectedMonth == "1") ? "selected": '';?>>01</option>\r
+ <option value="2" <?php echo ($selectedMonth && $selectedMonth == "2") ? "selected": '';?>>02</option>\r
+ <option value="3" <?php echo ($selectedMonth && $selectedMonth == "3") ? "selected": '';?>>03</option>\r
+ <option value="4" <?php echo ($selectedMonth && $selectedMonth == "4") ? "selected": '';?>>04</option>\r
+ <option value="5" <?php echo ($selectedMonth && $selectedMonth == "5") ? "selected": '';?>>05</option>\r
+ <option value="6" <?php echo ($selectedMonth && $selectedMonth == "6") ? "selected": '';?>>06</option>\r
+ <option value="7" <?php echo ($selectedMonth && $selectedMonth == "7") ? "selected": '';?>>07</option>\r
+ <option value="8" <?php echo ($selectedMonth && $selectedMonth == "8") ? "selected": '';?>>08</option>\r
+ <option value="9" <?php echo ($selectedMonth && $selectedMonth == "9") ? "selected": '';?>>09</option>\r
+ <option value="10" <?php echo ($selectedMonth && $selectedMonth == "10") ? "selected": '';?>>10</option>\r
+ <option value="11" <?php echo ($selectedMonth && $selectedMonth == "11") ? "selected": '';?>>11</option>\r
+ <option value="12" <?php echo ($selectedMonth && $selectedMonth == "12") ? "selected": '';?>>12</option>\r
</select> /\r
<select id="exp_year" name="exp_year" class="inputbox exp_month" >\r
<?php $year = date(Y,time()); $num = 1;\r
<?php\r
$output = apply_filters( 'glm_payment_filter_form', ob_get_contents());\r
ob_end_clean();\r
- \r
+\r
return $output;\r
}\r
\r
}\r
else\r
{\r
- $_SESSION['payment_msg'] = $response->response_reason_text; \r
+ $_SESSION['payment_msg'] = $response->response_reason_text;\r
}\r
}\r
elseif (count($REQUEST))\r
// Redirect the user back to your site.\r
//$return_url = $site_root . 'thank_you_page.php?transaction_id=' .$response->transaction_id;\r
paymentemail();\r
- \r
+\r
return true;\r
}\r
else\r
// There was a problem. Do your logic here.\r
// Redirect the user back to your site.\r
$_SESSION['payment_msg'] = $response->response_reason_text;\r
- \r
+\r
header("Location:".site_url().$_SERVER['REQUEST_URI']);\r
exit;\r
- \r
+\r
}\r
echo AuthorizeNetDPM::getRelayResponseSnippet($return_url);\r
}\r
else\r
{\r
- $_SESSION['payment_msg'] = "MD5 Hash failed. Check to make sure your MD5 Setting matches the one in"; \r
+ $_SESSION['payment_msg'] = "MD5 Hash failed. Check to make sure your MD5 Setting matches the one in";\r
}\r
}\r
- \r
+\r
}\r
}\r
\r
}\r
\r
function checkCreditCard($cardnumber, $cardname, &$errornumber, &$errortext) {\r
+ // Get rid of the credit card check.\r
+ return true;\r
\r
// Define the cards we support. You may add additional card types.\r
// Name: As in the selection box of the form - must be same as user's\r
$errortext = $ccErrors [$errornumber];\r
return false;\r
}\r
- \r
+\r
\r
// Now check the modulus 10 check digit - if required\r
if ($cards[$cardType]['checkdigit']) {\r