Merge pull request #5900 from expsa/add_create_registration_param

[IMP] payment_hyperpay_tokenization: logging
This commit is contained in:
abdurrahman-saber 2025-12-31 12:11:04 +04:00 committed by GitHub
commit 252d0ba56c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,7 @@ class HyperPayTokenization(Controller):
@route('/hyperpay/tokens/result', type='http', auth='public', website=True)
def token_return(self, **post):
try:
print('Hyperpay Token Return Post:', post)
acquirer_id = request.env['payment.acquirer'].sudo().search([('id', '=', int(post.get('acquirer_id', 0)))])
if acquirer_id.state == 'test':
@ -101,6 +102,7 @@ class HyperPayTokenization(Controller):
"Authorization": f"Bearer {acquirer_id.hyperpay_authorization}"
}
resp = requests.get(url=url, headers=headers).json()
print('Hyperpay Token Status Response:', resp)
result = resp.get('result', {})
result_code = result.get('code')

View File

@ -34,8 +34,10 @@ class HyperPayTransaction(models.Model):
headers = {
"Authorization": f"Bearer {self.acquirer_id.hyperpay_authorization}"
}
print('Hyperpay S2S Transaction Payload:', payload)
response = requests.post(url, data=payload, headers=headers)
data = response.json()
print('Hyperpay S2S Transaction Response:', data)
return self._hyperpay_s2s_validate_transaction(data)
def _hyperpay_get_s2s_transaction_payload(self, data):