Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document describes how to implement both Merchant and Non-Merchant merchant payment gateways. The difference between these two types is that Non-Merchant merchant gateways process payments on an external web site. That is, rather than enter payment details (credit card number or bank account information) within Blesta as is the case with Merchant gateways, Non-Merchant merchant gateways forward the user off to the payment processor's own website to enter their payment details, after which time they may be directed back to Blesta.

Merchant gateways are generally preferred over Non-Merchant merchant gateways as they allow the user to subscribe for automatic payment processing. Some Non-Merchant merchant gateways support subscription based payments, but these payments are initiated from the payment gateway rather than by Blesta, so they don't make a good fit for users with multiple services recurring at different intervals.

Info
titleDid you know...

The terms "Merchant gateway" and "Non-Merchant merchant gateway" were coined by the Blesta development team just prior to the initial launch of version 1.0 in 2007. The word "merchant" refers to the requirement of a Merchant Account to process payments.

Tip
titleUse the Extension Generator

As of Blesta 4.12 we've included a useful tool to help developers get started and save time.  Blesta's Extension Generator can be used to generate many the files necessary for a gateway and will create basic code with an option to include comments to help you understand each part of the code.


Getting Started with Payment Gateways

...

Code Block
languagephp
title/gateways/merchant/my_gatewagateway/my_gateway.php
linenumberstrue
<?php
class MyGateway extends MerchantGateway implements MerchantCc {

    ...

    public function upgrade($current_version) {
        #
        # TODO: Place upgrade logic here
        #
    }

}
?>

...