Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BeforeOrderPaymentSaveObserver.php
Go to the documentation of this file.
1 <?php
11 
16 
18 {
25  public function execute(\Magento\Framework\Event\Observer $observer)
26  {
28  $payment = $observer->getEvent()->getPayment();
29  $instructionMethods = [
32  ];
33  if (in_array($payment->getMethod(), $instructionMethods)) {
34  $payment->setAdditionalInformation(
35  'instructions',
36  $payment->getMethodInstance()->getInstructions()
37  );
39  $methodInstance = $payment->getMethodInstance();
40  if (!empty($methodInstance->getPayableTo())) {
41  $payment->setAdditionalInformation('payable_to', $methodInstance->getPayableTo());
42  }
43  if (!empty($methodInstance->getMailingAddress())) {
44  $payment->setAdditionalInformation('mailing_address', $methodInstance->getMailingAddress());
45  }
46  }
47  }
48 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$payment
Definition: order.php:17