getExternalIdentifier() public method

public getExternalIdentifier ( ) : string | null
return string | null
 public function confirmPayment(PaymentInterface $payment, Request $request)
 {
     $order = $payment->getOrder();
     $paymentMethod = $order->getPaymentMethod();
     $configuration = $paymentMethod->getConfiguration();
     $paymentId = $request->get('paymentId');
     $payerId = $request->get('PayerID');
     $apiContext = $this->getApiContext($configuration);
     if ($payment->getExternalIdentifier() === $paymentId && false === $payment->isApproved()) {
         $payPalPayment = Payment::get($paymentId, $apiContext);
         $execution = new PaymentExecution();
         $execution->setPayerId($payerId);
         $payPalPayment->execute($execution, $apiContext);
         $payment->setState(PaymentInterface::PAYMENT_STATE_APPROVED);
     }
 }