Révision 443f885e
Ajouté par Benjamin Dauvergne il y a environ 9 ans
extra/modules/payments.py | ||
---|---|---|
10 | 10 |
from quixote import (redirect, get_publisher, get_request, get_session, |
11 | 11 |
get_response) |
12 | 12 |
from quixote.directory import Directory |
13 |
from quixote.html import TemplateIO, htmltext |
|
13 | 14 |
|
14 | 15 |
if not set: |
15 | 16 |
from sets import Set as set |
... | ... | |
429 | 430 |
if kind == eopayment.URL: |
430 | 431 |
return redirect(data) |
431 | 432 |
elif kind == eopayment.FORM: |
432 |
raise NotImplementedError()
|
|
433 |
return return_eopayment_form(data)
|
|
433 | 434 |
else: |
434 | 435 |
raise NotImplementedError() |
435 | 436 |
|
437 |
def return_eopayment_form(form): |
|
438 |
r = TemplateIO(html=True) |
|
439 |
r += htmltext('<html><body onload="document.payform.submit()">') |
|
440 |
r += htmltext('<form action="%s" method="%s" name="payform">') % (form.url, form.method) |
|
441 |
for field in form.fields: |
|
442 |
r += htmltext('<input type="%s" name="%s" value="%s"/>') % ( |
|
443 |
field['type'], |
|
444 |
field['name'], |
|
445 |
field['value']) |
|
446 |
r += htmltext('<input type="submit" name="submit" value="%s"/>') % _('Pay') |
|
447 |
r += htmltext('</body></html>') |
|
448 |
return r.getvalue() |
|
449 |
|
|
436 | 450 |
|
437 | 451 |
class PaymentValidationWorkflowStatusItem(WorkflowStatusItem): |
438 | 452 |
description = N_('Payment Validation') |
Formats disponibles : Unified diff
Implement POST method for eopayment requests (fixes #6905)