On the clientside, how do I listen for external changes on the server?

On the clientside, how do I listen for external changes on the server?

I'm certain this has been asked before so I'm ready for a torrent of downvotes, but I just can't find anything. I don't know if my problem is specific to my situation or there is a general-purpose solution.

I'm certain this has been asked before so I'm ready for a torrent of downvotes, but I just can't find anything. I don't know if my problem is specific to my situation or there is a general-purpose solution.

Basic Outline

I'm setting up a payment process using Wechat QR codes on my website. The user scans the QR code and completes payment via Wechat Pay on their phone.

This means the user physically completes the process on a different platform, completely away from the website.

After completing the payment, the wechat app sends data to the given callback URL (e.g. www.mywebsite.com/Finance/PaymentFinished), where details can be taken from the request headers in the callback.

Via this callback, the server can be updated correctly, thus the payment process is completed and marked on the database.

Problem

My question is, how can I tell the website to keep a connection open and listen for that payment update?

Solution

Is there a specific way to do this, or should I just write some Javascript that repetitively calls the server (via something like www.mywebsite/com/Finance/CheckPaymentComplete?userID=1&productID=123) until it sees a change, and times out if it has to wait too long?

Thanks.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

ASP.NET MVC Application with JQuery, AJAX

Let's have a sample example: We have a submit button in our JQuery AJAX MVC application. Let's try to show a message when it is clicked. ASP.NET MVC Application - Using JQuery, AJAX

Add asp.net Identity in empty project

LIKE | COMMENT | SHARE | SUBSCRIBE Today, in this tutorial you will see the process of adding an ASP.NET Identity to the ASP.NET Web Application developed in...

List all users from asp net core identity

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, i will show you How to retrieve and display all the registered application users in asp.net core using the ...