Tjena
Är det någon som har fixat till en funktion att på registreringssidan kunna hämta adressuppgifterna automatiskt via Klarna genom att fylla i personnummret ?
Jag hittade en kod på nätet som kanske kan användas, är det någon som vet hur man får till det ?
Kod:<?php /* get_addresses($eid, $pno, $secret, $pno_encoding, $type, &$result) */ /* In sweden we have to possibility to retrevie a persons address by making a call to Klarna. To do this we need the customers SSN. */ $status = get_addresses(eid, "4304158399", "secret", $KRED_SE_PNO, $GA_OLD, $result); /* If get_addresses returns 0 we successfully retreived the customers address, and $result will contain the array with address arrays. If $status is anything but 0 an error occurred. Then $status will contain the error code and $result the error message. */ if($status == 0) { echo("Addresses for customer: " . $pno . "<br/>"); // Loop through the array of addresses foreach($result as $addr){ /* Each address array contains fields with the address elements. In this case when we used $GA_OLD we do not receive any firstname, and the array will look like this [firstname, lastname, street, zipcode, city, country] but if we instead use $GA_NEW we will get an array looking like this [lastname, street, zipcode, city, country] */ echo("Firstname: " . $addr[0] . "<br />"); echo("Lastname: " . $addr[1] . "<br />"); echo("Street: " . $addr[2] . "<br />"); echo("Zip code: " . $addr[3] . "<br />"); echo("City: " . $addr[4] . "<br />"); echo("Country: " . $addr[5] . "<br />"); echo("==========================<br /><br />"); } } else { echo("Payment error (error code: ". $status . ") Message: " . $result); } ?>



LinkBack URL
About LinkBacks

