This commit is contained in:
gsinghpal
2026-03-09 15:21:22 -04:00
parent a3e85a23ef
commit acd3fc455e
243 changed files with 20459 additions and 4197 deletions

View File

@@ -500,11 +500,12 @@ class PoyntPaymentWizard(models.TransientModel):
def _create_payment_transaction(self):
"""Create a payment.transaction linked to the invoice."""
payment_method = self.env['payment.method'].search(
PaymentMethod = self.env['payment.method'].sudo().with_context(active_test=False)
payment_method = PaymentMethod.search(
[('code', '=', 'card')], limit=1,
)
if not payment_method:
payment_method = self.env['payment.method'].search(
payment_method = PaymentMethod.search(
[('code', 'in', ('visa', 'mastercard'))], limit=1,
)
if not payment_method:

View File

@@ -483,9 +483,10 @@ class PoyntRefundWizard(models.TransientModel):
def _create_refund_transaction(self, orig_tx, refund_txn_id, refund_status):
"""Create a payment.transaction for the refund."""
payment_method = self.env['payment.method'].search(
PaymentMethod = self.env['payment.method'].sudo().with_context(active_test=False)
payment_method = PaymentMethod.search(
[('code', '=', 'card')], limit=1,
) or self.env['payment.method'].search(
) or PaymentMethod.search(
[('code', 'in', ('visa', 'mastercard'))], limit=1,
)