Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
fake-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Merge Requests
0
Pipelines
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8879a39a
authored
Jan 06, 2021
by
irul
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update - menambahkan script faker u/ data dan nopol u/ test
1 parent
f4669db2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
rest/samsat-banten-new.php
rest/samsat-banten-new.php
View file @
8879a39
...
...
@@ -16,12 +16,17 @@ class SamsatBantenNew
// QUERY PARAMS:
// token=TDA0YTFRUWRIS2FlQjlvUUxoYTNPQzZtTHZ3ZFpWM0cxVGs3UUJ5SDU3bz0=&nopol=B6461XXX&kdpolda=1
// daftar nopol buat test, kalo mo ga dibatesin tinggal set ke array()
$arr_nopol
=
array
(
'A-1092-XK'
,
'A-1223-XO'
,
'A-1248-XO'
,
'A-1253-XO'
,
'A-1259-XO'
,
'A-1277-XO'
,
'A-1288-XK'
,
'A-1307-XO'
,
'A-1320-XO'
,
'A-1350-XO'
,
'A-1364-XK'
,
'A-1398-YV'
,
'A-1512-YF'
,
'A-1791-ZK'
,
'A-2000-XXX'
,
'A-2346-YI'
,
'A-3327-XD'
,
'A-3602-ZAX'
,
'A-3650-ZL'
,
'A-3788-ZAX'
,
'A-3803-ZS'
,
'A-4074-VC'
,
'A-4264-XE'
,
'A-4688-VAM'
,
'A-4881-VAM'
,
'A-5026-ZAX'
,
'A-5168-YW'
,
'A-5502-YX'
,
'A-5513-VAC'
,
'A-5539-ZAX'
,
'A-5649-VAC'
,
'A-5748-VAC'
,
'A-5805-VAJ'
,
'A-5871-ZE'
,
'A-5902-ZAX'
,
'A-6134-XZ'
,
'A-9701-ZX'
,
'B-1045-WYE'
,
'B-1051-VLR'
,
'B-1054-GFH'
,
'B-1054-WYE'
,
'B-1109-GER'
,
'B-1124-NVF'
,
'B-1133-VOO'
,
'B-1149-GKH'
,
'B-1176-JLO'
,
'B-1183-JLO'
,
'B-1191-JLO'
,
'B-1226-JEN'
,
'B-1240-JEN'
,
'B-1241-GEN'
,
'B-1290-GJB'
,
'B-1306-WZX'
,
'B-1356-GJA'
,
'B-1364-JVB'
,
'B-1401-GMH'
,
'B-1470-VLO'
,
'B-1483-JVA'
,
'B-1511-JVB'
,
'B-1523-JVB'
,
'B-1542-WRC'
,
'B-1561-WZX'
,
'B-1625-WZX'
,
'B-1643-VOD'
,
'B-1664-NOP'
,
'B-1681-VJD'
,
'B-1681-WGZ'
,
'B-1696-NVF'
,
'B-1700-VUJ'
,
'B-1739-NFZ'
,
'B-1813-WYD'
,
'B-1864-VMQ'
,
'B-1867-WYD'
,
'B-1883-VUG'
,
'B-1967-ON'
,
'B-2009-VBC'
,
'B-2271-VBC'
,
'B-2285-VBC'
,
'B-6008-WZC'
,
'B-6047-JYX'
,
'B-6355-JFA'
,
'B-6510-VUK'
,
'B-6517-JFC'
,
'B-6623-VIE'
,
'B-6625-VLP'
,
'B-6636-JFC'
,
'B-6677-VHX'
,
'B-6689-VJN'
,
'B-6766-VLB'
,
'B-9050-JQA'
,
'B-9133-JYT'
,
'B-9176-VDB'
,
'B-9609-ON'
,
'B-9654-VAF'
,
'B-9837-GYV'
,
'B-9850-NAH'
);
$token
=
isset
(
$_GET
[
'token'
])
?
$_GET
[
'token'
]
:
''
;
$nopol
=
isset
(
$_GET
[
'nopol'
])
?
$_GET
[
'nopol'
]
:
''
;
$kdpolda
=
isset
(
$_GET
[
'kdpolda'
])
?
$_GET
[
'kdpolda'
]
:
''
;
if
(
empty
(
$token
)
||
empty
(
$nopol
)
||
empty
(
$kdpolda
))
{
self
::
echo_text
(
'Paramater harus lengkap dan diisi semua.'
);
}
else
if
(
count
(
$arr_nopol
)
&&
!
in_array
(
$nopol
,
$arr_nopol
))
{
self
::
echo_text
(
'Data tidak ditemukan.'
);
}
else
{
$params
=
compact
(
"token"
,
"nopol"
,
"kdpolda"
);
// self::echo_json($params);
...
...
@@ -54,20 +59,26 @@ class SamsatBantenNew
private
static
function
inquiry_response
(
$params
=
array
())
{
$faker
=
Faker\Factory
::
create
();
$pokok_pkb
=
$faker
->
numberBetween
(
123
,
999
)
*
100
;
$pokok_swd
=
$faker
->
numberBetween
(
1
,
99
)
*
100
;
$bea_adm
=
50000
;
$jumlah
=
$pokok_pkb
+
$pokok_swd
+
$bea_adm
;
$fake_response
=
array
(
'status'
=>
'OK'
,
'Data'
=>
array
(
'no_polisi'
=>
$params
[
'nopol'
],
'nm_pemilik'
=>
'PT. KENCANA LAJU MANDIRI'
,
'al_pemilik'
=>
'MEDANG LESTARI BLOK A.IV/M7 RT.001 RW. 011 KEL. MEDANG PAGEDANGAN'
,
'nm_pemilik'
=>
strtoupper
(
$faker
->
name
),
//
'PT. KENCANA LAJU MANDIRI',
'al_pemilik'
=>
strtoupper
(
$faker
->
address
),
//
'MEDANG LESTARI BLOK A.IV/M7 RT.001 RW. 011 KEL. MEDANG PAGEDANGAN',
'jenis_kb'
=>
'702'
,
'merek_kb'
=>
'VIAR'
,
'tipe_kb'
=>
'V 10 R'
,
'warna_kb'
=>
'BIRU'
,
'warna_kb'
=>
$faker
->
randomElement
(
array
(
'MERAH'
,
'KUNING'
,
'ABU-ABU'
,
'HIJAU'
,
'BIRU'
,
'HITAM'
)),
,
'tahun_buatan'
=>
'2019'
,
'no_rangka'
=>
'MGRVR10TAKL002430'
,
'no_mesin'
=>
'YX151FMG19002063'
,
'no_ktp'
=>
'0'
,
'no_ktp'
=>
$faker
->
creditCardNumber
()
,
'cc'
=>
'100'
,
'bbm'
=>
'1'
,
'kd_plat_nomor'
=>
'1'
,
...
...
@@ -79,15 +90,15 @@ class SamsatBantenNew
'tgl_pajak'
=>
'19-05-2020'
,
'tgl_akhir_stnk'
=>
'19-05-2025'
,
'tgl_pajak_yad'
=>
'19-05-2021'
,
'bbnkb'
=>
'
202500
0'
,
'bbnkb'
=>
'0'
,
'bbnkb_den'
=>
'0'
,
'pkb'
=>
'283500'
,
'pkb'
=>
$pokok_pkb
,
'pkb_den'
=>
'0'
,
'swdkllj'
=>
'35000'
,
'swdkllj'
=>
$pokok_swd
,
'swdkllj_den'
=>
'0'
,
'bea_adm'
=>
' 100000'
,
'bea_plat'
=>
'
6000
0'
,
'total_bayar'
=>
'2503500'
,
'bea_adm'
=>
$bea_adm
,
'bea_plat'
=>
'0'
,
'total_bayar'
=>
$jumlah
,
),
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment