php-doc-en/functions/pfpro.xml
David Croft b9d3f00854 Updates to pfpro documentation:
* Now officially known as Verisign Payflow Pro.
* Altered text that referred specifically to credit cards.
* pfpro_init and pfpro_cleanup are no longer required functions,
  the extension will call them automatically as required, however
  they are still available to enable fine control.
* Added warnings to be sure to read the Developers Guide.
* Added missing semicolon on last line of example script.

Note to translators: There is more to come, as the extension will soon
have some php.ini entries.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@28877 c90b9560-bf6c-de11-be94-00142212c4b1
2000-07-24 00:34:40 +00:00

334 lines
10 KiB
XML

<reference id="ref.pfpro">
<title>Verisign Payflow Pro functions</title>
<titleabbrev>Verisign Payflow Pro</titleabbrev>
<partintro>
<simpara>
This extension allows you to process credit cards and other financial
transactions 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 may omit calls to
<function>pfpro_init</function> and <function>pfpro_cleanup</function>
as this extension will do so automatically if required. However the
functions are still available in case you are processing a number of
transactions and require fine control over the library.
You may perform any number
of transactions using <function>pfpro_process</function> between the two.
</simpara>
<simpara>
These functions have been added in PHP 4.0.2.
</simpara>
<note><para>
These functions only provide a link to Verisign Payment Services. Be sure
to read the Payflow Pro Developers Guide for full details of the required
parameters.
</para></note>
</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. You may omit this call, in which case
this extension will automatically call <function>pfpro_init</function>
before the first transaction.
</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 the end of your script.
However you may omit this call, in which case this
extension will automatically call <function>pfpro_cleanup</function>
after 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>
Be sure to read the Payflow Pro Developers Guide for full details
of the required parameters.
</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 Verisign.\n");
}
echo "Verisign 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>
Be sure to read the Payflow Pro Developers Guide for full details
of the required parameters and encoding rules. You would be
well advised to use <function>pfpro_process</function> instead.
</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 Verisign.\n");
}
echo "Verisign 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:
-->