[TEP-COMMIT] CVS: catalog/catalog/includes/modules/payment pm2checkout.php,1.21,1.22
Harald Ponce de Leon <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tep/catalog/catalog/includes/modules/payment
In directory sc8-pr-cvs1:/tmp/cvs-serv15023/includes/modules/payment
Modified Files:
pm2checkout.php
Log Message:
move the error message from the url to the messageStack class
Index: pm2checkout.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/pm2checkout.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- pm2checkout.php 17 Nov 2003 20:34:31 -0000 1.21
+++ pm2checkout.php 4 Dec 2003 23:43:16 -0000 1.22
@@ -96,6 +96,8 @@
}
function pre_confirmation_check() {
+ global $messageStack;
+
if (PHP_VERSION < 4.1) {
global $_POST;
}
@@ -121,9 +123,11 @@
}
if ( ($result == false) || ($result < 1) ) {
- $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&pm_2checkout_cc_owner_firstname=' . urlencode($_POST['pm_2checkout_cc_owner_firstname']) . '&pm_2checkout_cc_owner_lastname=' . urlencode($_POST['pm_2checkout_cc_owner_lastname']) . '&pm_2checkout_cc_expires_month=' . $_POST['pm_2checkout_cc_expires_month'] . '&pm_2checkout_cc_expires_year=' . $_POST['pm_2checkout_cc_expires_year'];
+ $messageStack->add_session('checkout_payment', $error, 'error');
- tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+ $payment_error_return = 'pm_2checkout_cc_owner_firstname=' . urlencode($_POST['pm_2checkout_cc_owner_firstname']) . '&pm_2checkout_cc_owner_lastname=' . urlencode($_POST['pm_2checkout_cc_owner_lastname']) . '&pm_2checkout_cc_expires_month=' . urlencode($_POST['pm_2checkout_cc_expires_month']) . '&pm_2checkout_cc_expires_year=' . urlencode($_POST['pm_2checkout_cc_expires_year']) . '&pm_2checkout_cc_cvv=' . urlencode($_POST['pm_2checkout_cc_cvv']);
+
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL'));
}
$this->cc_card_type = $cc_validation->cc_type;
@@ -145,6 +149,11 @@
array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES,
'field' => strftime('%B, %Y', mktime(0,0,0,$_POST['pm_2checkout_cc_expires_month'], 1, '20' . $_POST['pm_2checkout_cc_expires_year'])))));
+ if (tep_not_null($_POST['pm_2checkout_cc_cvv'])) {
+ $confirmation['fields'][] = array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER,
+ 'field' => $_POST['pm_2checkout_cc_cvv']);
+ }
+
return $confirmation;
}
@@ -185,12 +194,16 @@
}
function before_process() {
+ global $messageStack;
+
if (PHP_VERSION < 4.1) {
global $_POST;
}
if ($_POST['x_response_code'] != '1') {
- tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE), 'SSL', true, false));
+ $messageStack->add_session('checkout_payment', MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE, 'error');
+
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
}
@@ -199,14 +212,7 @@
}
function get_error() {
- if (PHP_VERSION < 4.1) {
- global $_GET;
- }
-
- $error = array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR,
- 'error' => stripslashes(urldecode($_GET['error'])));
-
- return $error;
+ return false;
}
function check() {
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/