Question

Can anyone please help me with the Klarna integration, and how to pass pclass parameter to the addTransaction method, for example if I want to pass the instruction to Klarna that the customer will pay in 12 installments how can I achieve this, thank you.

note: I have fetched pclasses and saved them in a file.

can anyone please put short code sample for add_transaction() function here for my help ?

Was it helpful?

Solution

The pClass for part payment could be set in the file addTransaction by changing INVOICE to the pClass IDs you received for the part payment, or specific campaign. If you look at row 200 in the example file for addTransaction, it looks like this:

try {
//Transmit all the specified data, from the steps above, to Klarna.
$result = $k->addTransaction(
   $pno = '07071960', //Date of birth for DE.
   $gender = KlarnaFlags::MALE, //The customer is a male.
   $flags = KlarnaFlags::NO_FLAG, //No specific behaviour like RETURN_OCR or TEST_MODE.
   $pclass = KlarnaPClass::INVOICE

On the last row, 206, you can remove INVOICE to your preferred pClass ID: $pclass = KlarnaPClass::676 for example.

Another way is to make a getpclasses call to us (Klarna).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top