Ciao, On 03/14/2011 10:14 AM, Yuri wrote: > Salve! > > ho "urgenza" di integrare un sito plone con paypal. Dal punto di vista > paypal è tutto ok, manca ovviamente la parte plone. Dovrei configurare > la parte IPN ( Instant Payment Notification ), sostanzialmente la > notifica all'indietro dell'avvenuto pagamento. Nella sostanza, che ci > metto in plone?
di "pronto" c'è questo http://pypi.python.org/pypi/gocept.paypal/ ma mi è sembrato un po' troppo macchinoso per quello che dovevo fare io. io l'ho fatto creando un semplice form per il submit dei dati e un adapter per gestire lo stato della transazione. per l'adapter puoi fare qualcosa del genere: class PayPalNotificationManager(object): implements(IPayPalNotificationManager) def __init__(self, request): self.request = request self.form = request.form @property def status(self): """ returns the status of the PayPal payment """ status = self.form.get('payment_status') # on purchase return paypal send something like this, with nomore "payment_status" WEIRD! # {'item_number': 'xxx', 'tx': '70T61912DS856443C', 'cm': '', # 'cc': 'EUR', 'st': 'Completed', 'amt': '100.00'} if status is None: status = self.form.get('st') return status @property def completed(self): if self.status: return self.status.lower() == 'completed' return False e nella vista che userai per gestire le transazioni potrai fare [...] completed = IPayPalNotificationManager(self.request).completed if completed: # fai quello che vuoi [...] attenzione al commento: nell'IPN la var dello stato è "payment_status" mentre a transazione avvenuta diventa "st" :S su https://developer.paypal.com/ trovi tutta la doc tecnica e puoi registrare degli account di test e inviare delle notifiche IPN di test al tuo plone. _______________________________________________ Plone-IT mailing list Plone-IT@lists.plone.org https://lists.plone.org/mailman/listinfo/plone-it http://plone-regional-forums.221720.n2.nabble.com/Plone-Italy-f221721.html