From: Dobrica Pavlinusic Date: Sun, 31 Jan 2016 23:27:31 +0000 (+0100) Subject: added shopid X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;ds=inline;h=038b54c0dd5dfa86d55374570831a7005e5d463c;p=indico-PayWay added shopid --- diff --git a/MaKaC/plugins/EPayment/payWay/epayment.py b/MaKaC/plugins/EPayment/payWay/epayment.py index 0fd4a75..5748bd0 100644 --- a/MaKaC/plugins/EPayment/payWay/epayment.py +++ b/MaKaC/plugins/EPayment/payWay/epayment.py @@ -35,7 +35,8 @@ class PayWayMod(BaseEPayMod): self._title = "payway" self._url="https://pgwtest.ht.hr/services/payment/api/authorize-form" - self._business= "please fill in private key here" + self._business="please fill in private key here" + self._shopid="please fill in shop id here" if data is not None: setValue(data) @@ -55,6 +56,7 @@ class PayWayMod(BaseEPayMod): self.setTitle(data.get("title", "epayment")) self.setUrl(data.get("url", "")) self.setBusiness(data["business"]) + self.setShopID(data["shopid"]) def getUrl(self): return self._url @@ -66,6 +68,15 @@ class PayWayMod(BaseEPayMod): def setBusiness(self,business): self._business= business + def getShopID(self): + if hasattr(self, '_shopid'): + return self._shopid + else: + self._shopid = "please fill in shop id" + return self._shopid + def setShopID(self,shopid): + self._shopid= shopid + def strip_accents(self,text): """ Strip accents from input String. @@ -87,9 +98,9 @@ class PayWayMod(BaseEPayMod): def getFormHTML(self,prix,Currency,conf,registrant,lang = "en_GB", secure=False): - pgw_shop_id=str(20000573) - pgw_order_id=str(registrant.getId()) - pgw_amount=str(int(prix * 100)) + pgw_shop_id=str(self._shopid) + pgw_order_id=str(registrant.getId()) + pgw_amount=str(int(prix * 100)) pgw_success_url=str(localUrlHandlers.UHPayConfirmPayWay.getURL(registrant)) pgw_failure_url=str(localUrlHandlers.UHPayCancelPayWay.getURL(registrant)) @@ -98,11 +109,11 @@ class PayWayMod(BaseEPayMod): pgw_first_name=self.strip_accents(registrant.getFirstName()) pgw_last_name=self.strip_accents(registrant.getSurName()) - pgw_telephone=registrant.getPhone() - pgw_email=registrant.getEmail() + pgw_telephone=registrant.getPhone() + pgw_email=registrant.getEmail() - secret_key=self.getBusiness() - pgw_signature= \ + secret_key=self.getBusiness() + pgw_signature= \ 'authorize-form' + secret_key + \ pgw_shop_id + secret_key + \ pgw_order_id + secret_key + \ @@ -116,7 +127,7 @@ pgw_last_name + secret_key + \ pgw_telephone + secret_key + \ pgw_email + secret_key - """ + """ gnature = SHA512 ( naziv_metode + secret_key + pgw_shop_id + secret_key + @@ -143,7 +154,7 @@ pgw_email + secret_key + #pgw_merchant_data + secret_key """ - pgw_signature=hashlib.sha512(pgw_signature).hexdigest() + pgw_signature=hashlib.sha512(pgw_signature).hexdigest() s="""
@@ -165,10 +176,10 @@ pgw_email + secret_key +
""" % (self.getUrl(), self.getId(), \ - pgw_shop_id, pgw_order_id, pgw_amount, \ - pgw_success_url, pgw_failure_url, \ - pgw_first_name, pgw_last_name, pgw_telephone, pgw_email, \ - pgw_signature) + pgw_shop_id, pgw_order_id, pgw_amount, \ + pgw_success_url, pgw_failure_url, \ + pgw_first_name, pgw_last_name, pgw_telephone, pgw_email, \ + pgw_signature) return s diff --git a/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWay.tpl b/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWay.tpl index 42828cc..c01b91e 100644 --- a/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWay.tpl +++ b/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWay.tpl @@ -12,6 +12,10 @@ URL of PayWay
${ url }
+ + Shop ID +
${ shopid }
+ Private key
${ business }
diff --git a/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWayDataModif.tpl b/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWayDataModif.tpl index 889d6e6..f240713 100644 --- a/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWayDataModif.tpl +++ b/MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWayDataModif.tpl @@ -11,6 +11,10 @@ URL of PayWay + + Shop ID + + Private key diff --git a/MaKaC/plugins/EPayment/payWay/webinterface/pages/ePayments.py b/MaKaC/plugins/EPayment/payWay/webinterface/pages/ePayments.py index 379142d..eea714d 100644 --- a/MaKaC/plugins/EPayment/payWay/webinterface/pages/ePayments.py +++ b/MaKaC/plugins/EPayment/payWay/webinterface/pages/ePayments.py @@ -79,6 +79,7 @@ class WConfModifEPaymentPayWay( WTemplated ): vars["title"] = modPayWay.getTitle() vars["url"] = modPayWay.getUrl() vars["business"] = modPayWay.getBusiness() + vars["shopid"] = modPayWay.getShopID() return vars class WPConfModifEPaymentPayWayDataModif( WPConfModifEPaymentPayWayBase ): @@ -100,6 +101,7 @@ class WConfModifEPaymentPayWayDataModif( WTemplated ): vars["title"] = modPayWay.getTitle() vars["url"] = modPayWay.getUrl() vars["business"] = modPayWay.getBusiness() + vars["shopid"] = modPayWay.getShopID() return vars class WPconfirmEPaymentPayWay( conferences.WPConferenceDefaultDisplayBase ): diff --git a/MaKaC/webinterface/rh/CFADisplay.py b/MaKaC/webinterface/rh/CFADisplay.py index 844a7b8..a92750d 100644 --- a/MaKaC/webinterface/rh/CFADisplay.py +++ b/MaKaC/webinterface/rh/CFADisplay.py @@ -147,7 +147,7 @@ class _AbstractSubmissionNotification: tw = TextWrapper() msg = [i18nformat("""_("Dear") %s,""") % self._abstract.getSubmitter().getStraightFullName()] msg.append("") - msg.append(tw.fill(_("The submission of your abstract has been successfully processed."))) + msg.append(tw.fill(_("The submission of your abstract has been successfully processed!"))) msg.append("") tw.break_long_words = False msg.append(tw.fill(i18nformat("""_("Abstract submitted"):\n<%s>.""") % urlHandlers.UHUserAbstracts.getURL(self._conf)))