def cod(id): form = Cod() form1 = Creditcard() form2 = Paypal() material = Materials.query.get_or_404(id) if form.validate_on_submit(): material.upayment = 'cod' material.purchase = 'purchased' material.cart = 'removed' sendmail() db.session.commit() return redirect('/successful') return render_template('/upayment.html',mat = material,form=form, form1 =form1,form2=form2)
def paypal(id): form = Cod() form1 = Creditcard() form2 = Paypal() material = Cartmaterials.query.get_or_404(id) if form2.validate_on_submit(): material.upayment = 'Paypal' material.purchase = 'purchased' material.cart = 'removed' sendmail() db.session.commit() if form2.validate_on_submit(): pay = Pay(userid=material.id, username=material.name, name=form2.name.data, card=form2.number.data, cvv=form2.cvv.data, validdate=form2.date.data) db.session.add(pay) db.session.commit() return redirect('/successful1') return render_template('/upayment.html', form=form, form1=form1, form2=form2)
def upayment(id): form = Cod() form1 = Creditcard() form2 = Paypal() material = Cartmaterials.query.get_or_404(id) return render_template('upayment.html', material=material, form=form, form1=form1, form2=form2)