|
8 | 8 | use Magento\Framework\DataObject;
|
9 | 9 | use Magento\Framework\Exception\LocalizedException;
|
10 | 10 | use Magento\Payment\Model\InfoInterface;
|
| 11 | +use Magento\Payment\Model\Method\ConfigInterface; |
11 | 12 | use Magento\Payment\Model\Method\ConfigInterfaceFactory;
|
| 13 | +use Magento\Payment\Model\Method\Online\GatewayInterface; |
| 14 | +use Magento\Payment\Observer\AbstractDataAssignObserver; |
| 15 | +use Magento\Paypal\Model\Config; |
12 | 16 | use Magento\Paypal\Model\Payflow\Service\Gateway;
|
13 | 17 | use Magento\Paypal\Model\Payflow\Service\Response\Handler\HandlerInterface;
|
14 |
| -use Magento\Paypal\Model\Payflow\Transparent; |
15 | 18 | use Magento\Quote\Model\Quote;
|
16 |
| -use Magento\Sales\Model\Order\Payment; |
17 |
| -use Magento\Payment\Model\Method\Online\GatewayInterface; |
18 |
| -use Magento\Payment\Model\Method\ConfigInterface; |
19 |
| -use Magento\Paypal\Model\Config; |
20 | 19 | use Magento\Sales\Model\Order;
|
| 20 | +use Magento\Sales\Model\Order\Payment; |
21 | 21 | use Magento\Store\Model\ScopeInterface;
|
22 |
| -use Magento\Vault\Api\Data\PaymentTokenInterface; |
23 | 22 |
|
24 | 23 | /**
|
25 | 24 | * Payflow Pro payment gateway model
|
@@ -861,6 +860,36 @@ public function addRequestOrderInfo(DataObject $request, Order $order)
|
861 | 860 | ->setComment1($orderIncrementId);
|
862 | 861 | }
|
863 | 862 |
|
| 863 | + /** |
| 864 | + * Assign data to info model instance |
| 865 | + * |
| 866 | + * @param array|DataObject $data |
| 867 | + * @return $this |
| 868 | + * @throws \Magento\Framework\Exception\LocalizedException |
| 869 | + */ |
| 870 | + public function assignData(DataObject $data) |
| 871 | + { |
| 872 | + $this->_eventManager->dispatch( |
| 873 | + 'payment_method_assign_data_' . $this->getCode(), |
| 874 | + [ |
| 875 | + AbstractDataAssignObserver::METHOD_CODE => $this, |
| 876 | + AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(), |
| 877 | + AbstractDataAssignObserver::DATA_CODE => $data |
| 878 | + ] |
| 879 | + ); |
| 880 | + |
| 881 | + $this->_eventManager->dispatch( |
| 882 | + 'payment_method_assign_data', |
| 883 | + [ |
| 884 | + AbstractDataAssignObserver::METHOD_CODE => $this, |
| 885 | + AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(), |
| 886 | + AbstractDataAssignObserver::DATA_CODE => $data |
| 887 | + ] |
| 888 | + ); |
| 889 | + |
| 890 | + return $this; |
| 891 | + } |
| 892 | + |
864 | 893 | /**
|
865 | 894 | * @param InfoInterface $payment
|
866 | 895 | * @param string $transactionId
|
|
0 commit comments