Ejemplo n.º 1
0
 /**
  * Convert the payment object to an array.
  *
  * @return array
  */
 public function toArray()
 {
     $array = array();
     $array['orderNumber'] = $this->orderNumber;
     if (isset($this->referenceNumber)) {
         $array['referenceNumber'] = $this->referenceNumber;
     }
     if (isset($this->description)) {
         $array['description'] = $this->description;
     }
     $array['currency'] = $this->currency;
     if (isset($this->locale)) {
         $array['locale'] = $this->locale;
     }
     $array['orderDetails'] = array('includeVat' => $this->vatMode, 'products' => array());
     if ($this->urlSet !== null) {
         $array['urlSet'] = $this->urlSet->toArray();
     }
     if ($this->contact !== null) {
         $array['orderDetails']['contact'] = $this->contact->toArray();
     }
     foreach ($this->products as $product) {
         $array['orderDetails']['products'][] = $product->toArray();
     }
     return $array;
 }
Ejemplo n.º 2
0
 /**
  * Creates the UrlSet.
  *
  * @return UrlSet
  */
 protected function makeUrlSet()
 {
     $urlSet = new UrlSet();
     $urlSet->configure(array('successUrl' => 'https://www.demoshop.com/sv/success', 'failureUrl' => 'https://www.demoshop.com/sv/failure', 'notificationUrl' => 'https://www.demoshop.com/sv/notify', 'pendingUrl' => 'https://www.demoshop.com/sv/pending'));
     return $urlSet;
 }