Closed eve-git closed 5 days ago
The payment method in the OPS ticket is DIRECT_PAY. I tested this in the DEV environment by creating and immediately refunding an NR, and no issues occurred. Since the issue happened in June and no similar problems have been reported over the past three months, I believe it was a random occurrence, and the ticket can be closed.
No code changes applied.
A user canceled the NR immediately after creating it. The
NR requests.state_cd
is set toREFUND_REQUESTED
, but theinvoices.invoice_status_code
remainsPAID
, and the payment has not been refunded.From the code, the payment won't be refund if the status not in valid_states = [ PaymentState.APPROVED.value, PaymentState.COMPLETED.value, PaymentState.PARTIAL.value ] https://github.com/bcgov/namex/blob/main/api/namex/resources/name_requests/name_request.py#L383
Why valid_states does not include 'PAID'?
Reference to: https://sbc-registries.atlassian.net/browse/ITOPS-123329