-
Notifications
You must be signed in to change notification settings - Fork 3
/
GarantiPayMO.php
159 lines (130 loc) · 5.59 KB
/
GarantiPayMO.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php include('menu.php');?>
<?php $orderid=Helper::GenerateOrderId(); ?>
<h2>Garanti Pay ile Mail Order İşlem </h2>
<br />
<fieldset>
<legend><label style="font-weight:bold;width:250px;">İşlem Bilgileri</label></legend>
<label style="font-weight:bold;">İşlem Tipi : </label> gpdatarequest<br>
<label style="font-weight:bold;">Alt İşlem Tipi : </label> sales<br>
<label style="font-weight:bold;">Terminal ID : </label> 30691297 <br>
<label style="font-weight:bold;">MerchantID : </label> 7000679 <br>
<label style="font-weight:bold;">ProvUserID : </label> PROVAUT <br>
<label style="font-weight:bold;">UserID : </label> PROVAUT<br>
<label style="font-weight:bold;">bnsuseflag : </label> N<br>
<label style="font-weight:bold;">fbbuseflag : </label> N<br>
<label style="font-weight:bold;">chequeuseflag : </label> N<br>
<label style="font-weight:bold;">mileuseflag : </label> N<br>
</fieldset>
<form action="" method="post" class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend><label style="font-weight:bold;width:250px;">Ödeme Bilgileri</label></legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for=""> Ödeme Listesi:</label>
<div class="col-md-4">
<table border="1">
<tr>
<td><label class="col-md-4 control-label" for="">Taksit Sayısı</label></td>
<td><label class="col-md-4 control-label" for="">Taksit Tutarı</label></td>
</tr>
<tr>
<td>2</td>
<td>102</td>
</tr>
<tr>
<td>4</td>
<td>104</td>
</tr>
</table>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> TC Kimlik:</label>
<div class="col-md-4">
<input value="" name="tckn" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> Gsm Numarası:</label>
<div class="col-md-4">
<input value="" name="gsmNumber" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> OrderID:</label>
<div class="col-md-4">
<input value="<?php echo $orderid; ?>" name="orderID" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> İşlem Tutarı:</label>
<div class="col-md-4">
<input value="100" name="transactionAmount" class="form-control input-md" readonly>
</div>
</div>
</fieldset>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for=""></label>
<div class="col-md-4">
<button type="submit" id="" name="" class="btn btn-danger"> Ödeme Yap</button>
</div>
</div>
</form>
<?php if (!empty($_POST)): ?>
<?php
$settings=new Settings();
$terminal=new Terminal();
$request = new GarantiPayMORequest();
$request->Version = $settings->Version;
$request->Mode = $settings->Mode;
$request->Terminal=new Terminal();
$request->Terminal->ID = "30691297";
$request->Terminal->MerchantID = "7000679";
$request->Terminal->ProvUserID = "PROVAUT";
$request->Terminal->UserID = "PROVAUT";
$request->Card=new Card();
$request->Card->CVV2 = "";
$request->Card->ExpireDate = "";
$request->Card->Number = "";
$request->Customer=new Customer();
$request->Customer->EmailAddress = "eticaret@garanti.com.tr";
$request->Customer->IPAddress = "127.0.0.1";
$request->Order=new Order();
$request->Order-> OrderID =$_POST["orderID"];
$request->Order->Description = "";
$request->Installmentnumber = 2;
$request->Installmentamount = "10200";
$request->Installmentnumber1 = 4;
$request->Installmentamount1 = "10400";
$request->bnsuseflag = "N";
$request->fbbuseflag = "N";
$request->chequeuseflag = "N";
$request->mileuseflag = "N";
$request->CompanyName = "Abc";
$request->OrderInfo = "ürün hakkında bilgi içerir.";
$request->TxnTimeOutPeriod = "300";
$request->NotifSendInd = "Y";
$request->TCKN = ($_POST["tckn"] == null ? "" : $_POST["tckn"]);
$request->GSMNumber = ($_POST["gsmNumber"] == null ? "" : $_POST["gsmNumber"]);
$request->InstallmentOnlyForCommercialCard = "N";
$request->TotalInstallmentCount = "2";
$request->ReturnUrl = "https://abc.abc.com/abc";
$request->Transaction=new Transaction();
$request->Transaction->Amount = $_POST["transactionAmount"];
$request->CurrencyCode = 949;
$request->CardholderPresentCode = 0;
$request->ReturnServerUrl = "https://abc.abc.com/abc";
$request->SubType = "sales";
$request->Transaction->Type = "gpdatarequest";
$request->MotoInd = "Y";
$request->Hash=Helper::ComputeHash($request,$settings);
$response = GarantiPayMORequest::execute($request,$settings); //GarantiPayMORequest servisi başlatılması için gerekli servis çağırısını temsil eder.
print "<h3>Sonuç:</h3>";
echo "<pre>";
echo htmlspecialchars ($response);
echo "</pre>";
?>
<?php endif; ?>
<?php include('footer.php');?>