ePages 6.17.9 - DE_EPAGES/Klarna/API/KlarnaClient.pm

Package DE_EPAGES::Klarna::API::KlarnaClient

This class implements the client for Klarna web interface.

Base
-
@EXPORT_OK
GetPclass

Functions

ActivateInvoice
AddTransaction
CancelInvoice
GetPclass
GetPclasses
SendInvoiceToCustomer
UpdateInvoice
new

ActivateInvoice

Function sends activating request to Klarna.

Syntax
   my $hResponse = $self->ActivateInvoice($LineItemContainer)
Input
$LineItemContainer (object)
the LineItemContainer to use
Return
$hResponse (hash reference)
Returned data
- Message Status message
- StatusCode Status code

AddTransaction

Function sends a transaction to Klarna.

Syntax
   my $hResponse = $self->AddTransaction($hParams)
Input
$hParams (hash reference)
- BasketOrder basket or order object,
- PaymentMethod payment method object,
- SecurityNumber social security or organization number,
- RemoteAddr customer's ip,
- Street customer's street address,
- HouseNo house number if customer is from Germany
Return
$hResponse (hash reference)
Returned data
- Message Message
- StatusCode Status code

CancelInvoice

Cancels an invoice at Klarna

Syntax
 $self->CancelInvoice($LineItemContainer);
Input
$LineItemContainer (object)
the LineItemContainer to use
Return
$hResponse (hash reference)
Returned data
- Message Status message
- StatusCode Status code

GetPclass

Function returns pclass id number.

Syntax
   my $Encoding = GetPclass($LineItemContainer);
Input
$LineItemContainer (object)
line item container
Return
$PclassID (integer)
numerical id number of pclass

GetPclasses

Function gets pclass values from Klarna.

Syntax
   my $hResponse = $self->GetPclasses($PaymentMethod, $CountryID)
Input
$PaymentMethod (object)
payment method object
$CountryID (char(3))
country id
Return
$hResponse (hash reference)
Returned data
- Message Status message
- StatusCode Status code

SendInvoiceToCustomer

Function sends request to Klarna that invoice can be sent to customer.

Syntax
   my $hResponse = $self->SendInvoiceToCustomer($hParams)
Input
$hParams (hash reference)
- PaymentMethod payment method object,
- InvoiceNo invoice number string
Return
$hResponse (hash reference)
Returned data
- Message Status message
- StatusCode Status code

UpdateInvoice

Function sends update request to Klarna.

Syntax
   my $hResponse = $self->UpdateInvoice($hParams)
Input
$hParams (hash reference)
- PaymentMethod payment method object,
- InvoiceNo invoice number string
Return
$hResponse (hash reference)
Returned data
- Message Status message
- StatusCode Status code

new

Constructor for KlarnaClient

Syntax
 $Object = DE_EPAGES::Klarna::API::KlarnaClient->new();
Return
$self (Object)
Klarna Client