- Timestamp:
- 8 Mar 2015, 18:24:20 (10 years ago)
- Location:
- main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/browser.py
r12663 r12689 1506 1506 label = _('Select payment method') 1507 1507 1508 @property 1509 def payment_gateways(self): 1510 """Get an iter over registered and enabled gateway service providers. 1511 1512 We provide tuples ``(value, description)`` for each supported 1513 payment gateway. 1514 """ 1515 from waeup.ikoba.payments.interfaces import IPaymentGatewayServicesLister 1516 lister = getUtility(IPaymentGatewayServicesLister) 1517 for name, service in lister().items(): 1518 yield {'name': name, 'title': service.title} 1519 1508 1520 def update(self, CANCEL=None): 1509 1521 if self.context.state != CREATED or not self.context.fee_based: … … 1513 1525 return 1514 1526 1515 @action(_('Select payment method and proceed to payment gateway (final submission)'), 1527 @action(_('Select payment method and proceed to payment gateway' 1528 ' (final submission)'), 1516 1529 style='primary', warning=WARNING_CON,) 1517 1530 def confirm(self, **data): -
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/browser_templates/selectpaymentmethodpage.pt
r12663 r12689 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 2 i18n:domain="waeup.ikoba" enctype="multipart/form-data"> 3 4 <div class="form-group"> 5 6 <div class="radio" tal:repeat="service view/payment_gateways"> 7 <label> 8 <input type="radio" name="gw" tal:attributes="value service/name" /> 9 <b><span tal:replace="service/title" /></b> 10 </label> 11 </div> 12 13 </div> 3 14 4 15 <table class="form-table"> -
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/tests/test_browser.py
r12663 r12689 1493 1493 self.browser.getControl("Apply").click() 1494 1494 self.assertEqual(IWorkflowState(self.contract).getState(), 'approved') 1495 1496 def add_product_option(self, contract): 1497 prodoption = ProductOption() 1498 prodoption.title = u'Any product option' 1499 prodoption.fee = Decimal('88.8') 1500 prodoption.currency = 'EUR' 1501 contract.product_options = [prodoption,] 1502 1503 def test_select_payment(self): 1504 # select payment 1505 IWorkflowState(self.customer).setState('approved') 1506 IWorkflowState(self.document).setState('verified') 1507 self.contract.document_object = self.document 1508 self.add_product_option(self.contract) 1509 IWorkflowState(self.contract).setState('created') 1510 # login as customer 1511 self.browser.open(self.login_path) 1512 self.browser.getControl(name="form.login").value = self.customer_id 1513 self.browser.getControl(name="form.password").value = 'cpwd' 1514 self.browser.getControl("Login").click() 1515 # go to our contract 1516 self.browser.open('%s/CON1/edit' % self.contracts_path) 1517 self.browser.getControl("Proceed to checkout").click() 1518 self.assertTrue( 1519 "Select payment method" in self.browser.contents) 1520 self.assertTrue( 1521 'Credit Card (Demo Payments)' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.