Documentation for pfpro extension

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@28338 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
David Croft 2000-07-15 02:31:17 +00:00
parent 03d12a1990
commit b929ff62b9

321
functions/pfpro.xml Normal file
View file

@ -0,0 +1,321 @@
<reference id="ref.pfpro">
<title>Payflow Pro functions</title>
<titleabbrev>Payflow Pro</titleabbrev>
<partintro>
<simpara>
This extension allows you to process credit cards using Verisign
Payment Services, formerly known as Signio
(<ulink url="&url.pfpro;">&url.pfpro;</ulink).
</simpara>
<simpara>
These functions are only available if PHP has been compiled with the
<option role="configure">--with-pfpro[=DIR]</option> option. You will
require the appropriate SDK for your platform, which may be
downloaded <ulink url="&url.pfpro.download;">from within the manager
interface</ulink> once you have registered.
</simpara>
<simpara>
Once you have downloaded the SDK you should copy the files from
the <filename class="directory">lib</filename> directory of the
distribution. Copy the header file <filename>pfpro.h</filename>
to <filename class="directory">/usr/local/include</filename>
and the library file <filename>libpfpro.so</filename> to
<filename class="directory">/usr/local/lib</filename>.
</simpara>
<simpara>
When using these functions, you should call <function>pfpro_init</function>
once before you process any transactions, and
<function>pfpro_cleanup</function> afterwards. You may make any number
of transactions using <function>pfpro_process</function> between the two.
</simpara>
<simpara>
These functions have been added in PHP 4.02.
</simpara>
</partintro>
<refentry id="function.pfpro-init">
<refnamediv>
<refname>pfpro_init</refname>
<refpurpose>Initialises the Payflow Pro library</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>pfpro_init</function></funcdef>
<void/>
</funcprototype>
</funcsynopsis>
<para>
<function>pfpro_init</function> is used to initialise
the Payflow Pro library. It must be called before processing
any transactions.
</para>
<para>
See also <function>pfpro_cleanup</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.pfpro-cleanup">
<refnamediv>
<refname>pfpro_cleanup</refname>
<refpurpose>Shuts down the Payflow Pro library</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>pfpro_cleanup</function></funcdef>
<void/>
</funcprototype>
</funcsynopsis>
<para>
<function>pfpro_cleanup</function> is used to shutdown the
Payflow Pro library cleanly. It should be called after you
have processed any transactions and before your script
terminates.
</para>
<para>
See also <function>pfpro_init</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.pfpro-process">
<refnamediv>
<refname>pfpro_process</refname>
<refpurpose>Process a transaction with Payflow Pro</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>array <function>pfpro_process</function></funcdef>
<paramdef>array <parameter>parameters</parameter></paramdef>
<paramdef>string
<parameter><optional>address</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>port</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>timeout</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy address</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>proxy port</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy logon</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy password</optional></parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>
Returns: An associative array containing the response
</para>
<para>
<function>pfpro_process</function> processes a transaction
with Payflow Pro. The first parameter is an associative
array containing keys and values that will be encoded and
passed to the processor.
</para>
<para>
The second parameter is optional and specifies the host
to connect to. By default this is "test.signio.com", so
you will certainly want to change this to "connect.signio.com"
in order to process live transactions.
</para>
<para>
The third parameter specifies the port to connect on. It
defaults to 443, the standard SSL port.
</para>
<para>
The fourth parameter specifies the timeout to be used, in seconds.
This defaults to 30 seconds. Note that this timeout appears to only
begin once a link to the processor has been established and so your
script could potentially continue for a very long time in the event
of DNS or network problems.
</para>
<para>
The fifth parameter, if required, specifies the hostname of your
SSL proxy. The sixth parameter specifies the port to use.
</para>
<para>
The seventh and eighth parameters specify the logon identity
and password to use on the proxy.
</para>
<para>
The function returns an associative array of the keys and values
in the response.
</para>
<note><para>
You must have called <function>pfpro_init</function> before
calling this function.
</para></note>
<example>
<title>Payflow Pro example</title>
<programlisting role="php">
&lt;?php
pfpro_init();
$transaction = array(USER => 'mylogin',
PWD => 'mypassword',
TRXTYPE => 'S',
TENDER => 'C',
AMT => 1.50,
ACCT => '4111111111111111',
EXPDATE => '0904'
);
$response = pfpro_process($transaction);
if (!$response) {
die("Couldn't establish link to Signio.\n");
}
echo "Signio response code was ".$response[RESULT];
echo ", which means: ".$response[RESPMSG]."\n";
echo "\nThe transaction request: ";
print_r($transaction);
echo "\nThe response: ";
print_r($response);
pfpro_cleanup()
?>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.pfpro-process-raw">
<refnamediv>
<refname>pfpro_process_raw</refname>
<refpurpose>Process a raw transaction with Payflow Pro</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>pfpro_process_raw</function></funcdef>
<paramdef>string <parameter>parameters</parameter></paramdef>
<paramdef>string
<parameter><optional>address</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>port</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>timeout</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy address</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>proxy port</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy logon</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>proxy password</optional></parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>
Returns: A string containing the response.
</para>
<para>
<function>pfpro_process_raw</function> processes a raw transaction
string with Payflow Pro. You should really use
<function>pfpro_process</function> instead, as the encoding
rules of these transactions are non-standard.
</para>
<para>
The first parameter in this case is a string containing the raw
transaction request. All other parameters are the same as with
<function>pfpro_process</function>. The return value is a string
containing the raw response.
</para>
<note><para>
You must have called <function>pfpro_init</function> before
calling this function.
</para></note>
<example>
<title>Payflow Pro raw example</title>
<programlisting role="php">
&lt;?php
pfpro_init();
$response = pfpro_process("USER=mylogin&amp;PWD[5]=m&amp;ndy&amp;TRXTYPE=S&amp;TENDER=C&amp;AMT=1.50&amp;ACCT=4111111111111111&amp;EXPDATE=0904");
if (!$response) {
die("Couldn't establish link to Signio.\n");
}
echo "Signio raw response was ".$response;
pfpro_cleanup()
?>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.pfpro-version">
<refnamediv>
<refname>pfpro_version</refname>
<refpurpose>Returns the version of the Payflow Pro software</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>pfpro_version</function></funcdef>
<void/>
</funcprototype>
</funcsynopsis>
<para>
<function>pfpro_version</function> returns the version string
of the Payflow Pro library. At the time of writing, this was L211.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->