File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
app/code/Magento/Vault/Model/Method Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments