Skip to content

Commit 4370f19

Browse files
authored
Merge branch 'master' into main
2 parents c3f8460 + a456ea4 commit 4370f19

8 files changed

Lines changed: 45 additions & 44 deletions

File tree

src/Commands/MidtransCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MidtransCommand extends BaseCommand
1313
protected $description = 'Midtrans config file publisher';
1414

1515
/**
16-
* Private or protected function
16+
* Private or protected function.
1717
*
1818
* @var string
1919
*/
@@ -22,7 +22,7 @@ class MidtransCommand extends BaseCommand
2222
//--------------------------------------------------------------------
2323

2424
/**
25-
* Copy config file
25+
* Copy config file.
2626
*
2727
* @param array $params
2828
*/
@@ -80,6 +80,7 @@ protected function writeFile(string $path, string $content)
8080
CLI::error('Cancelled');
8181
exit();
8282
}
83+
8384
try {
8485
write_file($appPath . $path, $content);
8586
} catch (\Exception $e) {
@@ -91,4 +92,4 @@ protected function writeFile(string $path, string $content)
9192
}
9293

9394
//--------------------------------------------------------------------
94-
}
95+
}

src/Config/Midtrans.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,41 @@
1414
class Midtrans extends BaseConfig
1515
{
1616
/**
17-
* Your merchant's server key
17+
* Your merchant's server key.
1818
*/
1919
public $serverKey = '';
2020
/**
21-
* Your merchant's client key
21+
* Your merchant's client key.
2222
*/
2323
public $clientKey = '';
2424
/**
25-
* Your ID merchant's key
25+
* Your ID merchant's key.
2626
*/
2727
public $idMerchant = '';
2828
/**
2929
* True for production
30-
* false for sandbox mode
30+
* false for sandbox mode.
3131
*/
3232
public $isProduction = false;
3333
/**
34-
* Set it true to enable 3D Secure by default
34+
* Set it true to enable 3D Secure by default.
3535
*/
3636
public $is3ds = false;
3737
/**
38-
* Set Append URL notification
38+
* Set Append URL notification.
3939
*/
4040
public $appendNotifUrl = '';
4141
/**
42-
* Set Override URL notification
42+
* Set Override URL notification.
4343
*/
4444
public $overrideNotifUrl = '';
4545
/**
4646
* Enable request params sanitizer (validate and modify charge request params).
47-
* See Midtrans_Sanitizer for more details
47+
* See Midtrans_Sanitizer for more details.
4848
*/
4949
public $isSanitized = false;
5050
/**
51-
* Default options for every request
51+
* Default options for every request.
5252
*/
5353
public $curlOptions = [];
54-
}
54+
}

src/Constant.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,59 @@
1212
class Constant
1313
{
1414
/**
15-
* Constant value Base Veritrans
15+
* Constant value Base Veritrans.
1616
*
1717
* @return Sandbox Base URL Veritrans
1818
*
1919
* @version 2.0
2020
*/
2121
const SANDBOX_BASE_URL = 'https://api.sandbox.veritrans.co.id/v2';
2222
/**
23-
* Constant value Base Veritrans
23+
* Constant value Base Veritrans.
2424
*
2525
* @return production Base URL Veritrans
2626
*
2727
* @version 2.0
2828
*/
2929
const PRODUCTION_BASE_URL = 'https://api.veritrans.co.id/v2';
3030
/**
31-
* Constant value Base Midtrans
31+
* Constant value Base Midtrans.
3232
*
3333
* @return Sandbox Base URL Midtrans
3434
*
3535
* @version 1.0
3636
*/
3737
const SNAP_SANDBOX_BASE_URL = 'https://app.sandbox.midtrans.com/snap/v1';
3838
/**
39-
* Constant value Base Midtrans
39+
* Constant value Base Midtrans.
4040
*
4141
* @return Production Base URL Midtrans
4242
*
4343
* @version 1.0
4444
*/
4545
const SNAP_PRODUCTION_BASE_URL = 'https://app.midtrans.com/snap/v1';
4646
/**
47-
* CURL type POST
47+
* CURL type POST.
4848
*
4949
* @return string
5050
*/
5151
const CURL_TYPE_POST = 'POST';
5252
/**
53-
* CURL type GET
53+
* CURL type GET.
5454
*
5555
* @return string
5656
*/
5757
const CURL_TYPE_GET = 'GET';
5858
/**
59-
* Content Type Header request
59+
* Content Type Header request.
6060
*
6161
* @return string
6262
*/
6363
const CONTENT_TYPE = 'application/json';
6464
/**
65-
* Accpet Header request
65+
* Accpet Header request.
6666
*
6767
* @return string
6868
*/
6969
const ACCEPT = 'application/json';
70-
}
70+
}

src/HTTP/APIMidtrans.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public static function call($typeCURL = \Codenom\Midtrans\Constant::CURL_TYPE_GE
3232
$typeCURL,
3333
$endPoint,
3434
['headers' => [
35-
'Content-type' => \Codenom\Midtrans\Constant::CONTENT_TYPE,
36-
'Accept' => \Codenom\Midtrans\Constant::ACCEPT,
35+
'Content-type' => \Codenom\Midtrans\Constant::CONTENT_TYPE,
36+
'Accept' => \Codenom\Midtrans\Constant::ACCEPT,
3737
'Authorization' => 'Basic ' . \base64_encode($serverKey . ':'),
3838
]]
3939
)->getBody();
4040
}
41-
}
41+
}

