関数
Create::populate()
Populates error store
説明 説明
ファイル: src/API/Charge/Create.php
public function populate() { $defaultErrors = $this->getErrorCodeMap(); $defaultErrorMessage = $defaultErrors[parent::INTERNAL_SERVER_ERROR]->message; $this->addError(new GenericError( self::TRANSACTION_AMOUNT_EXCEEDED, $this->getConstantNameByValue(self::TRANSACTION_AMOUNT_EXCEEDED), 400, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::INVALID_CHARGE_PERMISSION_STATUS, $this->getConstantNameByValue(self::INVALID_CHARGE_PERMISSION_STATUS), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::SOFT_DECLINED, $this->getConstantNameByValue(self::SOFT_DECLINED), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::HARD_DECLINED, $this->getConstantNameByValue(self::HARD_DECLINED), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::TRANSACTION_COUNT_EXCEEDED, $this->getConstantNameByValue(self::TRANSACTION_COUNT_EXCEEDED), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::PAYMENT_METHOD_NOT_ALLOWED, $this->getConstantNameByValue(self::PAYMENT_METHOD_NOT_ALLOWED), 422, function ($message) { return $message; }, __('There was a problem with the selected payment method.', 'wcexaap') )); $this->addError(new GenericError( self::AMAZON_REJECTED, $this->getConstantNameByValue(self::AMAZON_REJECTED), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::MFA_NOT_COMPLETED, $this->getConstantNameByValue(self::MFA_NOT_COMPLETED), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::TRANSACTION_TIMED_OUT, $this->getConstantNameByValue(self::TRANSACTION_TIMED_OUT), 422, function ($message) { return $message; }, $defaultErrorMessage )); $this->addError(new GenericError( self::PROCESSING_FAILURE, $this->getConstantNameByValue(self::PROCESSING_FAILURE), 500, function ($message) { return $message; }, $defaultErrorMessage )); }