Source for file Payment_Process-example.php
Documentation is available at Payment_Process-example.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: Payment_Process-example.php,v 1.3 2004/03/22 20:37:13 ieure Exp $
require 'Payment/Process.php';
// Set options. These are processor-specific.
// Get an instance of the processor
// The data for our transaction.
// The credit card information
$cc->cardNumber = "4111111111111111";
/* Alternately, you can use setFrom()
'type' => PAYMENT_PROCESS_CC_VISA,
'cardNumber' => "4111111111111111",
$processor->setFrom ($data);
if (!$processor->setPayment (&$cc)) {
PEAR ::raiseError ("Payment data is invalid.");
$result = $processor->process ();
if (PEAR ::isError ($result)) {
// process() returns a PEAR_Error if validation failed.
print " Validation failed: {$result->message }\n";
} else if ($result->isSuccess ()) {
print $result->getMessage (). "\n";
Documentation generated on Mon, 11 Mar 2019 14:00:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|