bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 58 forks source link

Investigate: User cancelled an NR, but the payment hasn't been refunded. #22532

Closed eve-git closed 5 days ago

eve-git commented 1 month ago

A user canceled the NR immediately after creating it. The NR requests.state_cd is set to REFUND_REQUESTED, but the invoices.invoice_status_code remains PAID, 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

eve-git commented 6 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.

Mihai-QuickSilverDev commented 5 days ago