Some Perplexity of PHP Wechat Development calling JSAPI

the picture above shows the scene of Wechat JSAPI payment

Business process is

  1. place an order uniformly
  2. Page JSAPI WeixinJSBridge.invoke initiates payment

I have a problem. I need to enter the amount and then issue the order uniformly.
after the API for issuing an order returns the correct parameters,
can I go 2 to initiate payment through JSAPI

.

how to integrate the two-step operation into one button (recharge immediately)

I use PHP to initiate a unified order request. After that, how do I tell the page to call JSAPI (WeixinJSBridge.invoke)

Php
May.27,2022

after entering the amount, use ajax to initiate the request with the amount parameter, and the backend issues the order uniformly.
ajax initiates JSAPI payment based on the result of issuing the order, or an error prompt


does it require openid to place the order? which step did you get your openid?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40984-2c531.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40984-2c531.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?