kapilt / getpaid

Automatically exported from code.google.com/p/getpaid
0 stars 0 forks source link

no more passed_fields #243

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Ogone overrides method for the checkout in  its class
OgoneCheckoutPayment(CkeckoutReviewAndPay)
    ....
    def setUpWidgets( self, ignore_request=False ):
        self.adapters = self.adapters is not None and self.adapters or {}

        # display widgets for bill/ship address
        self.widgets = form.setUpEditWidgets(
            self.passed_fields,  self.prefix, self.context, self.request,
            adapters=self.adapters, for_display=True,
ignore_request=ignore_request
            )
but in PloneGetPaid 0.7.5 there is no more passed_fields

Original issue reported on code.google.com by danielle...@gmail.com on 8 Apr 2009 at 1:58

GoogleCodeExporter commented 8 years ago
I've just removed setUpWidgets ... and was able to send my first order to Ogone

Original comment by danielle...@gmail.com on 15 Apr 2009 at 8:56

GoogleCodeExporter commented 8 years ago
in the mean time, we can create a separate product to correct some issues.
in the buildout no slugs for ogone, but an overrides.zcml for the new product
starting with
 <configure
      xmlns="http://namespaces.zope.org/zope"
      xmlns:five="http://namespaces.zope.org/five"
      xmlns:browser="http://namespaces.zope.org/browser"
      xmlns:plone="http://namespaces.plone.org/plone"
      xmlns:zcml="http://namespaces.zope.org/zcml">

     <!--useful zcml for prefix includeOverrides-->

 <!-- issue 243 -->
 <includeOverrides package="Products.PloneGetPaid"/>     
  <browser:page
     for="*"
     name="checkout-review-pay"
     class=".browser.checkout.OgoneCheckoutPayment"
     permission="zope2.View"
     />
in browser a checkout.py containing

from Products.CMFCore.utils import getToolByName
from Products.PloneGetPaid.browser.checkout import CheckoutReviewAndPay
from getpaid.core.order  import Order
from getpaid.core import interfaces
from Products.PloneGetPaid.interfaces import IGetPaidManagementOptions
from zope.component import getAdapter
from zope.formlib import form
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile

class OgoneCheckoutPayment(CheckoutReviewAndPay):
     """
     We need to override some of the method for the checkout
     as the checkout process is different for ogone
     create an order, and submit to the processor
     no credit card
     """
     # with the newer  CheckoutReviewAndPay of Products.PloneGetPaid.browser.checkout 
     @form.action(u"Make Payment", name="make-payment")
     def makePayment(self, action, data):
         """ create an order, and submit to the processor
         """
         siteroot = getToolByName(self.context, "portal_url").getPortalObject()
         manage_options = IGetPaidManagementOptions(siteroot)
         processor_name = manage_options.payment_processor

         if not processor_name:
             raise RuntimeError( "No Payment Processor Specified" )

         processor = component.getAdapter( siteroot,
                                           interfaces.IPaymentProcessor,
                                           processor_name )

         adapters = self.wizard.data_manager.adapters

         order = self.createOrder()
         order.processor_id = processor_name

Original comment by danielle...@gmail.com on 18 Dec 2010 at 4:06