]> granicus.if.org Git - php/commitdiff
test file for pfpro
authorDavid Croft <david@php.net>
Sat, 15 Jul 2000 03:07:49 +0000 (03:07 +0000)
committerDavid Croft <david@php.net>
Sat, 15 Jul 2000 03:07:49 +0000 (03:07 +0000)
ext/pfpro/test.php
tests/testpfpro.php [new file with mode: 0644]

index 712cc073cb1daf3f962c1437218713f59158dab2..dd772dc2b41797fbd9cd6ebc3038cfeed0be2b04 100644 (file)
@@ -38,6 +38,6 @@ echo "\n";
 echo "Dump of the response ";
 print_r($response);
 
-pfpro_cleanup()
+pfpro_cleanup();
 
 ?>
diff --git a/tests/testpfpro.php b/tests/testpfpro.php
new file mode 100644 (file)
index 0000000..ffb1784
--- /dev/null
@@ -0,0 +1,39 @@
+<?
+
+if (!extension_loaded('pfpro')) {
+  die("pfpro module is not compiled in PHP\n");
+}
+
+echo "<pre>\n\n";
+
+echo "Payflow Pro library is version ".pfpro_version()."\n";
+
+pfpro_init();
+
+$transaction = array(USER      => 'mylogin',
+                    PWD        => 'mypassword',
+                    TRXTYPE    => 'S',
+                    TENDER     => 'C',
+                    AMT        => 1.50,
+                    ACCT       => '4111111111111111',
+                    EXPDATE    => '0900'
+                    );
+
+$response = pfpro_process($transaction);
+
+if (!$response) {
+  die("Couldn't establish link to signio software.\n");
+}
+
+echo "Signio response code was ".$response[RESULT];
+echo ", which means: ".$response[RESPMSG]."\n";
+
+echo "\nDump of the transaction request ";
+print_r($transaction);
+
+echo "\nDump of the response ";
+print_r($response);
+
+pfpro_cleanup();
+
+?>