1. Home
  2. Docs
  3. Payment Gateways API
  4. Getting Started

Getting Started

Request, download and extract the sample gateway:

Open “prefive-sample-gateway.php” with your favourite code editor, then search and replace “sample” and “Sample” (both case sensitive) with your gateway name (lowercase and normal case, respectively). Rename the file and plugin folder too.

Example:
‘sample’ => ‘mygateway’
‘Sample’ => ‘MyGateway’

Structure

The sample gateway consists in three main parts:

  1. Construct functions
    • __construct()
    • init_gateways()
    • add_gateways( $methods )
    • save_gateway()
    • show_gateways()
  2. Checkout functions
    • taketogateway_function( $payment_type, $common_details )
    • get_gateway_currency( $currency )
  3. Processing functions
    • processgateway_function( $payment_type, $details )

Normally you should be able to create your gateway only by adding your code in those functions from above, leaving all the rest of the code untouched.

Below we’ll take and explain one by one all of the functions that you may need to touch.

Was this article helpful to you? Yes No

How can we help?