1

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 ?

Tuna
  • 2,937
  • 4
  • 37
  • 61
AfterEdge
  • 59
  • 1
  • 7
  • Are you using their PHP API, or are you doing your own integration? Have you checkout the code examples on [This page](http://integration.klarna.com/en/api/standard-integration/functions/addtransaction)? – Paul Peelen Jun 12 '12 at 14:10
  • i am integrating by my own, yes i have checked the code on this page, but didn't find the right way to pass instructions to Klarna, to deal order as partial payment order. – AfterEdge Jun 13 '12 at 10:13
  • can you please put short code sample for add_transaction() function here for my help ? – AfterEdge Jun 13 '12 at 10:24
  • Examples are on the page I mentioned, just check under "Code Examples". – Paul Peelen Jun 14 '12 at 12:08

1 Answers1

1

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).