Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PayPalDetailsHandler.php
Go to the documentation of this file.
1 <?php
7 
11 
16 {
17  const PAYMENT_ID = 'paymentId';
18 
19  const PAYER_EMAIL = 'payerEmail';
20 
24  private $subjectReader;
25 
31  public function __construct(SubjectReader $subjectReader)
32  {
33  $this->subjectReader = $subjectReader;
34  }
35 
39  public function handle(array $handlingSubject, array $response)
40  {
41  $paymentDO = $this->subjectReader->readPayment($handlingSubject);
42 
44  $transaction = $this->subjectReader->readTransaction($response);
45 
47  $payment = $paymentDO->getPayment();
48 
49  $payPal = $this->subjectReader->readPayPal($transaction);
50  $payment->setAdditionalInformation(self::PAYMENT_ID, $payPal[self::PAYMENT_ID]);
51  $payment->setAdditionalInformation(self::PAYER_EMAIL, $payPal[self::PAYER_EMAIL]);
52  }
53 }
$transaction
$response
Definition: 404.php:11
handle(array $handlingSubject, array $response)
$payment
Definition: order.php:17