1. Kai Diefenbach
  2. django-lfs
  3. Issues
Issue #206 new

paypal products list is shop-owner's name

Anonymous created an issue

hi everybody

I'm a newbee and still succeded to install and modify LFS to my customer's needs : I love it except I have a couple of minor bugs.

What is happening is that paypal receives the shop-owner's name as product list instead of the actual products list ; I can use it for now but would like to resolve it quickly as we need to be ready if we have to refund a product.

Anyone has some ideas? Don't hesitate if you need details : you can see the site at belrebel.webfactional.com (and yes, it's in quebec french).

thanks Guillaume

Comments (1)

  1. altermontrealist

    found a way to fix this : you can check on your side if it does the job.

    it's all done in /lfs-installer/eggs/django_lfs-0.7.7-py2.7.egg/lfs/payment/utils.py, in get_paypal_link_for_order class

    my version of def get_paypal_link_for_order is :

    def get_paypal_link_for_order(order):
        """
        Creates paypal link for given order.
        """
        shop = lfs_get_object_or_404(Shop, pk=1)
        current_site = Site.objects.get(id=settings.SITE_ID)
        conv = locale.localeconv()
        default_currency = conv['int_curr_symbol']
    
    #initial paypal dictionary
        info = {
            "cmd": "_cart",
            "upload": "1",
            "business": settings.PAYPAL_RECEIVER_EMAIL,
            "currency_code": default_currency,
            "notify_url": "http://" + current_site.domain + reverse('paypal-ipn'),
            "return": "http://" + current_site.domain + reverse('paypal-pdt'),
            "first_name": order.invoice_firstname,
            "last_name": order.invoice_lastname,
            "address1": order.invoice_line1,
            "address2": order.invoice_line2,
            "city": order.invoice_city,
            "state": order.invoice_state,
            "zip": order.invoice_code,
            "no_shipping": "1",
            "custom": order.uuid,
            "invoice": order.uuid,
            "shipping_1": order.shipping_price,
            "shipping_method":"postes canada",
        }
    
    #add products to dictionary
        index_item=0
        for order_item in order.items.all():
            item = order.items.all().order_by('id')[index_item]
            index_item+=1
            info["item_name_%i" % index_item] = "%s" % item.product_name
            info["amount_%i" % index_item] = "%.2f" % item.product_price_net
            info["quantity_%i" % index_item] = "%i" % item.product_amount
            info["tax_%i" % index_item] = "%.2f" % item.product_tax
    
    
    #format dictionary for paypal
        parameters = "&".join(["%s=%s" % (k, v) for (k, v) in info.items()])
        if getattr(settings, 'PAYPAL_DEBUG', settings.DEBUG):
            url = SANDBOX_POSTBACK_ENDPOINT + "?" + parameters
        else:
            url = POSTBACK_ENDPOINT + "?" + parameters
    
        return url
    

    hope that can contribute to django-lfs Guillaume

  2. Log in to comment