ePages 6.11.0 - DE_EPAGES/PayPalExpress/API/Payment.pm

Package DE_EPAGES::PayPalExpress::API::Payment

Payment functions for PayPal Express.

@EXPORT_OK
CheckoutRequest
CheckoutRequestDetails
DoCheckoutPayment
SendPayPalRequest
TestPPSettings

Functions

CheckoutRequest
CheckoutRequestDetails
DoCheckoutPayment
SendPayPalRequest
TestPPSettings

CheckoutRequest

calls SetExpressCheckout

Syntax
CheckoutRequest($LineItem, \%Params);
Input
$LineItemPaymentPayPalExpress (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

calls GetExpressCheckoutDetails

Syntax
CheckoutRequestDetails($LineItem, \%Params);
Input
$LineItemPaymentPayPalExpress (object)
the payment lineitem
$hInfo (ref.hash)
data for GetExpressCheckoutDetails request:
  • ObjectID - basket/order id - int

Return
$details (ref.hash)
the response details

DoCheckoutPayment

calls DoExpressCheckoutPayment

Syntax
DoCheckoutPayment ($LineItem, \%Params);
Input
$LineItemPaymentPayPalExpress (object)
the payment lineitem
$hInfo (ref.hash)
data for DoExpressCheckoutPayment request:
  • ObjectID - order id - int

Return
$payinfo (ref.hash)
the response payment info

SendPayPalRequest

sends a request with name/value pairs as parameters to PayPal

Syntax
my $hResult = SendPayPalRequest($PaymentMethod, \%Params);
Input
$PaymentMethod (object)
the payment method
$hParams (ref.hash)
parameter hash
Return
$redirectUrl (string)
redirect url with token from response

TestPPSettings

tests the settings of the payment method by calling SetExpressCheckout

Syntax
my $hResult = TestPPSettings($PaymentMethod);
Input
$PaymentMethod (object)
the payment method
Return
$hResult (ref.hash)
result from PayPal, may be undef on failure