Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ProcessableException.php
Go to the documentation of this file.
1 <?php
8 
11 
17 {
21  const API_INTERNAL_ERROR = 10001;
25  const API_TRANSACTION_EXPIRED = 10411;
29  const API_OTHER_FILTER_DECLINE = 10539;
30  const API_ADDRESS_MATCH_FAIL = 10736;
41  public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
42  {
43  parent::__construct($phrase, $cause, $code);
44  $this->code = $code;
45  }
46 
52  public function getUserMessage()
53  {
54  switch ($this->getCode()) {
57  $message = __(
58  'I\'m sorry - but we were not able to process your payment.'
59  . ' Please try another payment method or contact us so we can assist you.'
60  );
61  break;
65  $message = __(
66  'I\'m sorry - but we are not able to complete your transaction.'
67  . ' Please contact us so we can assist you.'
68  );
69  break;
71  $message = __(
72  'A match of the Shipping Address City, State, and Postal Code failed.'
73  );
74  break;
75  default:
76  $message = __('We can\'t place the order.');
77  break;
78  }
79  return $message;
80  }
81 }
__construct(Phrase $phrase, \Exception $cause=null, $code=0)
__()
Definition: __.php:13
$message
$code
Definition: info.phtml:12