make coinify callback hostname configurable, so we can workaround old openssl in their callback engine
This commit is contained in:
parent
2e13525ad7
commit
974b90676e
|
@ -57,6 +57,7 @@ EPAY_MD5_SECRET='{{ epay_md5_secret }}'
|
||||||
COINIFY_API_KEY='{{ coinify_api_key }}'
|
COINIFY_API_KEY='{{ coinify_api_key }}'
|
||||||
COINIFY_API_SECRET='{{ coinify_api_secret }}'
|
COINIFY_API_SECRET='{{ coinify_api_secret }}'
|
||||||
COINIFY_IPN_SECRET='{{ coinify_ipn_secret }}'
|
COINIFY_IPN_SECRET='{{ coinify_ipn_secret }}'
|
||||||
|
COINIFY_CALLBACK_HOSTNAME='{{ coinify_callback_hostname }}' # leave empty or comment out to use hostname from request
|
||||||
|
|
||||||
# shop settings
|
# shop settings
|
||||||
PDF_LETTERHEAD_FILENAME='{{ pdf_letterhead_filename }}'
|
PDF_LETTERHEAD_FILENAME='{{ pdf_letterhead_filename }}'
|
||||||
|
|
|
@ -144,7 +144,12 @@ class Order(CreatedUpdatedModel):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_coinify_callback_url(self, request):
|
def get_coinify_callback_url(self, request):
|
||||||
return 'https://' + request.get_host() + str(reverse_lazy('shop:coinify_callback', kwargs={'pk': self.pk}))
|
""" Check settings for an alternative COINIFY_CALLBACK_HOSTNAME otherwise use the one from the request """
|
||||||
|
if 'COINIFY_CALLBACK_HOSTNAME' in settings and settings['COINIFY_CALLBACK_HOSTNAME']:
|
||||||
|
host = settings['COINIFY_CALLBACK_HOSTNAME']
|
||||||
|
else:
|
||||||
|
host = request.get_host()
|
||||||
|
return 'https://' + host + str(reverse_lazy('shop:coinify_callback', kwargs={'pk': self.pk}))
|
||||||
|
|
||||||
def get_coinify_thanks_url(self, request):
|
def get_coinify_thanks_url(self, request):
|
||||||
return 'https://' + request.get_host() + str(reverse_lazy('shop:coinify_thanks', kwargs={'pk': self.pk}))
|
return 'https://' + request.get_host() + str(reverse_lazy('shop:coinify_thanks', kwargs={'pk': self.pk}))
|
||||||
|
|
Loading…
Reference in a new issue