ePages 7.23.0 - DE_EPAGES/POSTPAY/API/Payment.pm

Package DE_EPAGES::POSTPAY::API::Payment

Payment functions for POSTPAY.

@EXPORT_OK
SendPaymentRequest
FetchTransactionStatus
UpdateTransactionStatus
CheckoutRequest
CheckoutRequestDetails
SendPOSTPAYRequest
ReportConsignment
ReportTrackingId
ReportCancellation
ReportOrderReturns
HandleQueryRequestResponse

Functions

CheckoutRequest
CheckoutRequestDetails
GetPOSTPAYAddress
HandleQueryRequestResponse
ReportCancellation
ReportConsignment
ReportOrderReturns
ReportTrackingId
SendPOSTPAYRequest
SetCancellationIDOrConsignedQuantity
SetConsignmentID
SetDispatchedStatus
SetTrackingID
_HandleNotificationResponse
_HandleSubmitCartResponse

CheckoutRequest

calls SetExpressCheckout

Syntax
CheckoutRequest($LineItem, \%Params);
Input
$LineItemPaymentPOSTPAY (object)
the payment lineitem
$hInfo (ref.hash)
data for SetExpressCheckout request:
  • ObjectID - basket id - int
  • LocaleCode - locale code (2 char country code) - string
  • BuyerEmail - email of buyer - string
  • ReturnURL - return url - string
  • CancelURL - cancel url - string

Return
$redirectUrl (string)
redirect url with token from response

CheckoutRequestDetails

sends a request to POSTPAY to get order details

Syntax
CheckoutRequestDetails($LineItem, \%Params);
Input
$LineItemPaymentPayPalExpress (object)
the payment lineitem
Return
$hResponse (undef)
the request details which are in this case undef

GetPOSTPAYAddress

create a Address under the customer for the given postpay address if there doesn't exists an address with this address information

Syntax
GetPOSTPAYAddress($Customer,$hBillingAddress,$AddressName);
Input
$Customer (object)
customer
$hAddress (ref.hash)
Addresshash which is provided by postpay
Return
$CustomerAddress (object)
Address of Customer

HandleQueryRequestResponse

handles response for all requests, dependent from request return value which is set

Syntax
_HandleQueryRequestResponse($hResult,$Shop);
Input
$hResult (ref.hash)
repsonse from submitcart
$LineItemPayment (object)
payment from lineitemcontainer

ReportCancellation

reports cancellation to POSTAY

Syntax
ReportCancellation($LineItemPayment, $hCancelProducts, $hCancelReasons, $Comment);
Input
$LineItemPayment (object)
the payment lineitem
$hCancelProducts (ref.hash)

  • product GUID
  • number of consigned products

$hCancelReasons

  • product GUID
  • cancel reason
$Comment (String)
comment

ReportConsignment

reports consignment to POSTAY

Syntax
ReportConsignment($LineItem, $hConsignedProducts, $TrackingId);
Input
$LineItemPayment (object)
the payment lineitem
$hConsignedProducts (ref.hash)
data for consigned products:
  • product GUID
  • number of consigned products
$TrackingId (String)
tracking id for consigned products

ReportOrderReturns

reports consignment to POSTAY

Syntax
ReportOrderReturns( $self,
                    $hReturnQuantity,
                    $hReturnReasons,
                    $hReturnReduction,
                    $Comment,
                    $RefundDeliveryCosts);
Input
$LineItemPayment (object)
the payment lineitem
$hReturnQuantity (ref.hash)

  • product GUID
  • number of returned products

$hReductionOfRefund (ref.hash)

  • product GUID
  • reduction of refund

$ReductionReason (String)
reduction reason
$Comment (String)
comment
$RefundDeliveryCosts (bool)
shows if delivery costs are refunded

ReportTrackingId

reports consignment to POSTAY

Syntax
ReportTrackingId($LineItem, $ConsignmentId, $TrackingId);
Input
$LineItemPayment (object)
the payment lineitem
$ConsignmentID (String)
consignment id
$TrackingID (String)
tracking id for consigned products

SendPOSTPAYRequest

sends the xml to postpay

Syntax
my $hResult = SendPOSTPAYRequest($XML, $LineItemPayment);
Input
$XML (string)
XML to send
$PaymentMethod (object)
PaymentMethod
Return
$hResponse (ref.hash)
returns the Response

SetCancellationIDOrConsignedQuantity

if type="return" set the return id for all LineItemProducts which have been returned and reduce the consigned quantity and the quantity else set the cancellation id for all LineItemProducts which have been consigned and reduce the quantity

Syntax
SetCancellationIDOrConsignedQuantity($aLineItemProducts,$hProducts,$ID);
Input
$aLineItemProducts (ref.array)
products of order
$hConsignedProducts (ref.hash)
already consigned products
$ConsignmentID (string)
consignment id
$Type (string)
choose type

SetConsignmentID

set the the consignedID on lineitemproducts

Syntax
SetConsignmentID($aLineItemProducts,$hConsignedProducts,$ConsignmentID);
Input
$aLineItemProducts (ref.array)
products of order
$hConsignedProducts (ref.hash)
already consigned products
$ConsignmentID (string)
consignment id

SetDispatchedStatus

set the consignment id for all LineItemProducts which have been consigned

Syntax
SetDispatchedStatus($aLineItemProducts,$TrackingID,$ConsignmentID);
Input
$aLineItemProducts (ref.array)
products of order

SetTrackingID

find lineitemproduct with corresponding consignment id and set the tracking id

Syntax
SetTrackingID($aLineItemProducts,$TrackingID,$ConsignmentID);
Input
$aLineItemProducts (ref.array)
products of order
$TrackingID (rstring)
tracking id
$ConsignmentID (string)
consignment id

_HandleNotificationResponse

handles all notification responses

Syntax
_HandleNotificationResponse($hResult,$LineItemPayment);
Input
$hResult (ref.hash)
response from submitcart
$LineItemPayment (object)
payment from lineitemcontainer
$hParams (ref.hash)
|
  • $hConsignedProducts -
    • GUID - number of dispatched products for this guid - string
    | ref.hash
  • $ConsignmentID - consigment id - int
  • $TrackingID - tracking id - int
  • $hCancelledProducts -
    • GUID - number of cancelled products for this guid - string
    | ref.hash
  • $CancellationID - cancellation id - int
  • $hReturnProducts -
    • GUID - number of returned products for this guid - string
    | ref.hash
  • $ReturnID - return id - int

_HandleSubmitCartResponse

handles response for submitcart

Syntax
_HandleSubmitCartResponse($hResult);
Input
$hResult (ref.hash)
repsonse from submitcart
Return
$hout (ref.hash)
cleaned up hash
$hResult = { 'cartID' => 'xyz',
'redirectURL' => 'test.html',
}