/** * @param PayqrInvoice $invoice * @param $diafan */ public function __construct(PayqrInvoice &$invoice, $diafan) { $this->invoice = $invoice; $this->customerData = $invoice->getCustomer(); $this->diafan = $diafan; $this->deliveryData = $invoice->getDelivery(); }
/** * Подготавливает XML-с товарами * @param PayqrInvoice $invoice * @return string */ private static function getXmlProduct($invoice) { $carts = $invoice->getCart(); $xml = ""; foreach ($carts as $cart) { $xml .= '<order-line-attributes>' . PHP_EOL . '<variant-id>' . $cart->article . '</variant-id>' . PHP_EOL . '<quantity>' . $cart->quantity . '</quantity>' . PHP_EOL . '</order-line-attributes>'; } return $xml; }