/**
  * @param SimpleXMLElement $xml
  * @param Order $order
  */
 private function appendOrder(SimpleXMLElement $xml, Order $order)
 {
     $xml->addChild('currency', $order->getCurrency());
     $items = $xml->addChild('items');
     foreach ($order->getItems() as $item) {
         $this->appendItem($items, $item);
     }
     if ($reference = $order->getReference()) {
         $xml->addChild('reference', $reference);
     }
     if ($extraAmount = $order->getExtraAmount()) {
         $xml->addChild('extraAmount', $extraAmount);
     }
     $this->appendShipping($xml, $order->getShipping());
 }
Beispiel #2
0
 /**
  * @test
  */
 public function getExtraAmountShouldReturnConfiguredExtraAmount()
 {
     $this->order->setExtraAmount(123);
     $this->assertEquals(123, $this->order->getExtraAmount());
 }