Source for file Dummy.php
Documentation is available at Dummy.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Ian Eure <ieure@php.net> |
// +----------------------------------------------------------------------+
// $Id: Dummy.php,v 1.6 2004/03/22 20:35:58 ieure Exp $
require_once 'Payment/Process/Common.php';
* Payment_PAYMENT_PROCESS_Dummy
* A dummy processor for offline testing. It can be made to return different
* result codes and messages for testing purposes.
* @package Payment_Process
* @author Ian Eure <ieure@php.net>
* Default options for this class.
* @see Payment_Process::setOptions()
var $_defaultOptions = array (
'returnCode' => PAYMENT_PROCESS_RESULT_APPROVED ,
'returnMessage' => "Dummy payment approved"
var $_returnValues = array (
'code' => PAYMENT_PROCESS_RESULT_APPROVED ,
'code' => PAYMENT_PROCESS_RESULT_DECLINED ,
'code' => PAYMENT_PROCESS_RESULT_OTHER ,
'message' => "System error"
* Process the (dummy) transaction
* @return mixed Payment_Process_Result instance or PEAR_Error
if (PEAR ::isError ($res = $this->validate())) {
if ($this->_options['randomResult']) {
$n = rand(0 , count($this->_returnValues) - 1 );
$code = &$this->_returnValues[$n]['code'];
$message = &$this->_returnValues[$n]['message'];
$code = &$this->_options['returnCode'];
$message = &$this->_options['returnMessage'];
Documentation generated on Mon, 11 Mar 2019 14:00:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|