JAM Documentation
Main ::Quick Config / How Tos
Minimize Text   Default    Enlarge Text

How To Create Your Own Custom Payment Processor Module

JAM allows you to create your own custom payment processors, provided you have advanced knowledge of PHP and web application programming.

*This is for advanced users only, if you do not know how to create and edit PHP scripts, we strongly advise you against creating your own payment processor and consult a web developer.

  1. Create a folder in /plugins/processors and name it your payment processor.  For example:

    /plugins/processors/Processor_Name
  2. Copy all .php files from the /plugins/processors/Egold.  We will use this as the template for the payment processor.  These files include:

    processor.template.config.php
    processor.template.form.php
    processor.template.values.php
    index.php
  3. Open up the processor.template.config.php file. This file is used in the JAM admin area under Settings > Payment Settings for inserting and updating  fields in the jx_processor_config database table that will be used by your payment processor.
  4. Edit the $payment_type variable and set it as the name of your processor.  Make sure it is the same name as the processor folder.
  5. There are 3 required fields: Status, Description, and Default.  Keep these form fields intact when editing the form.
  6. You can have up to 20 fields for use in your payment processor.  These will be available for you to use when you run the payment processor.  For example, in the EGold processor, we use the config_1 field for the EGold Merchant ID.  You can create 20 fields, naming them config_1, config_2, config_3 and so on.
  7. Once you've finished creating the form, save it and upload it in your custom processor folder.
  8.   Open up the processor.template.form.php file.  This file will have the main payment form that sends data to your payment processor/gateway.
  9. You can edit the form here to have the form for your payment processor.  The variables available are:

    $module - This is an array from the jx_processor_config table that has any data that you need from saving it via the processor.template.config.php file in the admin area. Values are:

    $module['id']
    $module['status']
    $module['name']
    $module['description']
    $module['default_payment']
    $module['config_1'] - $module['config_20']


    Other required variables:

    $product_name - Name of your Program
    $membership_full_amount - the amount you are charging for this payment
    $vcode - verification code used to activate the affiliate membership after payment.  This variable must be transmited back to either the return URL or the notify URL in order to activate the affiliate membership automatically.

    Optional variables:

    $membership_length - the length of the membership as specified in Programs > Edit Program.  This can be any of the following:

    0 - No expiration
    1 - Monthly
    3 - Quarterly
    6 - Semi-Annually
    12 - Annually

    Return URL
    - This URL is for returning your members back to JAM for confirmation.  This is the following PHP value:

    MEMBERS_HOME_BASE_URL.HOME_BASE_AFFILIATE_DIRECTORY.'/process/'.$jam_return;

    Notify URL - If your payment processor supports a separate notification URL, you can use this as well.  This is the following PHP value:

    MEMBERS_HOME_BASE_URL.HOME_BASE_AFFILIATE_DIRECTORY.'/ccprocess.php?type='.$processor_option;

    *If your payment processor does not use a separate notification URL, you can set the Notify URL given above as the Return URL

  10. Once you are done configuring the processor.template.form.php file, save it to your processor folder.
  11. Open up the processor.template.values.php file. This is used for mapping the variables that your payment processor posts back to JAM after payment is made.
  12. Make sure you map the variables posted by your payment processor to the variables required b JAM.  For example, if your payment processor posts the sale amount as $_POST['payment_amount'], you need to map this to the required JAM variable for amount:

    $amount = $_POST['payment_amount'];

    The required variables here are:

    $process_affiliate_payment - Set this to true if your payment processor successfully processed the payment
    $process_affiliate - Set this to true if you want to generate commissions from this affiliate payment
    $amount - the amount paid
    $trans_id - the transaction ID used for this payment
    $vcode - the variable you used to post the verification code variable from processor.template.form.php
  13. Once you're done, save the file as processor.template.values.php into your processor folder.
  14. Run tests to make sure that the affiliate member can pay via your payment processor and that his/her account is automatically created after payment.




Related Articles
Receiving Payments via AlertPay
JAM allows you to accept Payments for Membership via AlertPay. To enable this option, follow these directions: Login to your AlertPay account and set the Alert...
System Integration using a Hidden Image Tag
To integrate JAM into your website / application using a Hidden Image Tag, use the following directions: Click on Settings>System Integration ,...
System Integration using a PHP script
To integrate JAM into your website / application using a PHP Script, use the following directions: Your landing or thank you page must be written in PHP....

 

Search Glossary Saved Article Contact us