From: Steve Sutton Date: Mon, 3 Apr 2017 21:01:17 +0000 (-0400) Subject: Fix form for the payment exp_month X-Git-Tag: v1.0.7^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=834f3827b14475089a5603119be8b0756269eea8;p=WP-Plugins%2FGlmPayments.git Fix form for the payment exp_month Also remove check for card and number. Error given here is misleading people rather get the error from Authorize.net. Fixing the date when the record is inserted into database. --- diff --git a/glm-payments.php b/glm-payments.php index 0b81b8d..e545419 100755 --- a/glm-payments.php +++ b/glm-payments.php @@ -4,7 +4,7 @@ Plugin URI: www.gaslightmedia.com Description: Integration of the payment system using to AuthorizeNet. Author: Gaslight Media - Version: 1.0.6 + Version: 1.0.7 */ session_start(); diff --git a/includes/payment-display.php b/includes/payment-display.php index b98772f..8fb2ebd 100755 --- a/includes/payment-display.php +++ b/includes/payment-display.php @@ -9,7 +9,7 @@ */ global $wpdb; if(isset($_REQUEST['action'])) -{ +{ if($_REQUEST['action']=='submitpayment') { // Check the form for reCaptcha @@ -27,14 +27,14 @@ if(isset($_REQUEST['action'])) ), 'cookies' => array() ) ); - + $response_code = wp_remote_retrieve_response_code( $response ); $api_response = json_decode( wp_remote_retrieve_body( $response ), true ); if ( $api_response['success'] != true ) { - + get_form_input(); $_SESSION['payment_msg'] = 'Captcha did not verify!'; - + header("Location:".site_url().$_SERVER['REQUEST_URI']); exit; } else { @@ -70,7 +70,7 @@ if(isset($_REQUEST['action'])) // Adjust this to point to the Authorize.Net PHP SDK include dirname(__FILE__) .'/../anet_php_sdk/AuthorizeNet.php'; - + $METHOD_TO_USE = "AIM"; $mysetting = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."payment_setting" ); define("AUTHORIZENET_API_LOGIN_ID",$mysetting[0]->api_login); // Add your API LOGIN ID @@ -90,8 +90,9 @@ if(isset($_REQUEST['action'])) $REQUEST = $_REQUEST; if(authorizepayment($METHOD_TO_USE,$REQUEST,$address1,$city,$state,$country,$zipcode,$emailaddress,$plan)) { + date_default_timezone_set('America/Detroit'); $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`) - VALUES ('".$first_name."', '".$last_name."','".$organization."','".$address."','".$city."','".$country."','".$state."','".$zip."','".$phone."','".$email."','".$donation_type."','".$amount."','".$invoice_num."','".$comment."', '1',now());"; + 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' ) . "');"; $wpdb->query($sql); $post = get_post($post->ID); @@ -551,18 +552,18 @@ function glm_payment_form() { /