This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
back.php
113 lines (75 loc) · 3.13 KB
/
back.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ameriabank vPOS example backURL</title>
<body>
<?
// Send Receive Code //
try{
$options = array(
'soap_version' => SOAP_1_1,
'exceptions' => true,
'trace' => 1,
'wdsl_local_copy' => true
);
//header('Content-Type: text/plain');
$client = new SoapClient("https://payments.ameriabank.am/webservice/PaymentService.svc?wsdl", $options);
//echo $_POST['orderid'];
//print_r($_POST);
// Set parameters
$parms['paymentfields']['ClientID'] = 'yourclient'; // clientID from Ameriabank
$parms['paymentfields']['Description'] = "Order Description";
$parms['paymentfields'] ['OrderID']= $_POST['orderID'];
$parms['paymentfields'] ['Password']= "yourpassword"; // password from Ameriabank
$parms['paymentfields'] ['PaymentAmount']= 100; // payment amount of your Order
$parms['paymentfields'] ['Username']= "yourusername"; // username from Ameriabank
// Call web service PassMember methord and print response
$webService = $client-> GetPaymentFields($parms);
echo($webService->GetPaymentFieldsResult->amount." ");
echo($webService->GetPaymentFieldsResult->respcode." ");
echo($webService->GetPaymentFieldsResult ->cardnumber." ");
echo($webService->GetPaymentFieldsResult ->paymenttype." ");
echo($webService->GetPaymentFieldsResult ->authcode." ");
if($webService->GetPaymentFieldsResult->respcode == '00')
{
if($webService->GetPaymentFieldsResult ->paymenttype == '1')
{
$webService1 = $client-> Confirmation($parms);
if($webService1->ConfirmationResult->Respcode == '00')
{
// you can print your check or call Ameriabank check example
echo '<iframe id="idIframe" src="https://payments.ameriabank.am/forms/frm_checkprint.aspx?lang=am&paymentid='.$_POST['paymentid'].'" width="560px" height="820px" frameborder="0"></iframe>';
}
else
{
// Rediract to Exception Page
echo "<script type='text/javascript'>\n";
echo "window.location.replace(document.getElementsByTagName('base')[0].href+"."'".$langs_id."'"."+'/error.html');";
echo "</script>";
}
}
else
{
// you can print your check or call Ameriabank check example
echo '<iframe id="idIframe" src="https://payments.ameriabank.am/forms/frm_checkprint.aspx?lang=am&paymentid='.$_POST['paymentid'].'" width="560px" height="820px" frameborder="0"></iframe>';
}
//$db1->request("
// UPDATE orders_history
// SET orders_history.payment_id = '".$webService->GetPaymentIDResult->PaymentID."'
// WHERE orders_history.order_id = '".$_POST['view_id']."'");
}
else
{
// Rediract to Exception Page
echo "<script type='text/javascript'>\n";
echo "window.location.replace(document.getElementsByTagName('base')[0].href+"."'".$langs_id."'"."+'/error.html');";
echo "</script>";
}
} catch (Exception $e) {
echo 'Caught exception:', $e->getMessage(), "\n";
}
// End Send Receive Code //
?>
</body>
</html>