[cvs] [Wiki] changed: Project/Horde_Payment

Duck duck at obala.net
Tue Dec 23 09:49:33 UTC 2008


duck  Tue, 23 Dec 2008 04:49:33 -0500

Modified page: http://wiki.horde.org/Project/Horde_Payment
New Revision:  1.8
Change log:  authorizationReturn API example

@@ -18,9 +18,9 @@
  ++ Description

  A payment processing module encapsulating all communications with  
various payment interfaces.

-The application just push a payment requests with  
“authorizationRequest” API call. When a payment is processed, the  
payment module calls the selling applications “authorizationResponse”  
callback API method to notify it of the results.
+The application just push a payment requests with  
“authorizationRequest” API call. When a payment is processed, the  
payment module calls the selling applications “authorizationResponse”  
callback API method to notify it of the results. After payment process  
is finished, the user will be redirected to the calling application  
webroot, or to the URL provided by “authorizationReturn” result if  
selling application provides it.

  The payment module provides an administrative interface to list and  
search payment requests per module, amount, user status etc.

  +++ Features
@@ -123,8 +123,50 @@
          // Unknown
          return PEAR::raiseError(_("Unknown response status"));

      }
+}
+</code>
+
++++ authorizationReturn() API example
+
+<code type="php">
+
+...
+
+$_services['authorizationReturn'] = array(
+    'args' => array('id' => 'id'),
+    'type' => 'string'
+);
+
+....
+
+/**
+ * Returns authorization comeback url.
+ *
+ * @param string $id         Invoice identification number
+ */
+function _manios_authorizationReturn($id)
+{
+    require_once dirname(__FILE__) . '/base.php';
+
+    $manios_driver = Manios_Driver::singleton();
+    if ($manios_driver instanceof PEAR_Error) {
+        return $manios_driver;
+    }
+
+    $transaction = $manios_driver->getTransaction($id);
+    if ($transaction instanceof PEAR_Error) {
+        return $transaction;
+    }
+
+    // The transaction has no campaign linked
+    if (empty($transaction['campaign_id'])) {
+        return Horde::applicationUrl('impressions/transfer.php', true);
+    }
+
+    // Redirect to campaign management
+    return Util::addParameter(Horde::applicationUrl('banners/',  
true), 'c', $transaction['campaign_id']);
  }
  </code>

  ++ Screenshots


More information about the cvs mailing list