Package: collective.pfg.payment
IntroductionThis package is inteded to integrate html payment form which happens outside of Plone
as easy as possible by using forms and adapters generated by PloneFormGen.Currently tested withPlone-4.3Products.PloneFormGen-1.7.8Example use caseOn Plone site, input some price amount on form.Confirm the amount and go to payment page outside of Plone.Process the payment.Go back to Plone site.General SetupOnce the package is quickinstalled, you need to configure  authentication code calculation fromSite Setup>>Payment ConfigMAC CodeThis code is provided by payment provider.FieldsInput field names which will be used for the calculation line by line.SeparatorInput separator between field values if necessary.CapitalCheck this if calculated authentication code need to be upper cases.You may configure payment settings locally to Form Folders.Tested HTML Interfaces and their configurationsVerkkomakust S1 (Finland)MAC Code6pKF4jkv97zmqBJ3ZL8gUw5DfT2NMQFieldsMERCHANT_IDAMOUNTORDER_NUMBERREFERENCE_NUMBERORDER_DESCRIPTIONCURRENCYRETURN_ADDRESSCANCEL_ADDRESSPENDING_ADDRESSNOTIFY_ADDRESSTYPECULTUREPRESELECTED_METHODMODEVISIBLE_METHODSGROUPSeparator| (Vertical bar)CapitalCheckedExample use caseCreate Form where payment process starts: FormFolder1Edit>>Overrides>>Custom Success Actiontraverse_to:string:formfolder2formfolder2 is the next form where the confirmation happens.AddDecimal Fieldwith id namedAMOUNT.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.Create another Form: FormFolder2Edit>>Overrides>>Custom Form Actionhttps://payment.verkkomaksut.fi/View>>Actions>>Make Order Number AwareChange the numbering behavior if necessary.Here you may set the payment configuration locally. This will overrides global configuration.Add all of the next fields withString Field.MERCHANT_IDAMOUNTORDER_NUMBERREFERENCE_NUMBERORDER_DESCRIPTIONCURRENCYRETURN_ADDRESSCANCEL_ADDRESSPENDING_ADDRESSNOTIFY_ADDRESSTYPECULTUREPRESELECTED_METHODMODEVISIBLE_METHODSGROUPAUTHCODEThe field ids must be upper cases.These fields below needs to be configuredMERCHANT_IDEdit>>Default13466ORDER_NUMBEREdit>>Overrides>>Default Expressionpython:here.restrictedTraverse(‘number’)()CURRENCYEdit>>DefaultEURRETURN_ADDRESSEdit>>Overrides>>Default Expressionstring:${portal_url}/formfolder3/thank-you/@@payment-succeededAssuming 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_ADDRESSEdit>>Overrides>>Default Expressionstring:${portal_url}/formfolder1Assuming that FormFolder1 is created under plone root.NOTIFY_ADDRESSEdit>>Overrides>>Default Expressionstring:${portal_url}TYPEEdit>>DefaultS1CULTUREEdit>>Defaultfi_FIMODEEdit>>Default1AUTHCODEEdit>>Overrides>>Default Expressionpython:here.restrictedTraverse(‘auth-code’)Create another Form: FormFolder3In case e-mails need to be sent and field values displayed after the successful payment.We use thank-you page automatically created under 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.Changelog0.6 (2013-05-06)Moved test packages to extras_require. [taito]Tested with Plone-4.3. [taito]0.5 (2013-01-06)Tested with Plone-4.2.3 and Products.PloneFormGen-1.7.6. [taito]Added testing integration to Travis CI. [taito]0.4 (2012-11-14)Tested with Plone-4.2.2 and Products.PloneFormGen-1.7.4. [taito]0.3.2 (2012-09-25)Updated version in metadata.xml. [taito]0.3.1 (2012-09-24)Fixed action: make_order_number_aware. [taito]0.3 (2012-09-17)Tested with Plone-4.2.1. [taito]0.2.0 (2011-04-16)Added local payment configuration for multiple payment processors.0.1.1 (2011-04-15)Capital check fixed to be updated in Payment Config page.0.1.0 (2011-04-15)Initial releaseInstallationUse zc.buildout and the plone.recipe.zope2instance
recipe to manage packages:Addcollective.pfg.paymentto the list of eggs to install, e.g.:[buildout]
...
eggs =
    ...
    collective.pfg.paymentRe-run buildout, e.g. with:$ ./bin/buildoutCreditsFinnish Association for Nature Conservation (Suomen Luonnonsuojeluliitto) who uses this package in their site:http://www.sll.fi