関数
ClientErrorStore::populate()
戻り値 戻り値
ファイル: src/Errors/ClientErrorStore.php
public function populate() {
$defaultErrors = $this->getErrorCodeMap();
$unknownErrorMessage = $defaultErrors[ErrorStore::UNKNOWN_ERROR]->message;
$this->addError(new LinePayError(
self::FURIGANA_NAMES_REQUIRED,
$this->getConstantNameByValue(self::FURIGANA_NAMES_REQUIRED),
400,
__('Japan delivery addresses require the recipients name in furigana.', 'wcex_linepay'),
__('Japan delivery addresses require the recipients name in furigana.', 'wcex_linepay')
));
$this->addError((new LinePayError(
self::MERCHANT_NOT_FOUND,
$this->getConstantNameByValue(self::MERCHANT_NOT_FOUND),
404,
function ($message) {
return $message;
},
__('LINE Pay is currently unavailable on this website.', 'wcex_linepay'),
__('You are not signed up to use LINE Pay.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::MERCHANT_NOT_ALLOWED,
$this->getConstantNameByValue(self::MERCHANT_NOT_ALLOWED),
401,
function ($message) {
return $message;
},
__('LINE Pay is currently unavailable on this website.', 'wcex_linepay'),
__('The Merchant cannot use LINE Pay.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::HEADER_INFO_ERROR,
$this->getConstantNameByValue(self::HEADER_INFO_ERROR),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('HTTP Header info error.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::ERROR_IN_AMOUNT_SCALE,
$this->getConstantNameByValue(self::ERROR_IN_AMOUNT_SCALE),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Could not parse amount.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::INVALID_ONE_TIME_KEY,
$this->getConstantNameByValue(self::INVALID_ONE_TIME_KEY),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Invalid oneTimeKey.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::PAYMENT_IN_PROGRESS,
$this->getConstantNameByValue(self::PAYMENT_IN_PROGRESS),
400,
function ($message) {
return $message;
},
__('Payment is already in progress.', 'wcex_linepay'),
__('Payment in progress.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::UNSUPPORTED_CURRENCY,
$this->getConstantNameByValue(self::UNSUPPORTED_CURRENCY),
400,
function ($message) {
return $message;
},
__('LINE Pay is currently unavailable. Please contact the seller for more info.', 'wcex_linepay'),
__('Unsupported currency.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError(new LinePayError(
self::AMOUNT_IS_ZERO,
$this->getConstantNameByValue(self::AMOUNT_IS_ZERO),
400,
__('The payment amount must be greater than 0.', 'wcex_linepay'),
__('The payment amount must be greater than 0.', 'wcex_linepay')
));
$this->addError((new LinePayError(
self::MERCHANT_PREAPPROVED_PAYMENT_NOT_ALLOWED,
$this->getConstantNameByValue(self::MERCHANT_PREAPPROVED_PAYMENT_NOT_ALLOWED),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('This Merchant cannot use preapproved payment.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::PARAMETER_ERROR,
$this->getConstantNameByValue(self::PARAMETER_ERROR),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Parameter error.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::JSON_FORMAT_ERROR,
$this->getConstantNameByValue(self::JSON_FORMAT_ERROR),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('JSON format error.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::USER_SUSPENDED_1101,
$this->getConstantNameByValue(self::USER_SUSPENDED_1101),
404,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Not a LINE Pay member.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::USER_SUSPENDED_1102,
$this->getConstantNameByValue(self::USER_SUSPENDED_1102),
403,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('The member is unable to proceed with the transaction.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CREDIT_CARD_NOT_AVAILABLE,
$this->getConstantNameByValue(self::CREDIT_CARD_NOT_AVAILABLE),
400,
function ($message) {
return $message;
},
__('The credit card was declined.', 'wcex_linepay'),
__('The credit card was declined.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::ACCOUNT_STATUS_ERROR,
$this->getConstantNameByValue(self::ACCOUNT_STATUS_ERROR),
400,
function ($message) {
return $message;
},
__('There was a problem with the payment account.', 'wcex_linepay'),
__('There was a problem with the payment account.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::INSUFFICIENT_BALANCE,
$this->getConstantNameByValue(self::INSUFFICIENT_BALANCE),
400,
function ($message) {
return $message;
},
__('Insufficient funds.', 'wcex_linepay'),
__('Insufficient funds.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::NO_TRANSACTIONS_FOUND,
$this->getConstantNameByValue(self::NO_TRANSACTIONS_FOUND),
404,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('No such transaction found.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::TRANSACTION_ALREADY_MADE,
$this->getConstantNameByValue(self::TRANSACTION_ALREADY_MADE),
400,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('There is a history of transactions with the same transactionId.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::REQUEST_AND_REAL_AMOUNT_DIFFER,
$this->getConstantNameByValue(self::REQUEST_AND_REAL_AMOUNT_DIFFER),
409,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('The payment amount is different than the requested amount.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::OMITTED_REQUEST_PAYMENT_INFO,
$this->getConstantNameByValue(self::OMITTED_REQUEST_PAYMENT_INFO),
404,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Payment request information not found.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::PAYMENT_METHOD_AND_PASSWORD_AUTH_ERROR,
$this->getConstantNameByValue(self::PAYMENT_METHOD_AND_PASSWORD_AUTH_ERROR),
401,
function ($message) {
return $message;
},
__('You must login to LINE Pay and select a payment method to complete the order.', 'wcex_linepay'),
__('You must login to LINE Pay and select a payment method to complete the order.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::ACCOUNT_BALANCE_CHANGED,
$this->getConstantNameByValue(self::ACCOUNT_BALANCE_CHANGED),
400,
function ($message) {
return $message;
},
__('Your account balance changed. Please check your balance and try again.', 'wcex_linepay'),
__('Your account balance changed. Please check your balance and try again.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::ORDER_ID_ALREADY_EXISTS,
$this->getConstantNameByValue(self::ORDER_ID_ALREADY_EXISTS),
409,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('A record of a transaction with the same order number already exists.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::PAYMENT_EXPIRED,
$this->getConstantNameByValue(self::PAYMENT_EXPIRED),
400,
function ($message) {
return $message;
},
__('The payment has expired.', 'wcex_linepay'),
__('The payment has expired.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::DUPLICATE_API_REQUEST,
$this->getConstantNameByValue(self::DUPLICATE_API_REQUEST),
409,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('API call request has been duplicated.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::INTERNAL_REQUEST_ERROR,
$this->getConstantNameByValue(self::INTERNAL_REQUEST_ERROR),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Internal request error', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::TEMPORARY_CREDIT_CARD_ERROR,
$this->getConstantNameByValue(self::TEMPORARY_CREDIT_CARD_ERROR),
500,
function ($message) {
return $message;
},
__('A temporary error occurred while processing the credit card payment.', 'wcex_linepay'),
__('A temporary error occurred while processing the credit card payment.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CREDIT_CARD_PAYMENT_ERROR,
$this->getConstantNameByValue(self::CREDIT_CARD_PAYMENT_ERROR),
500,
function ($message) {
return $message;
},
__('Credit card payment error.', 'wcex_linepay'),
__('Credit card payment error.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CREDIT_CARD_AUTH_ERROR,
$this->getConstantNameByValue(self::CREDIT_CARD_AUTH_ERROR),
401,
function ($message) {
return $message;
},
__('Credit card authorization error.', 'wcex_linepay'),
__('Credit card authorization error.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::SUSPECTED_FRAUD,
$this->getConstantNameByValue(self::SUSPECTED_FRAUD),
403,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('The payment was refused due to suspected fraud.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_PAYMENT_TEMPORARILY_STOPPED,
$this->getConstantNameByValue(self::CARD_PAYMENT_TEMPORARILY_STOPPED),
423,
function ($message) {
return $message;
},
__('The credit card payment has temporarily stopped.', 'wcex_linepay'),
__('The credit card payment has temporarily stopped.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_PAYMENT_MISSING_INFO,
$this->getConstantNameByValue(self::CARD_PAYMENT_MISSING_INFO),
400,
function ($message) {
return $message;
},
__('Missing credit card payment information.', 'wcex_linepay'),
__('Missing credit card payment information.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::WRONG_CARD_PAYMENT_INFO,
$this->getConstantNameByValue(self::WRONG_CARD_PAYMENT_INFO),
400,
function ($message) {
return $message;
},
__('Wrong credit card payment information.', 'wcex_linepay'),
__('Wrong credit card payment information.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_EXPIRED,
$this->getConstantNameByValue(self::CARD_EXPIRED),
400,
function ($message) {
return $message;
},
__('The credit card is expired.', 'wcex_linepay'),
__('The credit card is expired.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_LOW_BALANCE,
$this->getConstantNameByValue(self::CARD_LOW_BALANCE),
400,
function ($message) {
return $message;
},
__('Card balance is too low.', 'wcex_linepay'),
__('Card balance is too low.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_LIMIT_EXCEEDED,
$this->getConstantNameByValue(self::CARD_LIMIT_EXCEEDED),
400,
function ($message) {
return $message;
},
__('Credit card limit exceeded.', 'wcex_linepay'),
__('Credit card limit exceeded.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_PER_PAYMENT_LIMIT_EXCEEDED,
$this->getConstantNameByValue(self::CARD_PER_PAYMENT_LIMIT_EXCEEDED),
400,
function ($message) {
return $message;
},
__('The payment amount exceeds the credit card per-payment limit.', 'wcex_linepay'),
__('The payment amount exceeds the credit card per-payment limit.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_REPORTED_STOLEN,
$this->getConstantNameByValue(self::CARD_REPORTED_STOLEN),
403,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('The card has been reported as a stolen card.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_SUSPENDED,
$this->getConstantNameByValue(self::CARD_SUSPENDED),
403,
function ($message) {
return $message;
},
__('The card has been suspended.', 'wcex_linepay'),
__('The card has been suspended.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CVN_INPUT_ERROR,
$this->getConstantNameByValue(self::CVN_INPUT_ERROR),
400,
function ($message) {
return $message;
},
__('The inputed CVN is not correct.', 'wcex_linepay'),
__('The inputed CVN is not correct.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_BLACKLISTED,
$this->getConstantNameByValue(self::CARD_BLACKLISTED),
403,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('The card blacklisted.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::WRONG_CREDIT_CARD_NUMBER,
$this->getConstantNameByValue(self::WRONG_CREDIT_CARD_NUMBER),
400,
function ($message) {
return $message;
},
__('The credit card number is incorrect.', 'wcex_linepay'),
__('The credit card number is incorrect.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CANNOT_PROCESS_AMOUNT,
$this->getConstantNameByValue(self::CANNOT_PROCESS_AMOUNT),
500,
function ($message) {
return $message;
},
$unknownErrorMessage,
__('Cannot process payment amount.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::CARD_DECLINED,
$this->getConstantNameByValue(self::CARD_DECLINED),
403,
function ($message) {
return $message;
},
__('The card was declined.', 'wcex_linepay'),
__('The card was declined.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::INTERNAL_ERROR,
$this->getConstantNameByValue(self::INTERNAL_ERROR),
500,
function ($message) {
return $message;
},
__('LINE Pay is currently unavailable.', 'wcex_linepay'),
__('LINE Pay is currently unavailable.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError((new LinePayError(
self::NETWORK_ERROR,
$this->getConstantNameByValue(self::NETWORK_ERROR),
500,
function ($message) {
return $message;
},
__('A network error occured.', 'wcex_linepay'),
__('A network error occured.', 'wcex_linepay')
))->setLogger($this->logger));
$this->addError(new LinePayError(
self::REQUEST_TIMED_OUT,
$this->getConstantNameByValue(self::REQUEST_TIMED_OUT),
504,
__('The request timed out. Please try again.', 'wcex_linepay'),
__('The request timed out. Please try again.', 'wcex_linepay')
));
}