1.2.1 How to add a custom payment gateway

Discussion in 'Commonly Asked Questions and Their Solutions' started by renlok, Aug 4, 2016.

  1. renlok

    renlok Administrator Staff Member

    Oct 20, 2008
    Likes Received:
    WARNING: Doing this requires a reasonable amount of programming knowledge and an understanding about how the particular payment gateways API works

    This is an update to the old thread of added one to 1.1.2 versions and older in 1.2 the gateway system was simplified so it is now much easier to add your gateways.

    Throughout these instructions I am going to refer to an imaginary payment gateway mypaymentgateway, when doing it yourself change mypaymentgateway to the name of the gateway

    - Add payment gateway username or email as a column in the webid_users table and add the gateway to the webid_payment_options table

    Step 1:
    Open includes/class_fees.php and add a function to the fees class called mypaymentgateway_validate this is how webid validates the payment, this will be different for every gateway so just look at their API documentation (look at the existing functions for help as to how we have done it)

    Step 2:
    Open validate.php and add
    if (isset($_GET['mypaymentgateway']))
    before ?>

    Step 3:
    Open includes/config/gateways.php
    Add your payment gate way to the $gateway_links, $address_string and $error_string arrays. If your gateway has a password also add an entry to the $password_string array

    Then you need to edit the following edit:
    pay.tpl <-- add references to the new gateway

    I wrote this pretty quickly so might be missing something PM if something amiss
    Last edited: Aug 4, 2016

Share This Page