-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCheckoutFormCreate.php
More file actions
177 lines (155 loc) · 5.84 KB
/
CheckoutFormCreate.php
File metadata and controls
177 lines (155 loc) · 5.84 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php include('menu.php');?>
<fieldset>
<legend>
<label style="font-weight: bold; width: 250px;">Sepet Bilgileri</label>
</legend>
<table class="table">
<thead>
<tr>
<th>Ürün</th>
<th>Kod</th>
<th>Adet</th>
<th>Birim Fiyat</th>
</tr>
</thead>
<tbody>
<tr>
<td>Telefon</td>
<td>TLF0001</td>
<td>1</td>
<td>50.00 TL</td>
</tr>
<tr>
<td>Bilgisayar</td>
<td>BLG0001</td>
<td>1</td>
<td>50.00 TL</td>
</tr>
<tr>
<td colspan="3">Toplam Tutar</td>
<td>100.00 TL</td>
</tr>
</tbody>
</table>
</fieldset>
<fieldset>
<legend>
<label style="font-weight: bold; width: 250px;">Kargo Adresi Bilgileri</label>
</legend>
<label style="font-weight: bold;">Ad :</label> Murat<br> <label
style="font-weight: bold;">Soyad :</label> Kaya <br> <label
style="font-weight: bold;">Adres :</label> Mevlüt Pehlivan Mah.
Multinet Plaza Şişli <br> <label style="font-weight: bold;">Posta Kodu
:</label> 34782 <br> <label style="font-weight: bold;">Şehir :</label>
İstanbul <br> <label style="font-weight: bold;">Ülke :</label> Türkiye
<br> <label style="font-weight: bold;">Telefon Numarası:</label>
2123886600 <br>
</fieldset>
<fieldset>
<legend>
<label style="font-weight: bold; width: 250px;">Fatura Adresi
Bilgileri</label>
</legend>
<label style="font-weight: bold;">Ad :</label> Murat<br> <label
style="font-weight: bold;">Soyad :</label> Kaya<br> <label
style="font-weight: bold;">Adres :</label> Mevlüt Pehlivan Mah.
Multinet Plaza Şişli<br> <label style="font-weight: bold;">Posta Kodu :</label>
34782<br> <label style="font-weight: bold;">Şehir :</label> İstanbul<br>
<label style="font-weight: bold;">Ülke :</label> Türkiye<br> <label
style="font-weight: bold;">TC Kimlik Numarası :</label> 1234567890<br>
<label style="font-weight: bold;">Telefon Numarası:</label> 2123886600<br>
<label style="font-weight: bold;">Vergi Numarası :</label> 123456<br> <label
style="font-weight: bold;">Vergi Dairesi Adı :</label> Kozyatağı<br> <label
style="font-weight: bold;">Firma Adı:</label> iPara
</fieldset>
<form action="" method="post" class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend>
<label style="font-weight: bold; width: 250px;">Checkout Form Bilgileri</label>
</legend>
<label style="font-weight: bold;">Threed :</label> false<br>
<label style="font-weight: bold;">Amount :</label> 100000<br>
<label style="font-weight: bold;">Allowed Installments :</label> 1,2,3,4,5,6,7,8,9,10,11,12<br>
<label style="font-weight: bold;">CallbackUrl :</label> https://apitest.ipara.com/rest/payment/threed/test/result
<br>
</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-success">Checkout Formu Oluştur</button>
</div>
</div>
</form>
<?php if (!empty($_POST)): ?>
<?php
$settings = new Settings ();
$request = new CheckoutFormCreateRequest ();
$request->OrderId = Helper::Guid ();
$request->Echo = "Echo";
$request->Mode = $settings->Mode;
$request->Amount = "10000"; // 100 tL
$request->Threed = "false";
$request->CallbackUrl = "https://apitest.ipara.com/rest/payment/threed/test/result";
$request->VendorId = "10100";
$request->AllowedInstallments = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
// region Sipariş veren bilgileri
$request->Purchaser = new Purchaser ();
$request->Purchaser->Name = "Murat";
$request->Purchaser->SurName = "Kaya";
$request->Purchaser->BirthDate = "1986-07-11";
$request->Purchaser->Email = "murat@kaya.com";
$request->Purchaser->GsmPhone = "5881231212";
$request->Purchaser->IdentityNumber = "1234567890";
$request->Purchaser->ClientIp = Helper::get_client_ip ();
// endregion
// region Fatura bilgileri
$request->Purchaser->InvoiceAddress = new PurchaserAddress ();
$request->Purchaser->InvoiceAddress->Name = "Murat";
$request->Purchaser->InvoiceAddress->SurName = "Kaya";
$request->Purchaser->InvoiceAddress->Address = "Mevlüt Pehlivan Mah-> Multinet Plaza Şişli";
$request->Purchaser->InvoiceAddress->ZipCode = "34782";
$request->Purchaser->InvoiceAddress->CityCode = "34";
$request->Purchaser->InvoiceAddress->IdentityNumber = "1234567890";
$request->Purchaser->InvoiceAddress->CountryCode = "TR";
$request->Purchaser->InvoiceAddress->TaxNumber = "123456";
$request->Purchaser->InvoiceAddress->TaxOffice = "Kozyatağı";
$request->Purchaser->InvoiceAddress->CompanyName = "iPara";
$request->Purchaser->InvoiceAddress->PhoneNumber = "2122222222";
// endregion
// region Kargo Adresi bilgileri
$request->Purchaser->ShippingAddress = new PurchaserAddress ();
$request->Purchaser->ShippingAddress->Name = "Murat";
$request->Purchaser->ShippingAddress->SurName = "Kaya";
$request->Purchaser->ShippingAddress->Address = "Mevlüt Pehlivan Mah-> Multinet Plaza Şişli";
$request->Purchaser->ShippingAddress->ZipCode = "34782";
$request->Purchaser->ShippingAddress->CityCode = "34";
$request->Purchaser->ShippingAddress->IdentityNumber = "1234567890";
$request->Purchaser->ShippingAddress->CountryCode = "TR";
$request->Purchaser->ShippingAddress->PhoneNumber = "2122222222";
// endregion
// region Ürün bilgileri
$request->Products = array ();
$p = new Product ();
$p->Title = "Telefon";
$p->Code = "TLF0001";
$p->Price = "5000";
$p->Quantity = 1;
$request->Products [0] = $p;
$p = new Product ();
$p->Title = "Bilgisayar";
$p->Code = "BLG0001";
$p->Price = "5000";
$p->Quantity = 1;
$request->Products [1] = $p;
// endregion
$response = CheckoutFormCreateRequest::execute ( $request, $settings );
$output = Helper::formattoJSONOutput($response);
print "<h3>Sonuç:</h3>";
echo "<pre>";
echo htmlspecialchars($output);
echo "</pre>";
?>
<?php endif; ?>
<?php include('footer.php');?>