関数
RestRouteGuards::addressCheck()
GenericError instance will be returned.説明 説明
A GenericError instance will also be returned if the address country is not a target market country
ファイル: src/Routing/RestRouteGuards.php
public function addressCheck() {
return function () {
global $usces;
$delivery = $_SESSION['usces_entry']['delivery'];
if ($delivery['country'] === 'JP') {
$pref = $delivery['pref'];
if (!in_array($pref, Constants::PREFECTURES, true)) {
return $this->module->errors->getErrorResponse(GenericErrorStore::USCES_DELIVERY_PREF_INVALID);
}
}
if (!in_array($delivery['country'], $usces->options['system']['target_market'], true)) {
return $this->module->errors->getErrorResponse(GenericErrorStore::USCES_COUNTRY_NOT_TARGET_MARGET);
}
};
}