Hello again,

Thanks everyone for your tips.

I've tried Rob's suggestion with no success and also my existing method
which *did* work under Plone 2.5. I'll post the relevant code up here in
hopes that someone can see something I've obviously done wrong (as
previously mentioned Subscribemember is a remember-based content type).
<code>
configure.zcml
    <subscriber
          for=".interfaces.ISubscribemember
               Products.Archetypes.interfaces.IObjectInitializedEvent"
               handler=".subscribers.makeBuyable"
               />
    <adapter
          for=".interfaces.ISubscribemember"
          provides="getpaid.core.interfaces.IBuyableContent"
          factory=".adapters.BuyableContentAdapter"
      />


adapters.py
class BuyableContentAdapter(object):

    def __init__(self, context):
        self.context = context
        self.price = 1.0
        self.product_code = 'code'
        self.made_payable_by = 'test'

subscribers.py
from zope.interface import alsoProvides
from emerge.isiaqmember.interfaces import ISubscribemember
from Products.PloneGetPaid.interfaces import IBuyableMarker

def makeBuyable(object, event):
    """Adapt the remember objects to the PGP Buyable interface
    """
    
    if not object.isTemporary():
        # Slap on the interfaces
        alsoProvides(object, IBuyableMarker)
        # Update the catalog to ensure it's consistent with
        # the new interface we've just assigned
        object.reindexObject(idxs=['object_provides'])
</code>

Thanks in advance,
Tim

On Wed, 2009-05-06 at 15:40 +0200, Rob M wrote:
> Hello.
> 
> This is actually a fairly simple problem to solve. I'm doing something
> similar for  a client.
> 
> In my case, I've taken signable event and am making it payable on
> creation thus:
> 
>     #
> 
> security.declarePrivate(permissions.EDIT_SIGNUP_PERMISSION,"makePayableOnCreation")
>     def makePayableOnCreation(self,obj,tot):
>        #self.total = tot
>        mark(obj, interfaces.IBuyableMarker)
>        coreInterfaces.IBuyableContent(obj).setProperty('price', tot)
>        coreInterfaces.IBuyableContent(obj).setProperty('product_code',
>        obj.ID)
>     #
> 
> I seem to remember getting the bare bones idea from the link pasted
> below by darryl as well.
> 
> Usable for member creation?
> I had to do this as the event  module  has  multiple payment
> selections and  so we needed to be able to
> add the signable event signup object to the cart immediately after
> creation in an anonymous context.
> 
> One problem I do have with this approach though is that that the
> 'Payable' tab is visible to
> anonymous users because of the use of run_as_manager from within
> signable event.
> 
> Sadly, the project I was working on seems to be stalled at the moment
> so I'm not sure if I'll be going 
> any further with this, but the eventual plan was to adopt a similar
> approach to member signups.
> 
> Hope that helps some..
> 
> Rob M
> 
> Darryl Dixon wrote: 
> > +1 - this is very close to the method I use in
> > getpaid.purchaseablecredits to move content items into the
> > 'published' state on purchase.
> > 
> > 
> > regards,
> > Darryl Dixon
> > Winterhouse Consulting Ltd
> > http://www.winterhouseconsulting.com
> > 
> > On Wed, May 6, 2009 at 3:23 PM, Christopher Johnson
> > <[email protected]> wrote:
> >         Hey Tim,
> >         
> >         Here's an idea...
> >         
> >         Since remember is makes members workflow-able, perhaps you
> >         can leverage the payment-to-trigger-workflow-change process
> >         outlined here:
> >         
> > http://plone.org/products/getpaid/documentation/how-to/how-to-tie-actions-to-payments
> >  (thought this used to be in Products.PloneGetPaid but can't seem to find 
> > it now...)
> >         
> >         Basic idea would be: 
> >         - let user create member object, in a pending state (and
> >         make it automatically buyable)
> >         - give user a link in the pending member object to submit
> >         the object for payment
> >         - upon successful payment, change workflow state on member
> >         object to make it "real" member
> >         
> >         Hope that is helpful. Please keep us posted on how it goes!!
> >         
> >         -c 
> >         
> >         
> >         On Tue, May 5, 2009 at 3:45 PM, Tim Knapp
> >         <[email protected]> wrote:
> >                 
> >                 Hi guys,
> >                 
> >                 I'm currently (again) working on implementing a
> >                 Remember-based solution
> >                 for subscribing members to a Plone site. I have got
> >                 this working as a
> >                 proof-of-concept in a Plone 2.5 site but the
> >                 subscription process is a
> >                 little clumsy. IOW the user registers then goes to
> >                 their user object in
> >                 'portal_memberdata' and then clicks on the 'Add to
> >                 cart' button, then
> >                 the 'Checkout' button and is then redirected offsite
> >                 to the payment
> >                 processors website (in this case PayPal) where they
> >                 pay and are
> >                 redirected back as a 'paid up' user.
> >                 
> >                 What I'd like to implement instead is the following:
> >                     1. Visitor to website clicks on the 'register'
> >                 link.
> >                     2. Visitor is presented with a registration form
> >                 where they fill in
> >                        their details and select what 'membership
> >                 level' they require
> >                        (i.e. Individual, Student, Corporate, etc)
> >                 and whether they
> >                        wanna subscribe for multiple years.
> >                     3. Visitor is then redirected to PayPal site
> >                 where they pay.
> >                     4. They're then redirected back to the Plone
> >                 site as a 'paid up'
> >                        user with access to the various sections of
> >                 the site that their
> >                        membership level allows.
> >                 
> >                 How could I do this in PloneGetPaid? I'm assuming
> >                 I'd need to use some
> >                 kind of event subscriber, which grabs the user data
> >                 and redirects them
> >                 offsite (I want to use PayPal)? Any tips
> >                 appreciated.
> >                 
> >                 Thanks in advance,
> >                 Tim
> >                 
> >                 
> >                 
> >         
> >         
> >         
> >         -- 
> >         
> >         Cofounder and CEO
> >         ifPeople - Innovation for People
> >         www.ifpeople.net
> >         t: 678-608-3408
> >         130 Boulevard NE, #6
> >         Atlanta, GA 30312 
> >         
> >         
> >         
> >         
> > 
> > 
> > 
> 
> -- 
> People are beginning to notice you.  Try dressing before you leave the house.
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to