Skip to content

Commit

Permalink
Update Response.php
Browse files Browse the repository at this point in the history
Parse the ReactivateDomains response
  • Loading branch information
mvdgeijn authored May 24, 2024
1 parent accdf67 commit e026c37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Factories/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ public static function parse( $result ): array
if( strcmp( \Str::substr($key, 0, 4 ), "Name" ) == 0 ) {
$data[$value->SLD . "." . $value->TLD] = (int)$value->AvailabilityCode;
}

if( strcmp( \Str::substr($key, 0, 6 ), "Domain") == 0 ) {
list($symbol, $fee) = explode(' ', (string)$value->Fee);
$data[$value->SLD . "." . $value->TLD] = [
'domain' => (string)$value->SLD . "." . (string)$value->TLD,
'reactivatableUntil' => \Carbon::createFromFormat( 'd/m/Y H:i:s', (string)$value->ReactivatableUntil . ' 00:00:00'),
'fee' => \Str::replace(',', '.', $fee ),
'currency' => $symbol
];
}
}

return $data;
Expand Down

0 comments on commit e026c37

Please sign in to comment.