From 395b041e5cd087a61813649b3e34ae8fd46b2cf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Pedersen?= <bjoern.pedersen@frm2.tum.de>
Date: Wed, 22 Aug 2012 13:41:09 +0200
Subject: [PATCH] [FEAT] Hook to get etxra payment details
* add a hook to enable payment plugins to inject text into the payment
details used in e.g. the registration email.
---
.../plugins/EPayment/bankTransfer/epayment.py | 61 ++++++----------------
indico/MaKaC/registration.py | 9 ++++
2 Dateien geÀndert, 24 Zeilen hinzugefÌgt(+), 46 Zeilen entfernt(-)
diff --git a/indico/MaKaC/plugins/EPayment/bankTransfer/epayment.py b/indico/MaKaC/plugins/EPayment/bankTransfer/epayment.py
index 80fcb42..3f8e16f 100644
a
|
b
|
class BankTransferMod(BaseEPayMod): |
75 | 75 | except: |
76 | 76 | pass |
77 | 77 | |
78 | | def getPaymentDetails(self): |
| 78 | def getExtraPaymentDetails(self): |
79 | 79 | |
80 | | txt="""<td align="right"><b>account bank</b></td> |
81 | | <td align="left">%s</td> |
82 | | </tr> |
83 | | <tr> |
84 | | <td align="right"><b>account BLZ</b></td> |
85 | | <td align="left">%s</td> |
86 | | </tr> |
87 | | <tr> |
88 | | <td align="right"><b>account Number</b></td> |
89 | | <td align="left">%s</td> |
90 | | </tr> |
91 | | <tr> |
92 | | <td align="right"><b>account IBAN</b></td> |
93 | | <td align="left">%s</td> |
94 | | </tr> |
95 | | <tr> |
96 | | <td align="right"><b>account SWIFT</b></td> |
97 | | <td align="left">%s</td> |
98 | | </tr> |
99 | | <tr> |
100 | | <td align="right"><b>Subject</b></td> |
101 | | <td align="left">PK-Nr %s ID </td> |
102 | | </tr> |
| 80 | txt="""\tBank: %s\n |
| 81 | \tBLZ: %s\n |
| 82 | \tAccount: %s\n |
| 83 | \tIBAN: %s\n |
| 84 | \tSWIFT: %s\n |
| 85 | \tSubject: PK-Nr %s ID \n |
| 86 | """%( |
| 87 | self.getAccountBank(), |
| 88 | self.getAccountBLZ(), |
| 89 | self.getAccountNumber(), |
| 90 | self.getAccountIBAN(), |
| 91 | self.getAccountSwift(), |
| 92 | self.getPKNumber()) |
103 | 93 | |
104 | | </table>"""%( |
105 | | self.getAccountBank(), |
106 | | self.getAccountBLZ(), |
107 | | self.getAccountNumber(), |
108 | | self.getAccountIBAN(), |
109 | | self.getAccountSwift(), |
110 | | self.getPKNumber()) |
111 | | # txt="""\tBank: %s\n |
112 | | #\tBLZ: %s\n |
113 | | #\tAccount: %s\n |
114 | | #\tIBAN: %s\n |
115 | | #\tSWIFT: %s\n |
116 | | #\tSubject: PK-Nr %s ID \n |
117 | | #"""%( |
118 | | # self.getAccountBank(), |
119 | | # self.getAccountBLZ(), |
120 | | # self.getAccountNumber(), |
121 | | # self.getAccountIBAN(), |
122 | | # self.getAccountSwift(), |
123 | | # self.getPKNumber()) |
124 | | # |
125 | | # raise Exception("test") |
126 | 94 | return txt |
| 95 | |
127 | 96 | def getdetailPayment(self): |
128 | 97 | return self._detailPayment |
129 | 98 | def setdetailPayment(self, detailPayment): |
diff --git a/indico/MaKaC/registration.py b/indico/MaKaC/registration.py
index 3545980..61f02ef 100644
a
|
b
|
Congratulations, your registration to %s was successful%s See your information b |
812 | 812 | getTitle=strip_ml_tags(registrant.getConference().getTitle()) |
813 | 813 | idRegistrant=registrant.getIdPay() |
814 | 814 | detailPayment=registrant.getConference().getModPay().getPaymentDetails() |
| 815 | |
| 816 | msgs = [] |
| 817 | for ePayMod in registrant.getConference().getModPay().getSortedEnabledModPay(): |
| 818 | try: |
| 819 | msgs.append(ePayMod.getExtraPaymentDetails()) |
| 820 | except Exception: |
| 821 | pass |
| 822 | detailPayment = detailPayment + "\n".join(msgs) |
| 823 | |
815 | 824 | subject=_("""Payment summary for '%s': %s""")%(strip_ml_tags(registrant.getConference().getTitle()), registrant.getFullName()) |
816 | 825 | body= _(""" |
817 | 826 | Please use this information for your payment (except for e-payment):\n |