Skulle vilja kunna göra så att kundens adress hämtas mha personnummer. Har installerat KLARNA modulen och de har en funktion som heter "get adresses". Någon som har koll på hur det ska installeras.
De ha ju en integrationssajt och jag har hittat koden, men vet ej vart den ska in..
Code: Select all
$k->setCountry('se');
try {
//Attempt to get the address(es) associated with the SSN/PNO.
$addrs = $k->getAddresses($pno = '410321-9202');
/* If there exists several addresses you would want to output a list in which the customer
could choose the address which suits him/her. */
//Print them if available:
foreach($addrs as $key => $addr) {
echo "";
//This only works if the right getAddresses type is used.
if($addr->isCompany) {
echo "";
}
else {
echo "";
echo "";
}
echo "";
echo "";
echo "";
echo "";
echo "<table><tbody><tr><td>Company</td><td>".$addr->getCompanyName()."</td></tr><tr><td>First name</td><td>".$addr->getFirstName()."</td></tr><tr><td>Last name</td><td>".$addr->getLastName()."</td></tr><tr><td>Street</td><td>".$addr->getStreet()."</td></tr><tr><td>Zip code</td><td>".$addr->getZipCode()."</td></tr><tr><td>City</td><td>".$addr->getCity()."</td></tr><tr><td>Country</td><td>".$addr->getCountryCode()."</td></tr></tbody></table>";
}
}
catch(Exception $e) {
//Something went wrong
echo $e->getMessage() . " (#" . $e->getCode() . ")";
}