Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Set request token - constant
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Jun 13, 2020
1 parent e648b68 commit 8d0fb21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Peru/Jne/Async/Dni.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/Peru/Jne/Dni.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8d0fb21

Please sign in to comment.