config( 123456, // Merchant ID 'sharedSecret', // Shared Secret KlarnaCountry::SE, // Country KlarnaLanguage::SV, // Language KlarnaCurrency::SEK, // Currency Klarna::BETA, // Server 'json', // PClass Storage '/srv/pclasses.json', // PClass Storage URI path true, // SSL true // Remote logging of response times of xmlrpc calls ); // OR you can set the config to loads from a file, for example /srv/klarna.json: // $k->setConfig(new KlarnaConfig('/srv/klarna.json')); /** * 2. Get the address associated with the purchase/invoice. */ // Here you enter the invoice number: $invNo = '123456'; try { // Attempt to get the address $addr = $k->invoiceAddress($invNo); // Display the retrieved address: echo "
| Company | {$addr->getCompanyName()} |
| First name | {$addr->getFirstName()} |
| Last name | {$addr->getLastName()} |
| Street | {$addr->getStreet()} |
| Zip code | {$addr->getZipCode()} |
| City | {$addr->getCity()} |
| Country | {$addr->getCountryCode()} |