Payment Processing Interfaces

Payment gateways come in all shapes and sizes and preform various functions. To make sure that Payments can figure out which payment gateways can do what, we use Payment Interfaces.

Payment Interfaces are interfaces implemented by the payment gateway that help signal to Payments the functionality that they provide.

The current available payment interfaces are:

APP_Payment_Processor: The basics that all payment gateways must implement.

interface APP_Payment_Processor {
 
    /**
     * Returns an array representing the form to output for admin configuration
     * @return array scbForms style form array
     */
    function form();
 
    /**
     * Provides the unique identifier for this Gateway
     *
     * @return string
     */
    function identifier();
 
    /**
     * Provides the display name for this Gateway
     *
     * @return string
     */
    function display_name( $type = 'dropdown' );
 
    /**
     * Returns if the gateway supports the given service
     * @return bool
     */
    function supports( $service = 'instant' );
 
}

APP_Instant_Payment_Processor: Simple instant payments.

interface APP_Instant_Payment_Processor {
 
    /**
     * Processes an order payment
     * @param  APP_Order $order  The order to be processed
     * @param  array $options    An array of user-entered options
     *                           corresponding to the values provided in form()
     * @return void
     */
    function process( $order, array $options );
 
}

APP_Recurring_Payment_Processor: Recurring instant payments. Note: Must also implement APP_Instant_Payment_Processor.

interface APP_Recurring_Payment_Processor {
 
    /**
     * Process a recurring order
     * @param APP_Order $order The order to be processed
     * @param array $options An array of user-entered options
     *              corresponding to the values provided in form()
     * @return void
     */
    function process_recurring( $order, array $options );
 
}

APP_Escrow_Payment_Processor: Escrow payments where the payment and payout are delayed.

interface APP_Escrow_Payment_Processor {
 
    /**
     * Processes the initial setup of the escrow payment
     * @param APP_Order $order The order to be processed
     * @param array $options An array of user-entered options
     *              corresponding to the values provided in form()
     * @return void
    */
    function process_escrow( APP_Escrow_Order $order, array $options );
 
    /**
    * Completes the transaction towards the seller
    * @param APP_Order $order The order to be processed
    * @param array $options An array of user-entered options
    *               corresponding to the values provided in form()
    * @return void
    */
    function complete_escrow( APP_Escrow_Order $order, array $options );
 
    /**
    * Refunds the transaction towards the buyer
    * @param APP_Order $order The order to be processed
    * @param array $options An array of user-entered options
    *               corresponding to the values provided in form()
    * @return void
    */
    function fail_escrow( APP_Escrow_Order $order, array $options );
 
    /**
     * Outputs/processes a form for user's escrow account data
     */
    function user_form();
}

Popular Add-ons

Dotpay for WP eCommerce

Accept payments in your WP eCommerce shop with Dotpay: 45 payment methods,…


(1)
$39

Ad Stuffer

Place more banner ads and AdSense ad spaces on your ClassiPress site.


(3)
$19

ClassiSky

A beautiful responsive child theme for ClassiPress.


(9)
$19