[cvs] [Wiki] changed: Project/Horde_Payment
Duck
duck at obala.net
Fri Feb 13 09:43:29 UTC 2009
duck Fri, 13 Feb 2009 04:43:29 -0500
Modified page: http://wiki.horde.org/Project/Horde_Payment
New Revision: 1.14
Change log: listAuthorisations
@@ -53,16 +53,41 @@
+++ Step 4: Redirection page
The user will be redirected back to the selling application page or
to the result of the authorizationReturn call.
-++ Writing your a payment module
+++ Writing your payment module
+++ Files
A payment module is class extension of Horde_Payment_Method and
should reside in a sub-directory /of lib/Modules named the same as you
module. Inside this directory there must be:
* version.php telling the configuration screen the version of your module
* conf.xml a configuration options
* Module.php man class file.
+
+++ List payment request to users
+A lot of payment request ends by user abort (they change their mind,
the line falls, system creases...) To remind them about their order,
you can use the listAthorizations method to list user's pending
athorizations. So they can restart the process where they finish
wherever they want.
+
+<code type="php">
+// Get authorisations for current application and user
+$authorizations = $registry->call('payment/listAuthorizations',
+ array(array('module_name' =>
$registry->getApp(),
+ 'user_uid' =>
Auth::getAuth())));
+
+// Get status names
+$statuses = $registry->call('payment/getStatuses');
+
+// List all authorizations and link pending ones to paymnet procces
+foreach ($authorizations as $authorization) {
+ echo date('y-m-d h:i:s', $authorization['created']) . '<br />';
+ echo $authorization['amount'] . '<br />';
+ echo $statuses[$authorization['status']] . '<br />';
+ if ($authorization['status'] == Horde_Payment::PENDING) {
+ $link = $registry->link('payment/show', array('id' =>
$authorization['authorization_id']));
+ echo ' - <a href="' . $link . '" target="_blank"><strong>' .
_("Please click here to continue!") . '</strong></a>';
+ }
+ echo '<hr />';
+}
+</code>
++ Api calls
+++ authorizationRequest() usage example
More information about the cvs
mailing list