You are here

public function PaymentGatewayBase::buildAvsResponseCodeLabel in Commerce Core 8.2

Builds a label for the given AVS response code and card type.

Parameters

string $avs_response_code: The AVS response code.

string $card_type: The card type.

Return value

string|null The label, or NULL if not available.

Overrides PaymentGatewayInterface::buildAvsResponseCodeLabel

2 calls to PaymentGatewayBase::buildAvsResponseCodeLabel()
Onsite::buildAvsResponseCodeLabel in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Builds a label for the given AVS response code and card type.
StoredOffsiteRedirect::buildAvsResponseCodeLabel in modules/payment_example/src/Plugin/Commerce/PaymentGateway/StoredOffsiteRedirect.php
Builds a label for the given AVS response code and card type.
2 methods override PaymentGatewayBase::buildAvsResponseCodeLabel()
Onsite::buildAvsResponseCodeLabel in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Builds a label for the given AVS response code and card type.
StoredOffsiteRedirect::buildAvsResponseCodeLabel in modules/payment_example/src/Plugin/Commerce/PaymentGateway/StoredOffsiteRedirect.php
Builds a label for the given AVS response code and card type.

File

modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php, line 459

Class

PaymentGatewayBase
Provides the base class for payment gateways.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function buildAvsResponseCodeLabel($avs_response_code, $card_type) {
  $avs_code_meanings = CreditCard::getAvsResponseCodeMeanings();
  if (!isset($avs_code_meanings[$card_type][$avs_response_code])) {
    return NULL;
  }
  return $avs_code_meanings[$card_type][$avs_response_code];
}