This repository was archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
330 lines (269 loc) · 21.1 KB
/
index.php
File metadata and controls
330 lines (269 loc) · 21.1 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<?php
require_once "./vendor/autoload.php";
require_once "./template/header.php";
use puresoft\jibimo\payment\values\JibimoPrivacyLevel; ?>
<div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
<h1 class="display-4">Jibimo API PHP Library Sample</h1>
<p class="lead">Quickly and easily build awesome services and applications using simple and straightforward
Jibimo PHP library.</p>
</div>
<div class="container">
<script>
function copyTokenValue(textArea) {
const token = textArea.value;
document.getElementById("requestTokenInput").value = token;
document.getElementById("payTokenInput").value = token;
document.getElementById("extendedPayTokenInput").value = token;
document.getElementById("validateRequestTokenInput").value = token;
document.getElementById("validatePayTokenInput").value = token;
document.getElementById("validateExtendedPayTokenInput").value = token;
}
</script>
<div class="form-group">
<label for="tokenTextArea">Your API Token</label>
<textarea class="form-control" id="tokenTextArea" rows="3" onchange="copyTokenValue(this);"></textarea>
</div>
<div class="card-deck mb-3 text-center">
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Request Money</h4>
</div>
<div class="card-body">
<!-- Request money form -->
<form method="post" action="request-money.php" target="_blank">
<input type="hidden" name="token" id="requestTokenInput">
<div class="form-group">
<label for="requestMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="requestMobileInput" aria-describedby="requestMobileHelp" placeholder="Enter mobile number of user" required>
<small id="requestMobileHelp" class="form-text text-muted">This mobile number will be used to request money from.</small>
</div>
<div class="form-group">
<label for="requestAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="requestAmountInput" aria-describedby="requestAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="requestAmountHelp" class="form-text text-muted">This amount must be in Toman.</small>
</div>
<div class="form-group">
<label for="requestPrivacyInput">Jibimo Privacy Level</label>
<select class="form-control" id="requestPrivacySelect" name="privacy">
<option><?= JibimoPrivacyLevel::PERSONAL ?></option>
<option><?= JibimoPrivacyLevel::FRIEND ?></option>
<option><?= JibimoPrivacyLevel::PUBLIC ?></option>
</select>
</div>
<div class="form-group">
<label for="requestTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="requestTrackerInput" aria-describedby="requestTrackerHelp" placeholder="Enter your tracker ID" value="<?= uniqid() ?>" required>
<small id="requestTrackerHelp" class="form-text text-muted">This tracker ID is something like factor ID in your system.</small>
</div>
<div class="form-group">
<label for="requestDescriptionInput">Description (Optional)</label>
<input type="text" class="form-control" name="description" id="requestDescriptionInput" aria-describedby="requestDescriptionHelp" placeholder="Enter transaction description here">
<small id="requestDescriptionHelp" class="form-text text-muted">Use emojies like 👍 , 🎁 and 😃 to make your transaction look beautiful in Jibimo.</small>
</div>
<button type="submit" class="btn btn-lg btn-block btn-outline-primary">Request Money</button>
</form>
</div>
</div>
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Pay Money</h4>
</div>
<div class="card-body">
<!-- Pay form -->
<form method="post" action="pay-money.php" target="_blank">
<input type="hidden" name="token" id="payTokenInput">
<div class="form-group">
<label for="payMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="payMobileInput" aria-describedby="payMobileHelp" placeholder="Enter mobile number of user" required>
<small id="payMobileHelp" class="form-text text-muted">This mobile number will be used to pay your money to.</small>
</div>
<div class="form-group">
<label for="payAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="payAmountInput" aria-describedby="payAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="payAmountHelp" class="form-text text-muted">This amount must be in Toman.</small>
</div>
<div class="form-group">
<label for="payPrivacyInput">Jibimo Privacy Level</label>
<select class="form-control" id="payPrivacySelect" name="privacy">
<option><?= JibimoPrivacyLevel::PERSONAL ?></option>
<option><?= JibimoPrivacyLevel::FRIEND ?></option>
<option><?= JibimoPrivacyLevel::PUBLIC ?></option>
</select>
</div>
<div class="form-group">
<label for="payTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="payTrackerInput" aria-describedby="payTrackerHelp" placeholder="Enter your tracker ID" value="<?= uniqid() ?>" required>
<small id="payTrackerHelp" class="form-text text-muted">This tracker ID is something like factor ID in your system.</small>
</div>
<div class="form-group">
<label for="payDescriptionInput">Description (Optional)</label>
<input type="text" class="form-control" name="description" id="payDescriptionInput" aria-describedby="payDescriptionHelp" placeholder="Enter transaction description here">
<small id="payDescriptionHelp" class="form-text text-muted">Use emojies like 👍 , 🎁 and 😃 to make your transaction look beautiful in Jibimo.</small>
</div>
<div class="alert alert-primary" role="alert">
Make sure your business account has enough balance to perform the transaction.
</div>
<button type="submit" class="btn btn-lg btn-block btn-warning">Pay Money</button>
</form>
</div>
</div>
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Extended Pay AKA Direct Pay</h4>
</div>
<div class="card-body">
<!-- Extended pay form -->
<form method="post" action="extended-pay.php" target="_blank">
<input type="hidden" name="token" id="extendedPayTokenInput">
<div class="form-group">
<label for="extendedPayMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="extendedPayMobileInput" aria-describedby="extendedPayMobileHelp" placeholder="Enter mobile number of user" required>
<small id="extendedPayMobileHelp" class="form-text text-muted">This mobile number will be used to pay your money to.</small>
</div>
<div class="form-group">
<label for="extendedPayAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="extendedPayAmountInput" aria-describedby="extendedPayAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="extendedPayAmountHelp" class="form-text text-muted">This amount must be in Toman.</small>
</div>
<div class="form-group">
<label for="extendedPayPrivacyInput">Jibimo Privacy Level</label>
<select class="form-control" id="extendedPayPrivacySelect" name="privacy">
<option><?= JibimoPrivacyLevel::PERSONAL ?></option>
<option><?= JibimoPrivacyLevel::FRIEND ?></option>
<option><?= JibimoPrivacyLevel::PUBLIC ?></option>
</select>
</div>
<div class="form-group">
<label for="extendedPayTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="extendedPayTrackerInput" aria-describedby="extendedPayTrackerHelp" placeholder="Enter your tracker ID" value="<?= uniqid() ?>" required>
<small id="extendedPayTrackerHelp" class="form-text text-muted">This tracker ID is something like factor ID in your system.</small>
</div>
<div class="form-group">
<label for="extendedPayDescriptionInput">Description (Optional)</label>
<input type="text" class="form-control" name="description" id="extendedPayDescriptionInput" aria-describedby="extendedPayDescriptionHelp" placeholder="Enter transaction description here">
<small id="extendedPayDescriptionHelp" class="form-text text-muted">Use emojies like 👍 , 🎁 and 😃 to make your transaction look beautiful in Jibimo.</small>
</div>
<div class="form-group">
<label for="extendedPayNameInput">Name (Optional)</label>
<input type="text" class="form-control" name="name" id="extendedPayNameInput" aria-describedby="extendedPayNameHelp" placeholder="Enter first name of user here">
<small id="extendedPayNameHelp" class="form-text text-muted">This should be the name of IBAN (Sheba) owner.</small>
</div>
<div class="form-group">
<label for="extendedPayFamilyInput">Family (Optional)</label>
<input type="text" class="form-control" name="family" id="extendedPayFamilyInput" aria-describedby="extendedPayFamilyHelp" placeholder="Enter last name of user here">
<small id="extendedPayFamilyHelp" class="form-text text-muted">This should be the family of IBAN (Sheba) owner.</small>
</div>
<div class="form-group">
<label for="extendedPayIbanInput">IBAN (Sheba)</label>
<input type="text" class="form-control" name="iban" id="extendedPayIbanInput" aria-describedby="extendedPayIbanHelp" placeholder="Enter IBAN (Sheba) number of user who you want tot pay to here" required>
<small id="extendedPayIbanHelp" class="form-text text-muted">This is a 26 character string which will start with `IR`.</small>
</div>
<div class="alert alert-primary" role="alert">
Make sure your business account has enough balance to perform the transaction.
</div>
<button type="submit" class="btn btn-lg btn-block btn-warning">Directly Pay Money</button>
</form>
</div>
</div>
</div>
<!-- Validations -->
<div class="card-deck mb-3 text-center">
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Validate Request Money</h4>
</div>
<div class="card-body">
<!-- Request validation form -->
<form method="post" action="validate-request-money.php" target="_blank">
<input type="hidden" name="token" id="validateRequestTokenInput">
<div class="form-group">
<label for="validateRequestTransactionIdInput">Transaction ID</label>
<input type="text" class="form-control" name="id" id="validateRequestTransactionIdInput" aria-describedby="validateRequestTransactionIdHelp" placeholder="Enter transaction ID here" required>
<small id="validateRequestTransactionIdHelp" class="form-text text-muted">This is the transaction ID which you want to validate.</small>
</div>
<div class="form-group">
<label for="validateRequestMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="validateRequestMobileInput" aria-describedby="validateRequestMobileHelp" placeholder="Enter mobile number of user" required>
<small id="validateRequestMobileHelp" class="form-text text-muted">This should be the mobile number that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validateRequestAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="validateRequestAmountInput" aria-describedby="validateRequestAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="validateRequestAmountHelp" class="form-text text-muted">This should be the same amount that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validateRequestTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="validateRequestTrackerInput" aria-describedby="validateRequestTrackerHelp" placeholder="Enter your tracker ID" required>
<small id="validateRequestTrackerHelp" class="form-text text-muted">This should be the same tracker ID that was used in transaction.</small>
</div>
<button type="submit" class="btn btn-lg btn-block btn-outline-success">Validate Request Money</button>
</form>
</div>
</div>
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Validate Pay Money</h4>
</div>
<div class="card-body">
<!-- Pay validation form -->
<form method="post" action="validate-pay-money.php" target="_blank">
<input type="hidden" name="token" id="validatePayTokenInput">
<div class="form-group">
<label for="validatePayTransactionIdInput">Transaction ID</label>
<input type="text" class="form-control" name="id" id="validatePayTransactionIdInput" aria-describedby="validatePayTransactionIdHelp" placeholder="Enter transaction ID here" required>
<small id="validatePayTransactionIdHelp" class="form-text text-muted">This is the transaction ID which you want to validate.</small>
</div>
<div class="form-group">
<label for="validatePayMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="validatePayMobileInput" aria-describedby="validatePayMobileHelp" placeholder="Enter mobile number of user" required>
<small id="validatePayMobileHelp" class="form-text text-muted">This should be the mobile number that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validatePayAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="validatePayAmountInput" aria-describedby="validatePayAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="validatePayAmountHelp" class="form-text text-muted">This should be the same amount that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validatePayTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="validatePayTrackerInput" aria-describedby="validatePayTrackerHelp" placeholder="Enter your tracker ID" required>
<small id="validatePayTrackerHelp" class="form-text text-muted">This should be the same tracker ID that was used in transaction.</small>
</div>
<button type="submit" class="btn btn-lg btn-block btn-outline-success">Validate Pay</button>
</form>
</div>
</div>
<div class="card mb-4 shadow-sm">
<div class="card-header">
<h4 class="my-0 font-weight-normal">Validate Extended Pay</h4>
</div>
<div class="card-body">
<!-- Extended pay validation form -->
<form method="post" action="validate-extended-pay.php" target="_blank">
<input type="hidden" name="token" id="validateExtendedPayTokenInput">
<div class="form-group">
<label for="validatePayTransactionIdInput">Transaction ID</label>
<input type="text" class="form-control" name="id" id="validateExtendedPayTransactionIdInput" aria-describedby="validateExtendedPayTransactionIdHelp" placeholder="Enter transaction ID here" required>
<small id="validateExtendedPayTransactionIdHelp" class="form-text text-muted">This is the transaction ID which you want to validate.</small>
</div>
<div class="form-group">
<label for="validateExtendedPayMobileInput">Mobile number</label>
<input type="text" class="form-control" name="mobile" id="validateExtendedPayMobileInput" aria-describedby="validateExtendedPayMobileHelp" placeholder="Enter mobile number of user" required>
<small id="validateExtendedPayMobileHelp" class="form-text text-muted">This should be the mobile number that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validateExtendedPayAmountInput">Amount in Toman</label>
<input type="number" class="form-control" name="amount" id="validateExtendedPayAmountInput" aria-describedby="validateExtendedPayAmountHelp" placeholder="Enter amount of transaction in Toman" required>
<small id="validateExtendedPayAmountHelp" class="form-text text-muted">This should be the same amount that was used in transaction.</small>
</div>
<div class="form-group">
<label for="validateExtendedPayTrackerInput">Tracker ID</label>
<input type="text" class="form-control" name="tracker" id="validateExtendedPayTrackerInput" aria-describedby="validateExtendedPayTrackerHelp" placeholder="Enter your tracker ID" required>
<small id="validateExtendedPayTrackerHelp" class="form-text text-muted">This should be the same tracker ID that was used in transaction.</small>
</div>
<button type="submit" class="btn btn-lg btn-block btn-outline-success">Validate Direct Pay</button>
</form>
</div>
</div>
</div>
<?php
require_once "./template/footer.php";