code = $code; } /** * Get error message which can be displayed to website user * * @return \Magento\Framework\Phrase */ public function getUserMessage() { switch ($this->getCode()) { case self::API_INTERNAL_ERROR: case self::API_UNABLE_PROCESS_PAYMENT_ERROR_CODE: $message = __( 'I\'m sorry - but we were not able to process your payment.' . ' Please try another payment method or contact us so we can assist you.' ); break; case self::API_COUNTRY_FILTER_DECLINE: case self::API_MAXIMUM_AMOUNT_FILTER_DECLINE: case self::API_OTHER_FILTER_DECLINE: $message = __( 'I\'m sorry - but we are not able to complete your transaction.' . ' Please contact us so we can assist you.' ); break; case self::API_ADDRESS_MATCH_FAIL: $message = __( 'A match of the Shipping Address City, State, and Postal Code failed.' ); break; default: $message = __('We can\'t place the order.'); break; } return $message; } }