I am integrating Stripe payment with Oscar.

I have adapted the advice from this post:

https://groups.google.com/forum/#!searchin/django-oscar/handle_payment$20override%7Csort:date/django-oscar/Cr8sBI0GBu0/PHRdXX2uFQAJ

In order to be able to display the payment details on the preview page, I 
have overridden handle_payment_details_submission as follows:

    def handle_payment_details_submission(self, request):

        # get stripe token from request
        token = self.request.POST[STRIPE_TOKEN]

        # create customer
        email = self.request.POST[STRIPE_EMAIL]

        customer = Facade().create_customer(email, token)

        customer_id = customer.id

        last4 = customer.sources.data[0].last4

        brand = customer.sources.data[0].brand

        source_id = customer.sources.data[0].id

        return self.render_preview(request,
                                   customer_id=customer_id,
                                   last4=last4,
                                   email=email,
                                   brand=brand,
                                   source=source_id)
A new customer is created with the token.

But when it comes to handle_payment, I'm unsure how I pass the customer and 
source id to this method. The example in the post above retrieves the token 
from request.POST.

Do I need to somehow add customer_id and source_id to request.POST.? If so, 
how?

I'm clearly missing something as I imagine this should be quite simple.

Thanks in advance for your help.

Harry

-- 
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
--- 
You received this message because you are subscribed to the Google Groups 
"django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-oscar+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-oscar/871cee08-de91-4754-baec-bfd5b633c25c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to