Explorar el Código

[minor] wait for razorpay to complete the payment

pull/2/head
Rushabh Mehta hace 8 años
padre
commit
67eb29738f
Se han modificado 1 ficheros con 9 adiciones y 5 borrados
  1. +9
    -5
      payments/templates/pages/razorpay_checkout.py

+ 9
- 5
payments/templates/pages/razorpay_checkout.py Ver fichero

@@ -3,8 +3,8 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_url, flt
import json, urllib
from frappe.utils import flt
import json

from frappe.integrations.razorpay import Controller

@@ -18,8 +18,6 @@ def get_context(context):
context.no_cache = 1
context.api_key = Controller().get_settings().api_key

installed_apps = frappe.get_installed_apps()

# all these keys exist in form_dict
if not (set(expected_keys) - set(frappe.form_dict.keys())):
for key in expected_keys:
@@ -45,4 +43,10 @@ def make_payment(razorpay_payment_id, options, reference_doctype, reference_docn
"reference_doctype": reference_doctype
})

return Controller().create_request(data)
# let razorpay commit its payments!
import time
time.sleep(0.5)

data = Controller().create_request(data)
frappe.db.commit()
return data

Cargando…
Cancelar
Guardar