[cvs] [Wiki] changed: Project/Horde_Payment
Duck
duck at obala.net
Sun Nov 30 19:19:37 UTC 2008
duck Sun, 30 Nov 2008 14:19:37 -0500
Modified page: http://wiki.horde.org/Project/Horde_Payment
New Revision: 1.6
Change log: authorizationRequest
@@ -12,9 +12,9 @@
Duck [mailto:duck at obala.net duck at obala.net]
++ Code
-http://cvs.horde.org/incubator/spread/
+http://cvs.horde.org/incubator/Horde_Payment/
++ Description
A payment processing module encapsulating all communications with
various payment interfaces.
@@ -37,11 +37,34 @@
* Limit payment methods per application
* Virtual host support
* Possibility to add a testing process request
-+++ authorizationResponse() API example
++++ authorizationRequest() usage example
-<?php
+<code type="php">
+
+$app = $registry->getApp(); // Calling app
+$transaction_id = "myID123"; // App internal unique id
+$total = 500; // Total requested amount
+$params = array(); // Optional: Additional payment parameters, like
user details (name, address etc..)
+
+// Check if any authorization method exits and is linked to this
+$authorization_methods = $registry->call('payment/getMethods', array($app));
+
+// Push an paymnet authorization request
+$authorizationID = $registry->call('payment/authorizationRequest',
+ array($app, $transaction_id,
$total, $params));
+
+// Redirect to paymnet system
+// $redirect_url = $registry->link('payment/show', array('id' =>
$transaction_id, 'module' => $app));
+$redirect_url = $registry->link('payment/show', array('id' =>
$authorizationID));
+
+header('Location:' . $redirect_url);
+exit;
+
+</code>
+
++++ authorizationResponse() API example
<code type="php">
...
More information about the cvs
mailing list