/**
  * Returns the formatted payment amount
  * @param \SebastianBergmann\Money\Money
  * @return string
  */
 protected function formatAmount(Money $amount)
 {
     return number_format(\Heystack\Ecommerce\convertMoneyToString($amount), $amount->getCurrency()->getDefaultFractionDigits(), '.', '');
 }
 /**
  * @return array
  */
 public function getStorableData()
 {
     return ['id' => self::IDENTIFIER, 'parent' => true, 'flat' => ['Total' => \Heystack\Ecommerce\convertMoneyToString($this->getTotal())]];
 }
 /**
  * Get the data to store for the purchasableholder
  * @return array
  */
 public function getStorableData()
 {
     return ['id' => 'PurchasableHolder', 'flat' => ['Total' => \Heystack\Ecommerce\convertMoneyToString($this->total), 'NoOfItems' => count($this->purchasables), 'ParentID' => $this->parentReference], 'parent' => true];
 }
 /**
  * @return array
  */
 public function getStorableData()
 {
     return ['id' => 'ShippingHandler', 'parent' => true, 'flat' => ['ParentID' => $this->parentReference, 'AddressLine1' => $this->AddressLine1, 'AddressLine2' => $this->AddressLine2, 'City' => $this->City, 'Postcode' => $this->Postcode, 'Country' => !is_null($this->Country) ? $this->Country->getName() : null, 'Title' => $this->Title, 'FirstName' => $this->FirstName, 'Surname' => $this->Surname, 'Email' => $this->Email, 'Phone' => $this->Phone, 'Total' => \Heystack\Ecommerce\convertMoneyToString($this->getTotal()), 'BillingAsShipping' => $this->BillingAsShipping, 'BillingAddressLine1' => $this->BillingAddressLine1, 'BillingAddressLine2' => $this->BillingAddressLine2, 'BillingCity' => $this->BillingCity, 'BillingPostcode' => $this->BillingPostcode, 'BillingCountry' => $this->BillingCountry, 'BillingTitle' => $this->BillingTitle, 'BillingFirstName' => $this->BillingFirstName, 'BillingSurname' => $this->BillingSurname, 'BillingEmail' => $this->BillingEmail, 'BillingPhone' => $this->BillingPhone]];
 }
 /**
  * Returns a short string that describes what the result does
  * @return string
  */
 public function getDescription()
 {
     return 'Purchasable Discount: Discount of ' . \Heystack\Ecommerce\convertMoneyToString($this->getTotal());
 }
 /**
  * @return array
  */
 public function getStorableData()
 {
     return ['id' => self::IDENTIFIER, 'flat' => ['Total' => \Heystack\Ecommerce\convertMoneyToString($this->total), 'Active' => $this->isActive()]];
 }
 /**
  * Get the data to store
  * @return array The data to store
  */
 public function getStorableData()
 {
     return ['id' => 'Transaction', 'flat' => ['Total' => \Heystack\Ecommerce\convertMoneyToString($this->total), 'Status' => $this->status, 'Currency' => $this->currencyService->getActiveCurrencyCode()], 'related' => []];
 }
 /**
  * @return array
  */
 public function getStorableData()
 {
     //loop of conditions, use result to prepare a combined description
     return ['id' => 'Deal', 'parent' => true, 'flat' => ['Total' => \Heystack\Ecommerce\convertMoneyToString($this->total), 'Description' => $this->getDescription(), 'ParentID' => $this->parentReference]];
 }
 /**
  * @return string
  */
 public function Amount()
 {
     return \Heystack\Ecommerce\convertMoneyToString($this->value);
 }
 /**
  * Returns a short string that describes what the result does
  * @return string
  */
 public function getDescription()
 {
     return 'Free shipping: Discount of ' . \Heystack\Ecommerce\convertMoneyToString($this->getTotal());
 }
 /**
  * Returns a short string that describes what the result does
  * @return string
  */
 public function getDescription()
 {
     $this->process($this->getDealHandler());
     return sprintf("Cheapest Purchasable Discount: Discount of '%s'", \Heystack\Ecommerce\convertMoneyToString($this->totalDiscount));
 }