11# Laravel Midtrans/Veritrans Library
22
33## Important Note
4- For older version of laravel, please use v0.3.4 as the upper version of the lib won't be supported anymore.
4+
5+ For older version of laravel, please use v0.3.4 as the upper version of the lib won't support it anymore.
56
67 composer require marprinhm/midtrans:v0.3.4
78
@@ -62,19 +63,19 @@ If you want to use the easiest way by using the facade but make sure to use the
6263 'order_id' => time(),
6364 'gross_amount' => 10000
6465 ];
65-
66+
6667 $customer_details = [
6768 'first_name' => 'User',
68696970 'phone' => '08238493894'
7071 ];
71-
72+
7273 $custom_expiry = [
7374 'start_time' => date("Y-m-d H:i:s O", time()),
7475 'unit' => 'day',
7576 'duration' => 2
7677 ];
77-
78+
7879 $item_details = [
7980 'id' => 'PROD-1',
8081 'quantity' => 1,
@@ -84,7 +85,7 @@ If you want to use the easiest way by using the facade but make sure to use the
8485
8586 // Send this options if you use 3Ds in credit card request
8687 $credit_card_option = [
87- 'secure' => true,
88+ 'secure' => true,
8889 'channel' => 'migs'
8990 ];
9091
@@ -114,19 +115,19 @@ If you want to use the easiest way by using the facade but make sure to use the
114115 'order_id' => time(),
115116 'gross_amount' => 10000
116117 ];
117-
118+
118119 $customer_details = [
119120 'first_name' => 'User',
120121121122 'phone' => '08238493894'
122123 ];
123-
124+
124125 $custom_expiry = [
125126 'start_time' => date("Y-m-d H:i:s O", time()),
126127 'unit' => 'day',
127128 'duration' => 2
128129 ];
129-
130+
130131 $item_details = [
131132 'id' => 'PROD-1',
132133 'quantity' => 1,
@@ -150,39 +151,50 @@ If you want to use the easiest way by using the facade but make sure to use the
150151 }
151152
152153## Available Function
154+
153155### Midtrans
154156
155157 Midtrans::getSnapToken($data);
158+
156159` getSnapToken ` will take ` array ` data as parameter that passed to the function and will return ` string ` of token.
157160
158161 Midtrans::status($order_id);
162+
159163` status ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) type for requesting the status of payment.
160164
161165 Midtrans::approve($order_id);
166+
162167` approve ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) and will return ` status_code ` .
163168
164169 Midtrans::cancel($order_id);
170+
165171` cancel ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) and will return ` status_code ` .
166172
167173 Midtrans::expire($order_id);
174+
168175` expire ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ).
169176
170177### Veritrans
171178
172179 Veritrans::vtwebCharge($data);
180+
173181` vtwebCharge ` function take ` array ` data as parameter and will return ` string ` endpoint for merchant redirect user to.
174182
175183 Veritrans::vtdirectCharge($data);
176184
177-
185+
178186 Veritrans::status($order_id);
187+
179188` status ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) type for requesting the status of payment.
180189
181190 Veritrans::approve($order_id);
191+
182192` approve ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) and will return ` status_code ` .
183193
184194 Veritrans::cancel($order_id);
195+
185196` cancel ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ) and will return ` status_code ` .
186197
187198 Veritrans::expire($order_id);
199+
188200` expire ` function will take ` order_id ` in any type of data (preferable ` string ` or ` integer ` ).
0 commit comments