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 ); /** * 2. Activate the reservation */ $rno = '123456'; // Optional fields should be set using // $k->setActivateInfo() try { $result = $k->activate($rno); $risk = $result[0]; // ok or no_risk $invno = $result[1]; echo "risk: {$risk}\ninvno: {$invno}\n"; // Reservation is activated, proceed accordingly. } catch(Exception $e) { // Something went wrong, print the message: echo "{$e->getMessage()} (#{$e->getCode()})\n"; }