【问题标题】:Payment gateways and Django/Python支付网关和 Django/Python
【发布时间】:2014-04-25 21:13:30
【问题描述】:

感谢大家的帮助,由于我不能透露的原因不得不删除它。

【问题讨论】:

    标签: python django paypal payment gateways


    【解决方案1】:

    首先,与其使用 multiwordReplace,不如将数据渲染到模板中

    t = loader.get_template('myapp/index.html')
    c = Context({'foo': 'bar'})
    t.render(c)
    

    你也应该在 django, forms.py 中定义这些表单:

    class PayPalForm(forms.Form):
        user = forms.HiddenField(required = True)
        currencycode = forms.CharField(required = True)
        cart_total = forms.CharField(required = True)
    

    然后你可以这样做:

    t = loader.get_template('myapp/paypalform.html')
    if site.uses_paypal_condition:
        f = PayPalForm()
    else:
        f = SomeOtherPaymentForm()
    c = Context({'payform': 'f'})
    t.render(c)
    

    【讨论】:

      猜你喜欢
      • 2011-07-26
      • 2020-10-14
      • 2011-02-21
      • 2016-01-19
      • 2016-02-25
      • 2016-06-16
      • 1970-01-01
      • 2010-12-10
      • 2015-10-09
      相关资源
      最近更新 更多