You are here

protected function PayflowLink::resultMessage in Commerce PayPal 8

Returns the message explaining the RESULT of a Payflow transaction.

Parameters

string $result: The RESULT value from a Payflow transaction.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup An error or explanation message fit for display to a customer.

1 call to PayflowLink::resultMessage()
PayflowLink::onReturn in src/Plugin/Commerce/PaymentGateway/PayflowLink.php
Processes the "return" request.

File

src/Plugin/Commerce/PaymentGateway/PayflowLink.php, line 935

Class

PayflowLink
Provides the PayPal Payflow Link payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function resultMessage($result) {
  switch (intval($result)) {
    case 0:
      return $this
        ->t('Transaction approved.');
    case 1:
      return $this
        ->t('Account authentication error. Please contact an administrator to resolve this issue.');
    case 5:
    case 26:
      return $this
        ->t('The Payflow hosted checkout page is not configured for use. Please contact an administrator to resolve this issue.');
    case 2:
    case 25:
      return $this
        ->t('You have attempted to use an invalid payment method. Please check your payment information and try again.');
    case 3:
      return $this
        ->t('The specified transaction type is not appropriate for this transaction.');
    case 4:
    case 6:
      return $this
        ->t('The payment request specified an invalid amount format or currency code. Please contact an administrator to resolve this issue.');
    case 7:
    case 8:
    case 9:
    case 10:
    case 19:
    case 20:
      return $this
        ->t('The payment request included invalid parameters. Please contact an administrator to resolve this issue.');
    case 11:
    case 115:
    case 160:
    case 161:
    case 162:
      return $this
        ->t('The payment request timed out. Please try again or contact an administrator to resolve the issue.');
    case 12:
    case 13:
    case 22:
    case 23:
    case 24:
      return $this
        ->t('Payment declined. Please check your payment information and try again.');
    case 27:
    case 28:
    case 29:
    case 30:
    case 31:
    case 32:
    case 33:
    case 34:
    case 35:
    case 36:
    case 37:
    case 52:
    case 99:
    case 100:
    case 101:
    case 102:
    case 103:
    case 104:
    case 105:
    case 106:
    case 107:
    case 108:
    case 109:
    case 110:
    case 111:
    case 113:
    case 116:
    case 118:
    case 120:
    case 121:
    case 122:
    case 132:
    case 133:
    case 150:
    case 151:
      return $this
        ->t('The transaction failed at PayPal. Please contact an administrator to resolve this issue.');
    case 50:
    case 51:
      return $this
        ->t('Payment was declined due to insufficient funds or transaction limits. Please check your payment information and try again.');
    case 112:
      return $this
        ->t('Address and Zip code do not match. Please check your payment information and try again.');
    case 114:
      return $this
        ->t('Card Security Code (CSC) does not match. Please check your payment information and try again.');
    case 117:
    case 125:
    case 127:
    case 128:
      return $this
        ->t('Payment was declined due to merchant fraud settings. Please contact an administrator to resolve this issue.');
    case 126:
      return $this
        ->t('Payment was flagged for review by the merchant. We will validate the payment and update your order as soon as possible.');
  }
  return $this
    ->t('Unknown result code.');
}