将ploneformgen扩展到付款表单。
collective.pfg.payment的Python项目详细描述
简介
这个包是集成了发生在plone之外的html支付表单的。 使用ploneformgen生成的表单和适配器尽可能简单。
目前测试
- 扑通一声-4.3
- 产品.ploneformgen-1.7.8
示例用例
- 在plone站点,在表单上输入一些价格金额。
- 确认金额并转到付款页面外的plone。
- 处理付款。
- 回到plone站点。
一般设置
快速安装包后,需要从site setup>;payment config
- mac代码
- 此代码由支付提供商提供。
- 字段
- 输入用于逐行计算的字段名。
- 分隔符
- 如有必要,在字段值之间输入分隔符。
- capital
- 如果计算的验证代码需要大写,请选中此项。
您可以在本地配置付款设置以形成文件夹。
测试的HTML接口及其配置
Verkkomakust S1(芬兰)
- mac代码
- 6pkf4jkv97zmqbj3zl8guw5dft2nmq
字段
MERCHANT_ID
AMOUNT
ORDER_NUMBER
REFERENCE_NUMBER
ORDER_DESCRIPTION
CURRENCY
RETURN_ADDRESS
CANCEL_ADDRESS
PENDING_ADDRESS
NOTIFY_ADDRESS
TYPE
CULTURE
PRESELECTED_METHOD
MODE
VISIBLE_METHODS
GROUP
- 分隔符
- (垂直条)
- capital
- 选中
示例用例
创建付款流程开始的表单:formfolder1
Edit >> Overrides >> Custom Success Action
traverse_to:string:formfolder2
- formfolder2是下一个确认发生的表单。
添加名为amount的decimal字段。
Plone automatically set id from title, but with lower cases. To set id upper cases, you may need to change it, for example from Contents tab.
Optionally if you want to send email or show results after the successful payment, add Custom Script Adapter here and describe to script body something like:
items = dict( AMOUNT=request.form["AMOUNT"], topic=request.form["topic"] ) request.SESSION.set("collective.pfg.payment", items)
This means that AMOUNT and topic fields are stored in session and can be displayed after the successful payment.
创建另一个表单:formfolder2
Edit >> Overrides >> Custom Form Action
view>;actions>;make order number aware
Change the numbering behavior if necessary.
Here you may set the payment configuration locally. This will overrides global configuration.
使用string field添加所有下一个字段。
MERCHANT_ID
AMOUNT
ORDER_NUMBER
REFERENCE_NUMBER
ORDER_DESCRIPTION
CURRENCY
RETURN_ADDRESS
CANCEL_ADDRESS
PENDING_ADDRESS
NOTIFY_ADDRESS
TYPE
CULTURE
PRESELECTED_METHOD
MODE
VISIBLE_METHODS
GROUP
AUTHCODE
字段ID必须是大写。
需要配置下面的这些字段
- MERCHANT_ID
- Edit >> Default
13466
- ORDER_NUMBER
- Edit >> Overrides >> Default Expression
python:here.restrictedTraverse(‘number’)()
- CURRENCY
- Edit >> Default
EUR
- RETURN_ADDRESS
- Edit >> Overrides >> Default Expression
string:${portal_url}/formfolder3/thank-you/@@payment-succeeded
- Assuming that FormFolder3 will be created under plone root.
- If field values are not necessary to be sent by e-mail or displayed after successful payment, you can give different address here and FormFolder3 is not necessary.
- CANCEL_ADDRESS
- Edit >> Overrides >> Default Expression
string:${portal_url}/formfolder1
- Assuming that FormFolder1 is created under plone root.
- NOTIFY_ADDRESS
- Edit >> Overrides >> Default Expression
string:${portal_url}
- TYPE
- Edit >> Default
S1
- CULTURE
- Edit >> Default
fi_FI
- MODE
- Edit >> Default
1
- AUTHCODE
- Edit >> Overrides >> Default Expression
python:here.restrictedTraverse(‘auth-code’)
- 创建另一个表单:formfolder3
如果需要发送电子邮件并在成功付款后显示字段值。
我们使用在FormFolder3下自动创建的感谢页。
To show the field values, you need to add or copy the original field which were in FormFolder1 to this FormFolder.
- The type of field need to be the same as the original one.
- For example, if you want to show topic and AMOUNT, String Field with id topic and Decimal Number Field with id AMOUNT need to be added under FormFolder3.
更改日志
0.6(2013-05-06)
- 已将测试包移动到所需的附加项。[泰托]
- 用plone-4.3测试。[泰托]
0.5(2013-01-06)
- 用plone-4.2.3和products.ploneformgen-1.7.6测试。[泰托]
- 向Travis CI添加了测试集成。[泰托]
0.4(2012-11-14)
- 用plone-4.2.2和products.ploneformgen-1.7.4测试。[泰托]
0.3.2(2012-09-25)
- metadata.xml中的更新版本。[泰托]
0.3.1(2012-09-24)
- 固定动作:让订单号知道。[泰托]
0.3(2012-09-17)
- 用plone-4.2.1测试。[泰托]
0.2.0(2011-04-16)
- 为多个支付处理器添加了本地支付配置。
0.1.1(2011-04-15)
- 固定资本支票将在支付配置页中更新。
0.1.0(2011-04-15)
- 初始版本
安装
使用zc.buildout和plone.recipe.zope2instance 管理软件包的方法:
添加^{TT1}$到要安装的鸡蛋列表,例如:
[buildout] ... eggs = ... collective.pfg.payment
重新运行构建,例如使用:
$ ./bin/buildout
学分
- 芬兰自然保护协会(Suomen Luonsonsuojelulitto)在其网站上使用此软件包:http://www.sll.fi