@tornado.gen.coroutine
def post(self):
+ amount = self.get_argument("amount")
+ currency = self.get_argument("currency", "EUR")
+ frequency = self.get_argument("frequency")
+
# Get form inputs
args = {
- "amount" : self.get_argument("amount"),
- "currency" : self.get_argument("currency", "EUR"),
- "method" : self.get_argument("method", None),
+ "amount" : amount,
+ "currency" : currency,
# Is this a recurring donation?
- "recurring" : self.get_argument("frequency") == "monthly",
+ "recurring" : frequency == "monthly",
# Address
"email" : self.get_argument("email"),
"country_code" : self.get_argument("country_code"),
}
+ # Add URLs to redirect the user back
+ args.update({
+ "success_url" : "https://%s/donate/thank-you" % self.request.host,
+ "error_url" : "https://%s/donate/error" % self.request.host,
+ "back_url" : "https://%s/donate?amount=%s¤cy=%s&frequency=%s" %
+ (self.request.host, amount, currency, frequency),
+ })
+
# Send request to Zeiterfassung
try:
response = yield self.backend.zeiterfassung.send_request(