関数
Update::populate()
説明 説明
ファイル: src/API/CheckoutSession/Update.php
public function populate() {
$defaultErrors = $this->getErrorCodeMap();
$defaultErrorMessage = $defaultErrors[parent::INTERNAL_SERVER_ERROR]->message;
$actingLogger = new ActingLogger($this->module);
$this->addError(new GenericError(
self::RESOURCE_NOT_FOUND,
$this->getConstantNameByValue(self::RESOURCE_NOT_FOUND),
404,
function ($message) {
return $message;
},
__('Youre checkout session has expired or is not available', 'wcexaap')
));
$this->addError((new GenericError(
self::INVALID_CHECKOUT_SESSION_STATUS,
$this->getConstantNameByValue(self::INVALID_CHECKOUT_SESSION_STATUS),
422,
function ($message) {
return $message;
},
__('Illegal operation. Please try again.', 'wcexaap')
))->setLogger($actingLogger));
$this->addError((new GenericError(
self::CONSTRAINT_CHECKOUT_RESULT_RETURN_URL_NOT_SET,
$this->getConstantNameByValue(self::CONSTRAINT_CHECKOUT_RESULT_RETURN_URL_NOT_SET),
400,
function ($message) {
return $message;
},
$defaultErrorMessage
))->setLogger($actingLogger));
$this->addError((new GenericError(
self::CONSTRAINT_CHARGE_AMOUNT_NOT_SET,
$this->getConstantNameByValue(self::CONSTRAINT_CHARGE_AMOUNT_NOT_SET),
400,
function ($message) {
return $message;
},
$defaultErrorMessage
))->setLogger($actingLogger));
$this->addError((new GenericError(
self::CONSTRAINT_PAYMENT_INTENT_NOT_SET,
$this->getConstantNameByValue(self::CONSTRAINT_PAYMENT_INTENT_NOT_SET),
400,
function ($message) {
return $message;
},
$defaultErrorMessage
))->setLogger($actingLogger));
$this->addError((new GenericError(
self::CONSTRAINT_BUYER_NOT_ASSOCIATED,
$this->getConstantNameByValue(self::CONSTRAINT_BUYER_NOT_ASSOCIATED),
400,
function ($message) {
return $message;
},
__('Please select your preferred payment method and shipping address to complete the purchase.', 'wcexaap')
))->setLogger($actingLogger));
}