You are here

protected function Payflow::getAuthorizationCode in Commerce PayPal 8

Get the remote authorization code ('authcode') of a payment.

Parameters

\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment.

Return value

string The Payflow authorization code.

File

src/Plugin/Commerce/PaymentGateway/Payflow.php, line 229

Class

Payflow
Provides the PayPal Payflow payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

protected function getAuthorizationCode(PaymentInterface $payment) {
  $remote_id = $payment
    ->getRemoteId();
  return strpos($remote_id, '|') !== FALSE ? explode('|', $remote_id)[1] : $remote_id;
}