cart does not clear after paypal purchase (but works with sandbox)

126 views
Skip to first unread message

GuyBrush

unread,
Feb 2, 2010, 1:24:52 PM2/2/10
to satchm...@googlegroups.com
Hello everyone,

I have been struggling to figure out why the cart is not getting cleared
after a paypal purchase. Item is successfully purchased and after I
click on "return to homepage" from paypal, it returns to the purchase
summary properly but the item still in the cart.

I'm trying to look at the logs but I don't see anything. (I haven't
tried with excessive logs option yet)

Is there something I have to do on paypals end to make it work?
We are using paypal business account.

It seems to work ok with my developer sandbox account.

I'm using satchmo 0.9 and nginx server on webfaction

Does satchmo paypal requires Website Payments Pro?

Any help is appreciated!
Thanks!


Bruce Kroeze

unread,
Feb 2, 2010, 11:29:53 PM2/2/10
to satchm...@googlegroups.com
Have you set up the IPN call back on PayPal?  The Cart won't get cleared without a callback.



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




--
Bruce Kroeze
http://www.ecomsmith.com
It's time to hammer your site into shape.

GuyBrush

unread,
Feb 3, 2010, 5:01:37 PM2/3/10
to satchm...@googlegroups.com
Thank you for your reply! Sachmos community is great!
What should I set as paypal Notification URL?

GuyBrush

unread,
Feb 3, 2010, 5:25:33 PM2/3/10
to satchm...@googlegroups.com
I put in mydomain.com/checkout/paypal/ipn/

Still does not work.
Is that the correct url?

My shop is set to mydomain.com/

mydomain.com/checkout/paypal/success works fine when user returns to the
shop

Bruce Kroeze

unread,
Feb 3, 2010, 5:47:09 PM2/3/10
to satchm...@googlegroups.com
On Wed, Feb 3, 2010 at 2:25 PM, GuyBrush <guybru...@gmail.com> wrote:
I put in mydomain.com/checkout/paypal/ipn/

Still does not work.
Is that the correct url?

My shop is set to mydomain.com/

mydomain.com/checkout/paypal/success works fine when user returns to the shop
 
Sorry, I was wrong, you don't need to manually set the IPN anymore.  Actually that's been true for quite some time, I'd forgotten that.

You do need to debug this, here's how:

Look at the paypal checkout template: payment/templates/shop/checkout/paypal/confirm.html

At the end of the page, there is this important entry:

<input type="hidden" name="notify_url" value="{{shop.base_url}}{% url PAYPAL_satchmo_checkout-ipn %}" /> 

OK, now go to a checkout page and see what it is putting in for the value.  Is it a fully formed URL, with an "http" and your domain and everything?  If not, bingo, that's your problem.  Probably you don't have your shop.base_url set properly.  This gets set by setting the domain on your site object.

If it is fully formed, do you see any hits on that url in your logs?

---
Bruce Kroeze

GuyBrush

unread,
Feb 3, 2010, 7:53:05 PM2/3/10
to satchm...@googlegroups.com
No luck yet.

Bruce Kroeze wrote:
> On Wed, Feb 3, 2010 at 2:25 PM, GuyBrush <guybru...@gmail.com
> <mailto:guybru...@gmail.com>> wrote:
>
> I put in mydomain.com/checkout/paypal/ipn/

> <http://mydomain.com/checkout/paypal/ipn/>


>
> Still does not work.
> Is that the correct url?
>

> My shop is set to mydomain.com/ <http://mydomain.com/>
>
> mydomain.com/checkout/paypal/success
> <http://mydomain.com/checkout/paypal/success> works fine when user


> returns to the shop
>
>
> Sorry, I was wrong, you don't need to manually set the IPN anymore.
> Actually that's been true for quite some time, I'd forgotten that.
>
> You do need to debug this, here's how:
>
> Look at the paypal checkout template:
> payment/templates/shop/checkout/paypal/confirm.html
>
> At the end of the page, there is this important entry:
>
> <input type="hidden" name="notify_url" value="{{shop.base_url}}{% url
> PAYPAL_satchmo_checkout-ipn %}" />

