You are here

protected function PayPalWebsitePaymentsPro::cvvmatchMessage in Ubercart 8.4

Returns a human readable message for the CVV2 match code.

1 call to PayPalWebsitePaymentsPro::cvvmatchMessage()
PayPalWebsitePaymentsPro::chargeCard in payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalWebsitePaymentsPro.php
Called when a credit card should be processed.

File

payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalWebsitePaymentsPro.php, line 411

Class

PayPalWebsitePaymentsPro
Defines the PayPal Website Payments Pro payment method.

Namespace

Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod

Code

protected function cvvmatchMessage($code) {
  if (is_numeric($code)) {
    switch ($code) {
      case '0':
        return $this
          ->t('Matched');
      case '1':
        return $this
          ->t('No match');
      case '2':
        return $this
          ->t('The merchant has not implemented CVV2 code handling.');
      case '3':
        return $this
          ->t('Merchant has indicated that CVV2 is not present on card.');
      case '4':
        return $this
          ->t('Service not available');
      default:
        return $this
          ->t('Unkown error');
    }
  }
  switch ($code) {
    case 'M':
      return $this
        ->t('Match');
    case 'N':
      return $this
        ->t('No match');
    case 'P':
      return $this
        ->t('Not processed');
    case 'S':
      return $this
        ->t('Service not supported');
    case 'U':
      return $this
        ->t('Service not available');
    case 'X':
      return $this
        ->t('No response');
    default:
      return $this
        ->t('Not checked');
  }
}