From e798f7553d6ab21132d476ef0d7f7ab7a99475ea Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Sun, 21 Jun 2020 23:10:09 +0300 Subject: [PATCH] add cc data --- .../Observer/PayflowProSetCcData.php | 39 +++++++++++++++++++ .../PaypalGraphQl/etc/graphql/events.xml | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 app/code/Magento/PaypalGraphQl/Observer/PayflowProSetCcData.php diff --git a/app/code/Magento/PaypalGraphQl/Observer/PayflowProSetCcData.php b/app/code/Magento/PaypalGraphQl/Observer/PayflowProSetCcData.php new file mode 100644 index 0000000000000..9dd5969672529 --- /dev/null +++ b/app/code/Magento/PaypalGraphQl/Observer/PayflowProSetCcData.php @@ -0,0 +1,39 @@ +readDataArgument($observer); + $additionalData = $dataObject->getData(PaymentInterface::KEY_ADDITIONAL_DATA); + + if (!isset($additionalData['cc_details'])) { + return; + } + + $paymentModel = $this->readPaymentModelArgument($observer); + foreach ($additionalData['cc_details'] as $ccKey => $ccValue) { + $paymentModel->setData($ccKey, $ccValue); + } + } +} diff --git a/app/code/Magento/PaypalGraphQl/etc/graphql/events.xml b/app/code/Magento/PaypalGraphQl/etc/graphql/events.xml index 41154e5ae06e6..0d2be95d77c92 100644 --- a/app/code/Magento/PaypalGraphQl/etc/graphql/events.xml +++ b/app/code/Magento/PaypalGraphQl/etc/graphql/events.xml @@ -12,4 +12,7 @@ + + +