added shopid master
authorDobrica Pavlinusic <dpavlin@indico.ffzg.hr>
Sun, 31 Jan 2016 23:27:31 +0000 (00:27 +0100)
committerDobrica Pavlinusic <dpavlin@indico.ffzg.hr>
Sun, 31 Jan 2016 23:30:09 +0000 (00:30 +0100)
MaKaC/plugins/EPayment/payWay/epayment.py
MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWay.tpl
MaKaC/plugins/EPayment/payWay/tpls/ConfModifEPaymentPayWayDataModif.tpl
MaKaC/plugins/EPayment/payWay/webinterface/pages/ePayments.py
MaKaC/webinterface/rh/CFADisplay.py

index 0fd4a75..5748bd0 100644 (file)
@@ -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="""<form name="Button" action="%s" method="post" id="%s">
              <input type="hidden" name="pgw_shop_id" value="%s" />
@@ -165,10 +176,10 @@ pgw_email + secret_key +
              <input type="hidden" name="pgw_signature" value="%s" />
 
              </form>""" % (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
 
index 42828cc..c01b91e 100644 (file)
         <td class="dataCaptionTD"><span class="dataCaptionFormat">URL of PayWay</span></td>
         <td bgcolor="white" width="100%" class="blacktext"><pre>${ url }</pre></td>
     </tr>
+    <tr>
+        <td class="dataCaptionTD"><span class="dataCaptionFormat">Shop ID</span></td>
+        <td bgcolor="white" width="100%" class="blacktext"><pre>${ shopid }</pre></td>
+    </tr>
     <tr>
         <td class="dataCaptionTD"><span class="dataCaptionFormat">Private key</span></td>
         <td bgcolor="white" width="100%" class="blacktext"><pre>${ business }</pre></td>
index 889d6e6..f240713 100644 (file)
             <td class="dataCaptionTD"><span class="dataCaptionFormat">URL of PayWay</span></td>
             <td align="left"><input type="text" name="url" size="60" value="${ url }"></td>
         </tr>
+        <tr>
+            <td class="dataCaptionTD"><span class="dataCaptionFormat">Shop ID</span></td>
+            <td align="left"><input type="text" name="shopid" size="60" value="${ shopid }"></td>
+        </tr>
         <tr>
             <td class="dataCaptionTD"><span class="dataCaptionFormat">Private key</span></td>
             <td align="left"><input type="text" name="business" size="60" value="${ business }"></td>
index 379142d..eea714d 100644 (file)
@@ -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 ):
index 844a7b8..a92750d 100644 (file)
@@ -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)))