From 16a850050303aa7a77c96d75134bb99c16e46fe4 Mon Sep 17 00:00:00 2001 From: vSchoener Date: Fri, 28 Oct 2011 14:07:57 +0000 Subject: [PATCH] [+] MO : Update Paypal to use the new system to store payment cc details --- modules/paypal/paypal.php | 10 +++++++++- modules/paypal/validation.php | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php index 55786b32f..190ea67d2 100644 --- a/modules/paypal/paypal.php +++ b/modules/paypal/paypal.php @@ -482,11 +482,19 @@ class PayPal extends PaymentModule } - public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, Shop $shop = null) + public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, + $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, Shop $shop = null) { if (!$this->active) return; + // Set transaction details if pcc is defiend in PaymentModule class_exists + if ($this->pcc) + { + $this->pcc->transaction_id = (isset($extraVars['transaction_id']) ? + $extraVars['transaction_id'] : ''); + } + parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key); if (array_key_exists('transaction_id', $extraVars) AND array_key_exists('payment_status', $extraVars)) diff --git a/modules/paypal/validation.php b/modules/paypal/validation.php index 3101bab88..da0a9e428 100644 --- a/modules/paypal/validation.php +++ b/modules/paypal/validation.php @@ -142,6 +142,12 @@ if (strtoupper($result) == 'VERIFIED') else $errors .= $paypal->getL('verified'); +// Set transaction details if pcc is defiend in PaymentModule class +if (isset($paypal->pcc)) +{ + $this->pcc->transaction_id = (isset(.$_POST['txn_id']) ? $_POST['txn_id'] : ''); +} + if (!empty($errors) AND isset($_POST['custom'])) { if (strtoupper($_POST['payment_status']) == 'PENDING')