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)
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
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.
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))
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 + \
pgw_telephone + secret_key + \
pgw_email + secret_key
- """
+ """
gnature = SHA512 (
naziv_metode + secret_key +
pgw_shop_id + 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" />
<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