Alipay's mobile website payment contract product has matching example codes, and you can check it with Baidu.
Basically, complete the parameter configuration to initiate payment, and then after the user completes the payment, call back your own payment successful processing business (asynchronously) through Alipay, or the user presses the completion button to call back your own payment. Process successful business (synchronization).