顧客様の表示

This commit is contained in:
2026-04-27 20:12:54 +09:00
parent ffa6cacd25
commit 9c753e5d09
6 changed files with 186 additions and 5 deletions

View File

@@ -199,7 +199,7 @@ class Openprovider {
//// 顧客様の追加データ
/**
* 顧客様の検索
* 顧客様の一覧
*
* @param array $query 検索クエリー
* @return Result
@@ -219,7 +219,34 @@ class Openprovider {
return \Result::Success('', $res->data);
}
return \Result::Error('TLD一覧の受け取りに失敗。');
return \Result::Error('顧客様一覧の受け取りに失敗。');
}
/**
* 顧客様の表示
*
* @param string $handle ハンドル
* @param bool $withAdditionalData 詳細データ含むか?
* @return Result
*/
public function getCustomer(string $handle, bool $withAdditionalData = false): \Result {
if (!OPENPROVIDER_ENABLED) return \Result::error('エラーOpenProviderは無効です。');
$cacheName = "getcustomer-{$handle}";
$cache = $this->getCache($cacheName);
if (!empty($cache) && (isset($cache['handle']) && $cache['handle'] === $handle)) return \Result::Success('', $cache);
$query = [ 'with_additional_data' => $withAdditionalData ? 'true' : 'false' ];
$uri = "/customers/{$handle}?".http_build_query($query, '', '&', PHP_QUERY_RFC3986);
// kys($uri);
$curl = $this->setupCurl($uri);
$res = $this->curlResult($curl);
if (isset($res->data['data'])) {
$res->data['handle'] = $handle;
$this->setCache($cacheName, $res->data);
return \Result::Success('', $res->data);
}
return \Result::Error('顧客様の受け取りに失敗。');
}
//// ドメイン値段