src/Libraries/Midtrans.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Midtrans
1313
{
1414
/**
15-
* Property Protected
15+
* Property Protected.
1616
*
1717
* @var \Codenom\Midtrans\Config\Midtrans;
1818
*/
@@ -24,7 +24,7 @@ public function __construct()
2424
}
2525

2626
/**
27-
* Get baseUrl
27+
* Get baseUrl.
2828
*
2929
* @return string Midtrans API URL, depends on public $isProduction
3030
*/
@@ -35,7 +35,7 @@ public function getBaseUrl()
3535
}
3636

3737
/**
38-
* Get snapBaseUrl
38+
* Get snapBaseUrl.
3939
*
4040
* @return string Snap API URL, depends on public $isProduction
4141
*/
@@ -44,4 +44,4 @@ public function getSnapBaseUrl()
4444
return $this->config->isProduction ?
4545
\Codenom\Midtrans\Constant::SNAP_PRODUCTION_BASE_URL : \Codenom\Midtrans\Constant::SNAP_SANDBOX_BASE_URL;
4646
}
47-
}
47+
}

src/Midtrans.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Midtrans
2525
protected $midtrans;
2626

2727
/**
28-
* Construct builder class
28+
* Construct builder class.
2929
*
3030
* @param $config \Codenom\Midtrans\Config\Midtrans
3131
*
@@ -40,7 +40,7 @@ public function __construct($config = null)
4040
/**
4141
* Payment with SNAP Midtrans
4242
* Data to Decode before sent CURL Request
43-
* After get response from CURL, then parsing data encode to decode [Object]
43+
* After get response from CURL, then parsing data encode to decode [Object].
4444
*
4545
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
4646
*
@@ -59,4 +59,4 @@ public function getSnapToken(array $placeOrder = [])
5959
)
6060
);
6161
}
62-
}
62+
}

src/Parse/JSONParse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class JSONParse
1313
{
1414
/**
15-
* Encode data
15+
* Encode data.
1616
*
1717
* @var \Laminas\Json\Json
1818
*
@@ -26,7 +26,7 @@ public static function encode($param, bool $bool = true)
2626
}
2727

2828
/**
29-
* Decode data to Object return
29+
* Decode data to Object return.
3030
*
3131
* @var \Laminas\Json\Json
3232
*
@@ -40,7 +40,7 @@ public static function decodeToObject($param)
4040
}
4141

4242
/**
43-
* Decode data to Array return
43+
* Decode data to Array return.
4444
*
4545
* @var \Laminas\Json\Json
4646
*
@@ -52,4 +52,4 @@ public static function decodeToArray($param)
5252
{
5353
return \Laminas\Json\Json::decode($param, \Laminas\Json\Json::TYPE_ARRAY);
5454
}
55-
}
55+
}

src/Veritrans.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class Veritrans
1616
{
1717
/**
18-
* Property Protected
18+
* Property Protected.
1919
*
2020
* @var \Codenom\Midtrans\Config\Midtrans;
2121
*/
@@ -31,7 +31,7 @@ public function __construct($config = null)
3131
/**
3232
* Payment with SNAP Midtrans
3333
* Data to Decode before sent CURL Request
34-
* After get response from CURL, then parsing data encode to decode [Object]
34+
* After get response from CURL, then parsing data encode to decode [Object].
3535
*
3636
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
3737
*
@@ -53,7 +53,7 @@ public function getStatus($id)
5353
/**
5454
* Payment VT Web Checkout Payments
5555
* Data to Decode before sent CURL Request
56-
* After get response from CURL, then parsing data encode to decode [Object]
56+
* After get response from CURL, then parsing data encode to decode [Object].
5757
*
5858
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
5959
*
@@ -76,7 +76,7 @@ public function vtWebCharge($payload)
7676
/**
7777
* Payment VT Web Direct Checkout Payments
7878
* Data to Decode before sent CURL Request
79-
* After get response from CURL, then parsing data encode to decode [Object]
79+
* After get response from CURL, then parsing data encode to decode [Object].
8080
*
8181
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
8282
*
@@ -99,7 +99,7 @@ public function vtWebDirectCharge($payload)
9999
/**
100100
* Appove challenge transaction
101101
* Data to Decode before sent CURL Request
102-
* After get response from CURL, then parsing data encode to decode [Object]
102+
* After get response from CURL, then parsing data encode to decode [Object].
103103
*
104104
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
105105
*
@@ -121,7 +121,7 @@ public function approve($id)
121121
/**
122122
* Cancel transaction before it's setteled
123123
* Data to Decode before sent CURL Request
124-
* After get response from CURL, then parsing data encode to decode [Object]
124+
* After get response from CURL, then parsing data encode to decode [Object].
125125
*
126126
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
127127
*
@@ -143,7 +143,7 @@ public function cancel($id)
143143
/**
144144
* Expire transaction before it's setteled
145145
* Data to Decode before sent CURL Request
146-
* After get response from CURL, then parsing data encode to decode [Object]
146+
* After get response from CURL, then parsing data encode to decode [Object].
147147
*
148148
* @var Type CURL POST = \Codenom\Midtrans\Constant::CURL_TYPE_POST
149149
*
@@ -161,4 +161,4 @@ public function expire($id)
161161
)
162162
);
163163
}
164-
}
164+
}

0 commit comments

Comments
 (0)