Tuesday, November 30, 2010

2 paypal forms in a view with django-paypal

Hi! I like to show 2 different paypal forms using django-paypal, this is my code:

def payments(request):
    paypal_dict = { 
        'amount': None,
        'business': settings.PAYPAL_RECEIVER_EMAIL,
        'item_name': None,
        'notify_url': settings.PAYPAL_NOTIFY,
        'return_url': settings.PAYPAL_RETURN,
        'cancel_return': settings.PAYPAL_CANCEL,
    }   
    paypal_dict.update({'amount': '1', 'item_name': 'Anual suscription')
    suscription_form = PayPalPaymentsForm(initial=paypal_dict)
    
    paypal_dict.update({'amount': '0.01', 'item_name': 'Buy 5 coins')
    five_form = PayPalPaymentsForm(initial=paypal_dict)
  
    return render_to_response("forms/paypal.html", {'five_form': five_form, 'suscription_form': suscription_form})


It always show two forms but with the last one (five_form) but the update() works perfectly.

--
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt and/or .pptx

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment