From 22d8f85eddb3922f5bc6537ed6bbf855559b9f7c Mon Sep 17 00:00:00 2001 From: Andrew Angell Date: Wed, 12 Mar 2014 15:32:11 -0500 Subject: [PATCH] Fixes issue #4 --- classes/wc-gateway-paypal-express-angelleye.php | 2 +- classes/wc-gateway-paypal-pro-angelleye.php | 2 +- classes/wc-gateway-paypal-pro-payflow-angelleye.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index 6431b7bbe..370d40543 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -897,7 +897,7 @@ function ConfirmPayment($FinalPaymentAmt) if (!empty($this->confirm_order_id)) { $order = new WC_Order($this->confirm_order_id); - $invoice_number = str_replace("#","",$order->get_order_number()); + $invoice_number = preg_replace("/[^0-9,.]/", "", $order->get_order_number()); if ( $order->customer_note ) { diff --git a/classes/wc-gateway-paypal-pro-angelleye.php b/classes/wc-gateway-paypal-pro-angelleye.php index 1077e2b93..45e6a158f 100644 --- a/classes/wc-gateway-paypal-pro-angelleye.php +++ b/classes/wc-gateway-paypal-pro-angelleye.php @@ -645,7 +645,7 @@ function do_payment($order, $card_number, $card_type, $card_exp_month, $card_exp 'handlingamt' => '', // Total handling costs for the order. If you specify handlingamt, you must also specify itemamt. 'desc' => '', // Description of the order the customer is purchasing. 127 char max. 'custom' => $order->customer_note ? wptexturize($order->customer_note) : '', // Free-form field for your own use. 256 char max. - 'invnum' => str_replace("#","",$order->id), // Your own invoice or tracking number + 'invnum' => $invoice_number = preg_replace("/[^0-9,.]/", "", $order->id), // Your own invoice or tracking number 'notifyurl' => '', // URL for receiving Instant Payment Notifications. This overrides what your profile is set to use. 'recurring' => '' // Flag to indicate a recurring transaction. Value should be Y for recurring, or anything other than Y if it's not recurring. To pass Y here, you must have an established billing agreement with the buyer. ); diff --git a/classes/wc-gateway-paypal-pro-payflow-angelleye.php b/classes/wc-gateway-paypal-pro-payflow-angelleye.php index 26b87c3a6..6b9ca8c61 100644 --- a/classes/wc-gateway-paypal-pro-payflow-angelleye.php +++ b/classes/wc-gateway-paypal-pro-payflow-angelleye.php @@ -291,7 +291,7 @@ function do_payment( $order, $card_number, $card_exp, $card_csc, $centinelPAResS 'cvv2'=>$card_csc, // A code printed on the back of the card (or front for Amex) 'recurring'=>'', // Identifies the transaction as recurring. One of the following values: Y = transaction is recurring, N = transaction is not recurring. 'swipe'=>'', // Required for card-present transactions. Used to pass either Track 1 or Track 2, but not both. - 'orderid'=>str_replace("#","",$order->get_order_number()), // Checks for duplicate order. If you pass orderid in a request and pass it again in the future the response returns DUPLICATE=2 along with the orderid + 'orderid'=>preg_replace("/[^0-9,.]/", "", $order->get_order_number()), // Checks for duplicate order. If you pass orderid in a request and pass it again in the future the response returns DUPLICATE=2 along with the orderid 'orderdesc'=>'Order ' . $order->get_order_number() . ' on ' . get_bloginfo( 'name' ), // 'billtoemail'=>$order->billing_email, // Account holder's email address. 'billtophonenum'=>'', // Account holder's phone number.