Skip to content

classes_modules_payment_paymentprovider.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file modules/payment/paymentprovider.class.php

abstract class PaymentProvider

Payment providers must extend this class.

Subclasses: Gate2Shop, PayPal, TestingPaymentProvider

GetCheckoutInputFields

Return any fields that need to be shown in the checkout process before the checkout can be used

Definition: public function GetCheckoutInputFields()

Returns: array

GetStartCheckoutRenderable

Return the renderable object that shows any button, form or qr code to start the checkout process

Definition: public function GetStartCheckoutRenderable(IShopOrder $order)

Returns: bool

Parameters:

  • IShopOrder $order The order to get UI for

HandleIPN

Handle the IPN (called DMN at g2s, ...) call from the payment provider

Definition: public function HandleIPN($ipndata)

Returns: bool|string True if everything went well, errormessage as string otherwise

Parameters:

  • mixed $ipndata Array with IPN data (i.e. POST data) from payment provider

HandleReturnFromPP

Process the user returning from the PP.

Definition: public function HandleReturnFromPP($ipndata)

Returns: bool currently always true

Parameters:

  • mixed $ipndata Data returned from PP

IsAvailable

Possibility to disable/enable the payment provider list

Definition: public function IsAvailable()

Returns: bool

SanitizePaymentProcessorId

Ensure a valid processor_id

Definition: public static function SanitizePaymentProcessorId($processor_id)

Returns: string One of PROCESSOR_PAYPAL or PROCESSOR_GATE2SHOP.

Parameters:

  • string $processor_id One of PROCESSOR_PAYPAL or PROCESSOR_GATE2SHOP.

SanitizeStatusFromPP

Correct the status from the arguments passed by the PP.

Definition: public function SanitizeStatusFromPP($status, $ipndata)

Returns: string the status

Parameters:

  • string $status status passed by PP

  • array $ipndata data from the PP

SetVar

Sets data for the PaymentProvider.

Definition: public function SetVar($name, $value)

Returns: PaymentProvider $this

Parameters:

  • string $name Argument name

  • mixed $value Argument value

StartCheckout

Starts the checkout process

Definition: abstract public function StartCheckout(IShopOrder $order, $ok_url=false, $cancel_url=false)

Returns: Form Must return a Form control

Parameters:

  • IShopOrder $order The order to start checkout for

  • string $ok_url URL to be redirected to after payment

  • string $cancel_url URL to be redirected to when user cancels payment

Clone this wiki locally