Use proper payment form
This commit is contained in:
parent
ca18004819
commit
193b87bbb5
1 changed files with 15 additions and 6 deletions
|
@ -365,11 +365,20 @@ class PaymentOrderView(FormView):
|
||||||
# payment details form before we go on to verify payment
|
# payment details form before we go on to verify payment
|
||||||
if ('generic_payment_type' in request.session and
|
if ('generic_payment_type' in request.session and
|
||||||
self.request.session['generic_payment_type'] == 'generic'):
|
self.request.session['generic_payment_type'] == 'generic'):
|
||||||
|
if 'product_id' in request.session:
|
||||||
|
generic_payment_form = ProductPaymentForm(
|
||||||
|
data=request.POST, prefix='generic_payment_form',
|
||||||
|
product_id=request.session['product_id']
|
||||||
|
)
|
||||||
|
else:
|
||||||
generic_payment_form = GenericPaymentForm(
|
generic_payment_form = GenericPaymentForm(
|
||||||
data=request.POST, prefix='generic_payment_form'
|
data=request.POST, prefix='generic_payment_form'
|
||||||
)
|
)
|
||||||
if generic_payment_form.is_valid():
|
if generic_payment_form.is_valid():
|
||||||
logger.debug("Generic payment form is valid.")
|
logger.debug("Generic payment form is valid.")
|
||||||
|
if 'product_id' in request.session:
|
||||||
|
product = generic_payment_form.product
|
||||||
|
else:
|
||||||
product = generic_payment_form.cleaned_data.get(
|
product = generic_payment_form.cleaned_data.get(
|
||||||
'product_name'
|
'product_name'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue