Index: /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/demo_provider.py
===================================================================
--- /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/demo_provider.py	(revision 12722)
+++ /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/demo_provider.py	(revision 12723)
@@ -1,7 +1,8 @@
 import grok
 from waeup.ikoba.interfaces import MessageFactory as _
-from waeup.ikoba.browser.layout import IkobaPage
+from waeup.ikoba.browser.layout import IkobaEditFormPage, action
 from waeup.ikoba.payments.interfaces import IPaymentGatewayService, IPayment
-from waeup.ikoba.payments.payment import Payment, get_payment
+from waeup.ikoba.payments.payment import (
+    Payment, get_payment, find_payable_from_payable_id)
 
 
@@ -43,5 +44,5 @@
 
 
-class CreditCardStep1(IkobaPage):
+class CreditCardStep1(IkobaEditFormPage):
     grok.context(IPayment)
     grok.name('demo_cc1')
@@ -54,2 +55,20 @@
     def update(self):
         pass
+
+    @action(_('Authorize Payment'), style="primary")
+    def authorize(self, **data):
+        print "AUTH!"
+
+    @action(_('Cancel'))
+    def cancel(self, **data):
+        """Go back to the payable (if possible) or site home.
+        """
+        payable_id = getattr(self.context, 'payable_id', '')
+        payed_item = find_payable_from_payable_id(payable_id)
+        self.flash(_("Payment cancelled."))
+        if payed_item is not None:
+            # remove context/payment?
+            target = self.url(payed_item)
+        else:
+            target = grok.getSite()
+        self.redirect(self.url(target))
Index: /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/templates/demo_cc_step1.pt
===================================================================
--- /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/templates/demo_cc_step1.pt	(revision 12722)
+++ /main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/templates/demo_cc_step1.pt	(revision 12723)
@@ -126,8 +126,12 @@
     </div>
   </div>
+
   <div class="form-group">
     <div class="col-sm-offset-2 col-sm-10">
-      <button type="submit" class="btn btn-primary">Authorize Payment</button>
-      <button type="submit" class="btn">Cancel</button>
+      <div tal:condition="view/availableActions">
+        <input tal:repeat="action view/actions"
+               tal:replace="structure action/render"
+               />
+      </div>
     </div>
   </div>
