Ejemplo n.º 1
0
 /**
  * The invoice_address function is used to retrieve the address of a purchase.
  *
  *
  *
  * @link http://integration.klarna.com/en/api/other-functions/functions/invoiceaddress
  * @param  string  $invNo  Invoice number.
  * @throws KlarnaException
  * @return KlarnaAddr
  */
 public function invoiceAddress($invNo)
 {
     $this->checkInvNo($invNo, __METHOD__);
     $digestSecret = self::digest($this->colon($this->eid, $invNo, $this->secret));
     $paramList = array($this->eid, $invNo, $digestSecret);
     self::printDebug('invoice_address', $paramList);
     $result = $this->xmlrpc_call('invoice_address', $paramList);
     $addr = new KlarnaAddr();
     if (strlen($result[0]) > 0) {
         $addr->isCompany = false;
         $addr->setFirstName($result[0]);
         $addr->setLastName($result[1]);
     } else {
         $addr->isCompany = true;
         $addr->setCompanyName($result[1]);
     }
     $addr->setStreet($result[2]);
     $addr->setZipCode($result[3]);
     $addr->setCity($result[4]);
     $addr->setCountry($result[5]);
     return $addr;
 }