-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackref.php
More file actions
50 lines (44 loc) · 2.47 KB
/
Copy pathbackref.php
File metadata and controls
50 lines (44 loc) · 2.47 KB
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
50
<?php
require_once 'sdk/config.php';
require_once 'sdk/SimplePayment.class.php';
$orderCurrency = (isset($_REQUEST['order_currency'])) ? $_REQUEST['order_currency'] : 'N/A';
$orderRef = (isset($_REQUEST['order_ref'])) ? $_REQUEST['order_ref'] : 'N/A';
$backref = new SimpleBackRef($config, $orderCurrency );
$backref->order_ref = $orderRef;
$links = "";
if($backref->checkResponse()){
$backStatus = $backref->backStatusArray;
$message = '';
//CCVISAMC
if ($backStatus['PAYMETHOD'] == 'Visa/MasterCard/Eurocard') {
$message .= '<b><font color="green">' . SUCCESSFUL_CARD_AUTHORIZATION . '</font></b><br/>';
if ($backStatus['ORDER_STATUS'] == 'IN_PROGRESS') {
$message .= '<b><font color="green">' . WAITING_FOR_IPN . '</font></b><br/>';
} elseif ($backStatus['ORDER_STATUS' ] == 'PAYMENT_AUTHORIZED') {
$message .= '<b><font color="green">' . WAITING_FOR_IPN . '</font></b><br/>';
} elseif ($backStatus['ORDER_STATUS'] == 'COMPLETE') {
$message .= '<b><font color="green">' . CONFIRMED_IPN . '</font></b><br/>';
}
}
//WIRE
elseif ($backStatus['PAYMETHOD'] == 'Bank/Wire transfer') {
$message = '<b><font color="green">' . SUCCESSFUL_WIRE . '</font></b><br/>';
if ($backStatus['ORDER_STATUS'] == 'PAYMENT_AUTHORIZED' || $backStatus['ORDER_STATUS'] == 'COMPLETE') {
$message .= '<b><font color="green">' . CONFIRMED_WIRE . '</font></b><br/>';
}
}
$links .= '<a href="irn.php?order_ref=' . $backStatus['REFNOEXT'] . '&payrefno=' . $backStatus['PAYREFNO'] . '&ORDER_AMOUNT=331&AMOUNT=331&ORDER_CURRENCY=' . $orderCurrency . '">IRN</a>';
$links .= ' | <a href="idn.php?order_ref=' . $backStatus['REFNOEXT'] . '&payrefno=' . $backStatus['PAYREFNO'] . '&ORDER_AMOUNT=331&ORDER_CURRENCY=' . $orderCurrency . '">IDN</a>';
} else {
$backStatus = $backref->backStatusArray;
$message = '<b><font color="red">' . UNSUCCESSFUL_TRANSACTION . '</font></b><br/>';
$message .= '<b><font color="red">' . END_OF_TRANSACTION . '</font></b><br/>';
$message .= UNSUCCESSFUL_NOTICE . '<br/><br/>';
}
$links .= ' | <a href="ios.php?simpleid=' . $backStatus['PAYREFNO'] . '&order_ref=' . $backStatus['REFNOEXT'] . '&ORDER_CURRENCY=' . $orderCurrency . '">IOS</a>';
$message .= 'PAYREFNO: <b>' . $backStatus['PAYREFNO'] . '</b><br/>';
$message .= 'ORDER ID: <b>' . $backStatus['REFNOEXT'] . '</b><br/>';
$message .= 'BACKREF DATE: <b>' . $backStatus['BACKREF_DATE'] . '</b><br/>';
$backref->errorLogger();
echo $message.$links;
?>