forked from GarantiETicaret/garanti-eticaret-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SMSPreauth.php
109 lines (93 loc) · 4 KB
/
SMSPreauth.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
<?php include('menu.php');?>
<?php $orderid=Helper::GenerateOrderId(); ?>
<h2>SMS Doğrulama/Ön Otorizasyon </h2>
<br />
<fieldset>
<legend><label style="font-weight:bold;width:250px;">Terminal Bilgileri</label></legend>
<label style="font-weight:bold;">Servis Adı : </label> preauth<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>
</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=""> Kart Numarası:</label>
<div class="col-md-4">
<input value="4282209027132016" name="creditCardNo" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> Son Kullanma Tarihi Ay/Yıl: </label>
<div class="col-md-4">
<input value="0520" name="expireDate" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for=""> CVC: </label>
<div class="col-md-4">
<input value="165" name="cvv" 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="" name="transactionAmount" class="form-control input-md">
</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"> İşlem Yap</button>
</div>
</div>
</form>
<?php if (!empty($_POST)): ?>
<?php
$settings=new Settings();
$terminal=new Terminal();
$request = new SMSPreauthRequest();
$request->Version = $settings->Version;
$request->Mode = $settings->Mode;
$request->Customer = new Customer();
$request->Customer->EmailAddress="eticaret@garanti.com.tr";
$request->Customer->IPAddress="127.0.0.1";
$request->Card = new Card();
$request->Card->CVV2=$_POST["cvv"];
$request->Card->ExpireDate=$_POST["expireDate"];
$request->Card->Number=$_POST["creditCardNo"] ;
$request->Order = new Order();
$request->Order->OrderID=$_POST["orderID"] ;
$request->Order->Description="";
$request->Terminal= new Terminal();
$request->Terminal->ProvUserID=$terminal->ProvUserID;
$request->Terminal->UserID=$terminal->UserID;
$request->Terminal->ID=$terminal->ID;
$request->Terminal->MerchantID=$terminal->MerchantID;
$request->Transaction = new Transaction();
$request->Transaction->Amount=$_POST["transactionAmount"];
$request->Transaction->Type="preauth";
$request->CurrencyCode="949";
$request->MotoInd="N";
$request->SubType="sms";
$request->Hash=Helper::ComputeHash($request,$settings);
$response = SMSPreauthRequest::execute($request,$settings); //SMSPreauthRequest 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');?>