Merge pull request #5882 from expsa/add_hyperpay_params

[IMP] payment_hyperpay_tokenization: add missing params
This commit is contained in:
abdurrahman-saber 2025-12-30 13:08:57 +04:00 committed by GitHub
commit 67ecd4d6db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -50,6 +50,8 @@ class HyperPayTransaction(models.Model):
"paymentType": "DB",
'standingInstruction.mode': 'INITIAL',
'standingInstruction.source': 'CIT',
'standingInstruction.recurringType': 'STANDING_ORDER',
'customParameters[paymentFrequency]': 'OTHER',
'standingInstruction.type': 'UNSCHEDULED',
'shopperResultUrl': f'{base_url}hyperpay/tokens/result?transaction_id={self.id}',
'notificationUrl': f'{base_url}hyperpay/tokens/result?transaction_id={self.id}',
@ -73,6 +75,7 @@ class HyperPayTransaction(models.Model):
'standingInstruction.source': 'MIT',
'standingInstruction.initialTransactionId': self.payment_token_id.hyperpay_initial_transaction_id
})
payload.pop('customParameters[paymentFrequency]', None)
return payload
def hyperpay_s2s_do_refund(self, **kwargs):
@ -119,7 +122,7 @@ class HyperPayTransaction(models.Model):
if self.type == 'validation' and not self.payment_token_id.verified:
self.payment_token_id.write({
'verified': True,
'hyperpay_initial_transaction_id': data.get('id', '')
'hyperpay_initial_transaction_id': data.get('CardholderInitiatedTransactionID', '')
})
self.payment_token_id.verified = True
self._set_transaction_done()