added middleware to put payment object into request
put payment object in context processor and efficiency optimizations