支付网关和Django / Python

时间:2014-03-19 14:27:47

标签: python django paypal payment gateways

感谢帮助人们,因为我无法透露而不得不删除此内容。

1 个答案:

答案 0 :(得分:0)

首先,不是使用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)