-
Notifications
You must be signed in to change notification settings - Fork 2
/
transaction_results.php
49 lines (45 loc) · 1.67 KB
/
transaction_results.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
global $wpdb, $user_ID, $nzshpcrt_gateways, $sessionid, $cart_log_id;
do_action('wpsc_transaction_results');
$sessionid = $_GET['sessionid'];
if(!isset($_GET['sessionid']) && isset($_GET['ms']) ){
$sessionid = $_GET['ms'];
}elseif(isset($_GET['ssl_result_message']) && $_GET['ssl_result_message']== 'APPROVAL' ){
$sessionid = $_SESSION['wpsc_sessionid'];
if(get_option('permalink_structure') != '') {
$seperator = "?";
} else {
$seperator = "&";
}
//unset($_SESSION['wpsc_sessionid']);
//header('Location: '.get_option('transact_url').$seperator.'sessionid='.$sessionid);
}
if($_GET['gateway'] == 'google'){
wpsc_google_checkout_submit();
unset($_SESSION['wpsc_sessionid']);
}elseif($_GET['gateway'] == 'noca'){
wpsc_submit_checkout();
}
if($_SESSION['wpsc_previous_selected_gateway']== 'dps') {
$sessionid = decrypt_dps_response();
}
$errorcode = '';
$transactid = '';
if($_REQUEST['eway']=='1') {
$sessionid = $_GET['result'];
}elseif($_REQUEST['eway']=='0'){
echo $_SESSION['eway_message'];
}elseif ($_REQUEST['payflow']=='1') {
echo $_SESSION['payflow_message'];
$_SESSION['payflow_message']='';
}
if($_SESSION['wpsc_previous_selected_gateway'] == 'paypal_certified' && $_SESSION['paypalExpressMessage'] != 'Completed'){
echo $_SESSION['paypalExpressMessage'];
$sessionid = $_SESSION['paypalexpresssessionid'];
}elseif($sessionid == ''){
_e('Sorry your transaction was not accepted.<br /><a href='.get_option("shopping_cart_url").'>Click here to go back to checkout page.</a>');
}else{
echo transaction_results($sessionid, true);
}
$cart_log_id = $wpdb->get_var( "SELECT `id` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $sessionid . " LIMIT 1" );
?>