Inserting a confirmation into the paypalpro checkout process

8 views
Skip to first unread message

Bill Jones

unread,
Sep 23, 2009, 5:46:07 PM9/23/09
to django-paypal
Is it possible to insert a confirmation step into the page flow when
using the PayPalPro view object when *not* using ExpressPay? It seems
the view only invokes the confirmation page for ExpressPay and not
Direct Pay.

/Bill

Steve J

unread,
Oct 8, 2009, 1:45:16 PM10/8/09
to django-paypal
Ah, I just found this as well.

Did you come across a solution, Bill?

Cheers
Steve

Bill Jones

unread,
Oct 9, 2009, 1:50:06 PM10/9/09
to django...@googlegroups.com
Nope. I've been away from the project for a while, but I didn't get
any helpful responses...

If you do I'd like to see the patch ;)

Cheers,
Bill

John Boxall

unread,
Oct 9, 2009, 5:39:33 PM10/9/09
to django-paypal
I'm going to assume you're talking about a confirmation of payment
information.

To provide a confirmation page to people going through the Direct
Payment flow you going to need a way to propagate the data from the
payment form in one request to the next.

Naively, you could just re-populate the form with whatever you
received from the first post request and this time include a boolean
confirmation switch that will go ahead with the processing of the
payment. Ignoring the security issues behind serving a page that
contains someone's credit card information, here is a start:

class PayPalProWithConfirmation(PayPalPro):
def should_validate_payment_form(self):
return self.request.POST.get("confirm", False)

def render_payment_form(self):
self.context["confirm"] = bool(request.POST)
self.context[self.form_context_name] = self.payment_form_cls
(initial=request.POST)
return render_to_response(self.payment_template, self.context,
RequestContext(self.request))


...

In your template
...

<form>
{{ form }}
{% if confirm %}
<input type="hidden" name="confirm" value="1" />
<input type="submit" value="Confirm">
{% else %}
<input type="submit" value="Submit">
</form>



John
Reply all
Reply to author
Forward
0 new messages