-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
46 lines (35 loc) · 1.05 KB
/
index.php
File metadata and controls
46 lines (35 loc) · 1.05 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
<?php
require_once 'vendor/autoload.php';
use Illuminate\Http\Request;
use App\View;
use App\Validator;
// Load config
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
Validator::setTranslationPath(__DIR__);
$request = Request::capture();
// Sandbox
$sandbox = new \Ant\Sandbox\Ipay88Sandbox($request);
$sandbox->config([
'merchantCode' => $_ENV['MERCHANT_CODE'],
'merchantKey' => $_ENV['MERCHANT_KEY'],
'signatureType' => $_ENV['SIGNATURE_TYPE'] ?? null,
]);
$sandbox->process();
// dd($sandbox);
// dd($request->all());
// Rendering output
$view = View::make('views', 'storage/views');
try {
echo $view->render('index', [
'request' => $request,
'errors' => $sandbox->errors(),
'sandbox' => $sandbox,
'backendSuccessResponse' => $sandbox->backendSuccessResponse(),
'successResponse' => $sandbox->successResponse(),
'cancelResponse' => $sandbox->cancelResponse(),
'errorResponse' => $sandbox->errorResponse(),
]);
} catch (\Exception $ex) {
echo $ex->getMessage();
}