From 8d0fb215b4ccbfa028957ce7e2134ad0235db326 Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Sat, 13 Jun 2020 12:34:29 -0500 Subject: [PATCH] Set request token - constant --- src/Peru/Jne/Async/Dni.php | 3 ++- src/Peru/Jne/Dni.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Peru/Jne/Async/Dni.php b/src/Peru/Jne/Async/Dni.php index a10e0ed..c0c06e3 100644 --- a/src/Peru/Jne/Async/Dni.php +++ b/src/Peru/Jne/Async/Dni.php @@ -9,6 +9,7 @@ class Dni { private const URL_CONSULT = 'https://aplicaciones007.jne.gob.pe/srop_publico/Consulta/api/AfiliadoApi/GetNombresCiudadano'; + private const REQUEST_TOKEN = '30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1'; /** * @var ClientInterface @@ -51,7 +52,7 @@ public function get(string $dni): PromiseInterface [ 'Content-Type' => 'application/json;chartset=utf-8', 'Content-Length' => strlen($payload), - 'Requestverificationtoken' => '30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1', + 'Requestverificationtoken' => self::REQUEST_TOKEN, ]) ->then(function ($json) use ($dni) { $result = json_decode($json); diff --git a/src/Peru/Jne/Dni.php b/src/Peru/Jne/Dni.php index eed5afe..7ee8a36 100644 --- a/src/Peru/Jne/Dni.php +++ b/src/Peru/Jne/Dni.php @@ -17,6 +17,8 @@ class Dni implements DniInterface { private const URL_CONSULT = 'https://aplicaciones007.jne.gob.pe/srop_publico/Consulta/api/AfiliadoApi/GetNombresCiudadano'; + private const REQUEST_TOKEN = '30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1'; + /** * @var ClientInterface */ @@ -54,7 +56,7 @@ public function get(string $dni): ?Person json_encode(['CODDNI' => $dni]), [ 'Content-Type' => 'application/json;chartset=utf-8', - 'Requestverificationtoken' => '30OB7qfO2MmL2Kcr1z4S0ttQcQpxH9pDUlZnkJPVgUhZOGBuSbGU4qM83JcSu7DZpZw-IIIfaDZgZ4vDbwE5-L9EPoBIHOOC1aSPi4FS_Sc1:clDOiaq7mKcLTK9YBVGt2R3spEU8LhtXEe_n5VG5VLPfG9UkAQfjL_WT9ZDmCCqtJypoTD26ikncynlMn8fPz_F_Y88WFufli38cUM-24PE1', + 'Requestverificationtoken' => self::REQUEST_TOKEN, ]); $result = json_decode($json);