Changeset 12723 for main/waeup.ikoba/branches/uli-payments
- Timestamp:
- 10 Mar 2015, 16:18:57 (10 years ago)
- Location:
- main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/demo_provider.py
r12711 r12723 1 1 import grok 2 2 from waeup.ikoba.interfaces import MessageFactory as _ 3 from waeup.ikoba.browser.layout import Ikoba Page3 from waeup.ikoba.browser.layout import IkobaEditFormPage, action 4 4 from waeup.ikoba.payments.interfaces import IPaymentGatewayService, IPayment 5 from waeup.ikoba.payments.payment import Payment, get_payment 5 from waeup.ikoba.payments.payment import ( 6 Payment, get_payment, find_payable_from_payable_id) 6 7 7 8 … … 43 44 44 45 45 class CreditCardStep1(Ikoba Page):46 class CreditCardStep1(IkobaEditFormPage): 46 47 grok.context(IPayment) 47 48 grok.name('demo_cc1') … … 54 55 def update(self): 55 56 pass 57 58 @action(_('Authorize Payment'), style="primary") 59 def authorize(self, **data): 60 print "AUTH!" 61 62 @action(_('Cancel')) 63 def cancel(self, **data): 64 """Go back to the payable (if possible) or site home. 65 """ 66 payable_id = getattr(self.context, 'payable_id', '') 67 payed_item = find_payable_from_payable_id(payable_id) 68 self.flash(_("Payment cancelled.")) 69 if payed_item is not None: 70 # remove context/payment? 71 target = self.url(payed_item) 72 else: 73 target = grok.getSite() 74 self.redirect(self.url(target)) -
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/templates/demo_cc_step1.pt
r12708 r12723 126 126 </div> 127 127 </div> 128 128 129 <div class="form-group"> 129 130 <div class="col-sm-offset-2 col-sm-10"> 130 <button type="submit" class="btn btn-primary">Authorize Payment</button> 131 <button type="submit" class="btn">Cancel</button> 131 <div tal:condition="view/availableActions"> 132 <input tal:repeat="action view/actions" 133 tal:replace="structure action/render" 134 /> 135 </div> 132 136 </div> 133 137 </div>
Note: See TracChangeset for help on using the changeset viewer.