Skip to content

Commit a115e95

Browse files
committed
Merge remote-tracking branch 'origin/MC-18194' into 2.3-develop-pr30
2 parents 3c266f7 + 0f49c52 commit a115e95

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

app/code/Magento/Vault/Model/Method/Vault.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -543,16 +543,22 @@ private function getPaymentExtensionAttributes(OrderPaymentInterface $payment)
543543
*/
544544
private function attachCreditCardInfo(OrderPaymentInterface $payment): void
545545
{
546-
try {
547-
$paymentToken = $payment->getExtensionAttributes()
548-
->getVaultPaymentToken();
549-
if ($paymentToken) {
550-
$tokenDetails = $this->jsonSerializer->unserialize($paymentToken->getTokenDetails());
551-
if ($tokenDetails && is_array($tokenDetails)) {
552-
$payment->addData($tokenDetails);
553-
}
554-
}
555-
} catch (Exception $e) {
546+
$paymentToken = $payment->getExtensionAttributes()
547+
->getVaultPaymentToken();
548+
if ($paymentToken === null) {
549+
return;
550+
}
551+
552+
$tokenDetails = $paymentToken->getTokenDetails();
553+
if ($tokenDetails === null) {
554+
return;
555+
}
556+
557+
if (is_string($tokenDetails)) {
558+
$tokenDetails = $this->jsonSerializer->unserialize($paymentToken->getTokenDetails());
559+
}
560+
if (is_array($tokenDetails)) {
561+
$payment->addData($tokenDetails);
556562
}
557563
}
558564

0 commit comments

Comments
 (0)