Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

27 wiersze
893 B

  1. # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
  2. # License: GNU General Public License v3. See license.txt
  3. from __future__ import unicode_literals
  4. import frappe
  5. from frappe import _
  6. import json
  7. from frappe.integrations.doctype.paytm_settings.paytm_settings import get_paytm_params, get_paytm_config
  8. def get_context(context):
  9. context.no_cache = 1
  10. paytm_config = get_paytm_config()
  11. try:
  12. doc = frappe.get_doc("Integration Request", frappe.form_dict['order_id'])
  13. context.payment_details = get_paytm_params(json.loads(doc.data), doc.name, paytm_config)
  14. context.url = paytm_config.url
  15. except Exception:
  16. frappe.log_error()
  17. frappe.redirect_to_message(_('Invalid Token'),
  18. _('Seems token you are using is invalid!'),
  19. http_status_code=400, indicator_color='red')
  20. frappe.local.flags.redirect_location = frappe.local.response.location
  21. raise frappe.Redirect