diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index b63cea07..3ef9ce37 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -937,7 +937,7 @@ class BaseClasseCrans(CransLdap): # On dépasse la fin de sanction d'1min pour être sûr qu'elle est périmée. fin = fin + 60 - new_c = '$'.join(map(str, new)) + new_c = u'$'.join(map(unicode, new)) new_c = preattr(new_c)[1] if index != -1: @@ -3351,18 +3351,21 @@ class Facture(BaseClasseCrans): s += art['nombre'] * art['pu'] return s - def urlPaypal(self): + def urlPaypal(self, useSandbox = False, businessMail = "paypal@crans.org"): """ Retourne l'url paypal pour le paiement de cette facture """ - url = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" + if useSandbox: + url = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_cart" + else: + url = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" url += "&upload=1" - url += "&business=paypal@crans.org" + url += "&business=%s" % businessMail url += "¤cy_code=EUR" url += "&no_shipping=1" url += "&no_note=1" - url += "&return=http://factures.crans.org/return" - url += "&cancel_return=http://factures.crans.org/cancel" + url += "&return=http://factures.crans.org/nip.py" + url += "&cancel_return=http://factures.crans.org/nip.py" url += "&invoice="+self.numero() # num de facture item_id = 0