Thats how mine looks like

<input type="hidden" name="notify_url"

value="http://luckyseven.webfactional.com/checkout/paypal/ipn/" />

> OK, now go to a checkout page and see what it is putting in for the
> value. Is it a fully formed URL, with an "http" and your domain and
> everything? If not, bingo, that's your problem. Probably you don't
> have your shop.base_url set properly. This gets set by setting the
> domain on your site object.
>
> If it is fully formed, do you see any hits on that url in your logs?


logs:
frontend/access_luckyseven.log:216.113.191.33 - - [02/Feb/2010:10:50:47
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log:216.113.191.33 - - [02/Feb/2010:10:53:05
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log:66.211.170.66 - - [02/Feb/2010:11:04:19
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log:66.211.170.66 - - [02/Feb/2010:11:12:16
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log:216.113.191.33 - - [03/Feb/2010:15:58:07
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log.2:66.211.170.66 - - [01/Feb/2010:16:03:56
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
frontend/access_luckyseven.log.2:66.211.170.66 - - [01/Feb/2010:16:04:58
-0600] "POST /checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"

I think these are from nginx
access.log:127.0.0.1 - - [22/Nov/2009:21:21:29 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [21/Dec/2009:00:12:06 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [21/Dec/2009:00:25:32 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [23/Jan/2010:09:16:01 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [23/Jan/2010:09:27:39 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [01/Feb/2010:16:03:56 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [01/Feb/2010:16:04:58 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [02/Feb/2010:10:50:47 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [02/Feb/2010:10:53:05 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [02/Feb/2010:11:04:19 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [02/Feb/2010:11:12:16 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"
access.log:127.0.0.1 - - [03/Feb/2010:15:58:07 -0600] "POST
/checkout/paypal/ipn/ HTTP/1.0" 200 0 "-" "-"


I'm not sure why it works with sandbox but not actual paypal


how my SHOP_BASE is set

#### Satchmo unique variables ####
#from django.conf.urls.defaults import patterns, include
SATCHMO_SETTINGS = {
'SHOP_BASE' : '',
'MULTISHOP' : False,
#'SHOP_URLS' : patterns('satchmo_store.shop.views',)
}


I appreciate any ideas.
I think I will give up for now and try again latter.
Do you think this could be an nginx/webfaction problem? USPS and paypal
sandbox seem to work tho.

Hopefully authorize.net will be ok :o)


Thanks!

GuyBrush

unread,
Feb 3, 2010, 8:05:22 PM2/3/10
to satchm...@googlegroups.com
Bruce Kroeze wrote:
>
>
> <input type="hidden" name="notify_url" value="{{shop.base_url}}{% url
> PAYPAL_satchmo_checkout-ipn %}" />
>
> OK, now go to a checkout page and see what it is putting in for the
> value. Is it a fully formed URL, with an "http" and your domain and
> everything? If not, bingo, that's your problem. Probably you don't
> have your shop.base_url set properly. This gets set by setting the
> domain on your site object.
>
Do you mean I need go in the backend and set the site name with http:// ?

Mine is currently set like this.
Home � Sites � Sites � luckyseven.webfactional.com

Brian O'Connor

unread,
May 4, 2010, 8:16:14 PM5/4/10
to satchm...@googlegroups.com
any luck with this?  I'm seeing this witrh Google Checkout right now.

Thanks

Home › Sites › Sites › luckyseven.webfactional.com


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




--
Brian O'Connor

GuyBrush

unread,
May 4, 2010, 11:08:11 PM5/4/10
to satchm...@googlegroups.com
Some how the problem went away after I switched the site to production
and started accepting real payments.

Brian O'Connor wrote:
> any luck with this? I'm seeing this witrh Google Checkout right now.
>
> Thanks
>
> On Wed, Feb 3, 2010 at 9:05 PM, GuyBrush <guybru...@gmail.com
> <mailto:guybru...@gmail.com>> wrote:
>
> Bruce Kroeze wrote:
>
>
>
> <input type="hidden" name="notify_url"
> value="{{shop.base_url}}{% url PAYPAL_satchmo_checkout-ipn %}" />
>
> OK, now go to a checkout page and see what it is putting in
> for the value. Is it a fully formed URL, with an "http" and
> your domain and everything? If not, bingo, that's your
> problem. Probably you don't have your shop.base_url set
> properly. This gets set by setting the domain on your site object.
>
> Do you mean I need go in the backend and set the site name with
> http:// ?
>
> Mine is currently set like this.
> Home › Sites › Sites › luckyseven.webfactional.com
> <http://luckyseven.webfactional.com>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Satchmo users" group.
> To post to this group, send email to
> satchm...@googlegroups.com
> <mailto:satchm...@googlegroups.com>.
> To unsubscribe from this group, send email to
> satchmo-user...@googlegroups.com
> <mailto:satchmo-users%2Bunsu...@googlegroups.com>.

craig

unread,
Jun 1, 2010, 10:02:14 PM6/1/10
to Satchmo users
I am also running into this issue, except it remains after I've
switched over to production. It looks like the ipn page is being hit
as well, so I'm not sure what to do. Does anyone have any ideas? I
don't want to go modifying code unless I have to.

Craig

unread,
Jun 1, 2010, 11:44:32 PM6/1/10
to Satchmo users
I think I've figure it out.

for item in order.orderitem_set.filter(product__subscriptionproduct__recurring=True, completed=False):
                item.completed = True
                item.save()

There is a dependency on the subscription product module. If it's not enabled, an exception occurs inside of the ipn() function.

I will submit a patch once I've figured out the proper way to check to see if a particular Satchmo module is enabled.


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




--
-co

Tay Ray Chuan

unread,
Jun 2, 2010, 7:44:04 AM6/2/10
to satchm...@googlegroups.com
Hi,

On Wed, Jun 2, 2010 at 11:44 AM, Craig <cjo...@gmail.com> wrote:
> I think I've figure it out.
>
> for item in
> order.orderitem_set.filter(product__subscriptionproduct__recurring=True,
> completed=False):
>                 item.completed = True
>                 item.save()
>
> There is a dependency on the subscription product module. If it's not
> enabled, an exception occurs inside of the ipn() function.

Thanks for spotting that.

> I will submit a patch once I've figured out the proper way to check to see
> if a particular Satchmo module is enabled.

I'll save you the trouble - changeset af294b9fb91f merged in some
improvements to how subscription products are used in the paypal
module.

If you don't mind, please check if this resolves your issue.

--
Cheers,
Ray Chuan

Craig

unread,
Jun 2, 2010, 8:13:27 PM6/2/10
to satchm...@googlegroups.com
Works properly now.

Thanks


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




--
-co

evigmostad

unread,
May 18, 2012, 8:13:39 AM5/18/12
to satchm...@googlegroups.com
Can't seem to get this to work properly.  

In config.py, the default return address is;
StringValue(PAYMENT_GROUP,
    'RETURN_ADDRESS',
    description=_('Return URL'),
    help_text=_('Where Paypal will return the customer after the purchase is complete.  This can be a named url and defaults to the standard checkout success.'),
    default="satchmo_checkout-success"),

Do I need to set it to the IPN url in settings.py?

            u'PAYMENT_PAYPAL': { 
                u'SSL': u'True',
                u'BUSINESS': u'er...@amantiart.com',
                u'BUSINESS_TEST': u'evigm...@nordtechresearch.com',
                u'CURRENCY_CODE': u'USD',
                u'LIVE': True,
                u'POST_URL': u'https://www.paypal.com/cgi-bin/webscr',
#                u'RETURN_ADDRESS': u'satchmo_checkout-ipn',
            },


../modules/paypal/views.py def ipn only gets hit if I un-comment that line and then it doesn't have any data passed to it.  In fact it comes as a GET not POST.

If I don't set it, ipn() is never hit but the base payment/views/checkout.py: def success () does get hit.

I need to modify some other database tables once I know the payment was approved by paypal.   I guess I could look in success() and see if the order was a Paypal order (how?) and do what I need to do in that case.

Any help appreciated.

evigmostad

unread,
May 19, 2012, 7:41:24 AM5/19/12
to satchm...@googlegroups.com
Here is what happens.  When checking out and choosing PayPal, after I enter shipping billing (contact) data and hit 'continue checking out' the screen appears to refresh and stay on the same screen.

I added a number of debug print statements and have found that in payment/views/contact.py

            paymentmodule = config_get_group(modulename)
            url = lookup_url(paymentmodule, 'satchmo_checkout-step2')
            aa.debugPrintErik ("contact_info: url: %s" % url)
            return http.HttpResponseRedirect(url)

Which goes to: ....payment/modules/paypal/views.py:

At this point the request no longer has contact info in the request.  Redirects do not pass on the POST data.  How does this work for anyone?  

def pay_ship_info(request):
    aa.debugPrint ("pay_ship_info: request: %s" % repr (request))
    return payship.base_pay_ship_info(request,
        config_get_group('PAYMENT_PAYPAL'), payship.simple_pay_ship_process_form,
        'shop/checkout/paypal/pay_ship.html')
pay_ship_info = never_cache(pay_ship_info)

This goes to : def base_pay_ship_info

which calls 

def pay_ship_info_verify(request, payment_module):
    """Verify customer and cart.
    Returns:
    True, contact, cart on success
    False, destination of failure
    """
# Verify that the customer exists.
    aa.debugPrint ("pay_ship_info_verify, POST: %s" % repr(request.POST))
    aa.debugPrint ("pay_ship_info_verify, GET: %s" % repr(request.GET))
    aa.debugPrint ("pay_ship_info_verify, payment_module: %s" % payment_module) 
    try:
        contact = Contact.objects.from_request(request, create=False)
    except Contact.DoesNotExist:


At which point there is no contact info.

On Friday, May 18, 2012 7:13:39 AM UTC-5, evigmostad wrote:
Can't seem to get this to work properly.  

In config.py, the default return address is;
StringValue(PAYMENT_GROUP,
    'RETURN_ADDRESS',
    description=_('Return URL'),
    help_text=_('Where Paypal will return the customer after the purchase is complete.  This can be a named url and defaults to the standard checkout success.'),
    default="satchmo_checkout-success"),

Do I need to set it to the IPN url in settings.py?

            u'PAYMENT_PAYPAL': { 
                u'SSL': u'True',
                u'BUSINESS': u'er...@amantiart.com',
                u'BUSINESS_TEST': u'evigmostad@nordtechresearch.com',
                u'BUSINESS_TEST': u'evigmostad@nordtechresearch.com',
                u'BUSINESS_TEST': u'evigmostad@nordtechresearch.com',
                u'CURRENCY_CODE': u'USD',
                u'LIVE': True,
                u'POST_URL': u'https://www.paypal.com/cgi-bin/webscr',
#                u'RETURN_ADDRESS': u'satchmo_checkout-ipn',
            },


../modules/paypal/views.py def ipn only gets hit if I un-comment that line and then it doesn't have any data passed to it.  In fact it comes as a GET not POST.

evigmostad

unread,
May 22, 2012, 9:39:16 AM5/22/12
to satchm...@googlegroups.com
Got this working.  My bad.  I am now taking Paypal payments!


On Tuesday, February 2, 2010 12:24:52 PM UTC-6, Guybrush wrote:

Olivier Lauret

unread,
Aug 9, 2012, 12:52:02 PM8/9/12
to satchm...@googlegroups.com, evigm...@gmail.com
Hello,

Any chance you can share what you did to solve your problem? This could be useful if one of us do the same mistake.

Regards,
Olivier

On 7 August 2012 20:29, Cody Goodman <codygman....@gmail.com> wrote:
Can you share what you did/what was wrong please?


--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/hGnluGQuXB4J.
Reply all
Reply to author
Forward
0 new messages