Index: /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/paypal.py
===================================================================
--- /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/paypal.py	(revision 12028)
+++ /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/paypal.py	(revision 12029)
@@ -16,4 +16,6 @@
 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##
+"""Support for PayPal payments.
+"""
 import ConfigParser
 import paypalrestsdk
@@ -53,4 +55,28 @@
 
 
+def configure_sdk(path):
+    """Configure the PayPal SDK with values from config in `path`.
+
+    Parse paypal configuration from file in `path` and set
+    configuration in SDK accordingly.
+
+    Returns a dict with values from config file and path set.
+
+    This function will normally be called during start-up and only
+    this one time.
+
+    It is neccessary to authorize later calls to other part of the
+    PayPal API.
+    """
+    conf = parse_paypal_config(path)
+    paypalrestsdk.configure({
+        'mode': conf['mode'],
+        'client_id': conf['client_id'],
+        'client_secret': conf['client_secret'],
+        })
+    conf['path'] = path
+    return conf
+
+
 def get_access_token():
     """Get an access token for further calls.
Index: /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_paypal.py
===================================================================
--- /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_paypal.py	(revision 12028)
+++ /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_paypal.py	(revision 12029)
@@ -20,8 +20,10 @@
 import tempfile
 import unittest
+import paypalrestsdk
 from zope.component import getGlobalSiteManager, queryUtility
 from waeup.ikoba.interfaces import IPayPalConfig
 from waeup.ikoba.payments.paypal import (
     get_paypal_config_file_path, parse_paypal_config, get_access_token,
+    configure_sdk,
     )
 from waeup.ikoba.testing import (
@@ -79,4 +81,18 @@
         assert result['mode'] == "sandbox"
 
+    def test_configure_sdk(self):
+        # we can configure the paypal sdk
+        path = os.path.join(self.workdir, 'sample.cfg')
+        open(path, 'w').write(
+            "[rest-client]\n"
+            "id = my-special-id\n"
+            )
+        result = configure_sdk(path)
+        assert result['client_id'] == 'my-special-id'
+        assert result['client_secret'] is None
+        assert result['mode'] == "sandbox"
+        assert paypalrestsdk.api.__api__.mode == 'sandbox'
+        assert paypalrestsdk.api.__api__.client_id == 'my-special-id'
+
 
 class FunctionalPaypalTests(FunctionalTestCase):
