Hi, I have been working with multiple payment processor support for GetPaid. It is still not finished, but if you want to affect the version 0.1 way of working now is good to speak up :) Also I heard someone else has been working with similar stuff, so this should come public.
IT DOES NOT WORK YET. DO NOT USE IT. READ THE CODE ONLY IF YOU WISH TO DISCUSS ABOUT IT. THINGS ARE UNFINISHED, BROKEN AND UGLY. 1) There is now new package getpaid.paymentprocessors which will have ZCML way of registering payment processor 2) Payment processor consists of following elements: payment method selection button, the actual payment page, settings screen. Because the existing payment processors haven't defined these elements (or there hasn't been mechanism to define them) all payment processors need to be retrofitted with the support. This can be done backwards compatible way. 3) Products.GetPaid checkout wizard has been altered to have a new page: choose payment method. Products.GetPaid depends on getpaid.paymentprocessors. 4) getpaid.nullpayment will be the first payment processor which will receive the support for multiple payment processors What is not done - How payment processors register and show up the actual payment page. I am not sure whether this should be embedded on the checkout review page or be a new page in the checkout wizard. Currently I am facing a dilemma that some payment method specific fields and forms, like credit card number input, are very tighly coupled to getpaid.core and Products.GetPaid. Since they are actually a feature of payment processor, I need to root out them from Products.GetPaid and move to corresponding payment processor (which would be getpaid.nullpayment in this case). What I am not going to do for version 0.1 - Altering the final price based on selected payment processor e.g. charging extra for using PayPal Comments? Finland will have Midsummer Festival - do not expect things happen before July. -Mikko Ps. Here is unfinished README for getpaid.paymentprocessors --- This is initial code for supporting multiple payment processors on getpaid site. Purpose ------- This package provides generic payment processor registration methods. Though the code itself is without Plone dependencies, this documentation covers Plone also. Installation ------------ Install https://getpaid.googlecode.com/svn/getpaid.paymentprocessors/trunk Use branch https://getpaid.googlecode.com/svn/Products.PloneGetPaid/branches/multiplepaymentprocessorsas Products.PloneGetPaid:: cd src rm -rf Products.PloneGetPaid rm -rf getpaid.nullpayment svn co https://getpaid.googlecode.com/svn/Products.PloneGetPaid/branches/multiplepaymentprocessorsProducts.PloneGetPaid svn co https://getpaid.googlecode.com/svn/getpaid.nullpayment/branches/multiplepaymentprocessorsgetpaid.nullpayment Add ''getpaid.paymentprocessers'' egg to your''buildout.cfg''. Add ''getpaid.paymentprocessers'' zcml to your''buildout.cfg''. Architecture ------------ Payment processors are registered using a ZCML directive:: <paymentprocessors:registerProcessor name="Testing Processor" selection_view="null_payment_button" thank_you_view="null_payment_thank_you_page" settings_view="null_payment_settings_page" pay_view="null_payment_pay_page" /> Each view is the view name what is used to render the corresponding part. Those must map to registered <browser:page> objects. To see available directive attributes, please read directives.py / IRegisterPaymentProcessorDirective. Payment processor registry is available in getpaid.paymentprocessors.registry.paymentProcessorRegistry. This registry holds the data of registered payment processor code objects. Active payment processors are determined by Products.PloneGetPaid. Payment processors are described by Entry objects which simply hold the information provided by IRegisterPaymentProcessorDirective. To get active payment processors call:: from Products.PloneGetPaid import payment processors = payment.getActivePaymentProcessors(context) # context = any Plone site object See https://getpaid.googlecode.com/svn/getpaid.nullpayment/branches/multiplepaymentprocessors/src/getpaid/nullpayment/paymentprocessors.zcml for more info. UI drop ins ----------- selection_view ============== This is a <tr> element which is rendered on the checkout payment method selection page. It contains three columns: - <td> having <input type="radio"> button with accessibility <label> - <td> with payment method name/logo image - <td> with description. You can override this template to have clauses like "Using PayPal will cost 2$ extra" There is template context variable "processor" available which refers to registered Entry object of the payment processors. settings_view ============= TODO payment_view ============ TODO thank_you_view ============== TODO Checkout -------- A checkout wizard contains a step "checkout-payment-method" which allows the user to select the wanted payment method. Administration -------------- GetPaid admin interface has page "" where the site manager can enable payment processors and enter to the payment processor settings pages. Each payment processor setting page must be uniquely named. This goes against the prior GetPaid best practice to have just one page. Activated payment processor names are stored in portal_properties as LinesField:: portal_properties.payment_processor_properties.enabled_processors Testing ------- Non-plone related functionality is tested in getpaid.paymentprocessors.tests. This mainly involves testing ZCML validy. Plone related functionality is tested in Products.PloneGetPaid.tests.test_payment_processors. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en -~----------~----~----~----~------~----~------~--~---
