django-paypal中的多个项目 [英] Multiple Items in django-paypal

查看:116
本文介绍了django-paypal中的多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用dcramer的django-paypal版本(但我认为它不管是dcramer还是johnboxall)。



1)我如何指定多个项目在我的paypal_dict(用于PayPalPaymentsForm)?
2)另外,我需要适当地指定Paypal屏幕中出现的摘要中的运输成本和个人数量,我该怎么做?

解决方案

我不喜欢django-paypal。只需阅读PayPal API: https://www.paypal .com / cgi-bin / webscr?cmd = p / pdn / howto_checkout-outside



将您购物车中的所有项目推送到PayPal: / p>

 < form action =https://www.paypal.com/cgi-bin/webscrmethod =post > 
< input type =hiddenname =cmdvalue =_ cart>
< input type =hiddenname =uploadvalue =1>
< input type =hiddenname =businessvalue =you@youremail.com>
< input type =hiddenname =currency_codevalue =EUR>

<! - 运行for循环 - >
{%for cart in cart%}
< input type =hiddenname =item_name_1value =项目名称1>
< input type =hiddenname =amount_1value =10.00>
< input type =hiddenname =item_name_2value =项目名称2>
< input type =hiddenname =amount_2value =20.00>



< input type =hiddenname =item_name_Nvalue =项目名称N>
< input type =hiddenname =amount_Nvalue =30.00>
{%endfor%}

< input type =imagesrc =http://www.paypal.com/en_US/i/btn/x-click-but01。 gifname =submitalt =使用PayPal进行付款 - 它的快速,自由和安全!>
< / form>


I am using dcramer's version of django-paypal(but i think it shouldnt matter whether it is dcramer or johnboxall's).

1) How can i specify multiple items in my paypal_dict(to be used in PayPalPaymentsForm)? 2) Also, i need to suitably specify the shipping cost and the individual quantities in the Summary that appears in the Paypal screen - how do i do this?

解决方案

I'm not fond of django-paypal. Just read the PayPal api: https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside.

To push all the items in your cart to PayPal:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_cart">
        <input type="hidden" name="upload" value="1">
        <input type="hidden" name="business" value="you@youremail.com">
        <input type="hidden" name="currency_code" value="EUR">

        <!-- Run a for loop -->
        {% for item in cart %}
        <input type="hidden" name="item_name_1" value="Item Name 1">
        <input type="hidden" name="amount_1" value="10.00">
        <input type="hidden" name="item_name_2" value="Item Name 2">
        <input type="hidden" name="amount_2" value="20.00">
        .
        .
        .
        <input type="hidden" name="item_name_N" value="Item Name N">
        <input type="hidden" name="amount_N" value="30.00">
        {% endfor %}

        <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

这篇关于django-paypal中的多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