page de retour paypal

darcs-hash:20061007112422-f46e9-cd3ab12eb69267ed9e7aa58c45eca09051d8daec.gz
This commit is contained in:
gdetrez 2006-10-07 13:24:22 +02:00
parent d9b34571ee
commit a12c770ca5
2 changed files with 27 additions and 9 deletions

View file

@ -40,7 +40,10 @@ class root:
} for art in f.articles()]
facture['montant'] = f.total()
facture['paypal'] = f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False),
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"))
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"),
return_page = "https://intranet.crans.org/monCompte/paypalReturn",
cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel",
)
facture['payee'] = f.recuPaiement()
listeFactures.append(facture)

View file

@ -192,11 +192,14 @@ class monCompte:
combien = float(combien)
# arrondissage-tronquage :
combien = float(int(combien*100)/100.0)
# nombre positif
if combien < 0:
raise ValueError
except Exception:
return {
'template' :'MonCompteRechargePaypal2',
'standalone' :True,
'values' :{'error':"Le montant doit &ecirc;tre un nombre !", 'combien':combien},
'values' :{'error':"Le montant doit &ecirc;tre un nombre positif !", 'combien':combien},
}
f.ajoute({'nombre': 1, 'code': 'SOLDE', 'designation': 'Credit du compte impression (intranet)', 'pu': combien})
cherrypy.session['freshFacture'] = f
@ -222,16 +225,28 @@ class monCompte:
'template' :'MonCompteRechargePaypal4',
'standalone' :True,
'values' :{'lienPaypal' : f.urlPaypal(useSandbox = cherrypy.config.get("paypal.useSandbox", False),
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"))},
businessMail = cherrypy.config.get("paypal.businessAdress", "paypal@crans.org"),
return_page = "https://intranet.crans.org/monCompte/paypalReturn",
cancel_return_page = "https://intranet.crans.org/monCompte/paypalCancel",
)},
}
rechargerCompteImpression.exposed = True
def paypalReturn(self):
return {
'template' :'MonComptePaypalReturn',
'standalone' :True,
'values' :{},
}
paypalReturn.exposed = True
def paypalCancel(self):
return {
'template' :'MonComptePaypalCancel',
'standalone' :True,
'values' :{},
}
paypalCancel.exposed = True