After the PHP Alipay interface is successfully connected, I find that when paying, it will jump to a page with a confirm button. This greatly affects the user experience. How to solve it?
Check the code and find that alipayapi.php has such a code:
<ol> <li value="1"> <span>$alipaySubmit </span><span>=</span><span></span><span>new</span><span></span><span>AlipaySubmit</span><span>(</span><span>$alipay_config</span><span>);</span> </li> <li> <span>$html_text </span><span>=</span><span> $alipaySubmit</span><span>-></span><span>buildRequestForm</span><span>(</span><span>$parameter</span><span>,</span><span>"post"</span><span>,</span><span></span><span>"确认"</span><span>);</span> </li> <li> <span>echo $html_text</span><span>;</span> </li> </ol>
The 'OK' button is returned by buildRequestForm. Find the place where this method is defined:
lib/alipay_submit.class.php
Modify
<ol><li value="1"> <span>$sHtml </span><span>=</span><span> $sHtml</span><span>.</span><span>"<input type='submit' value='"</span><span>.</span><span>$button_name</span><span>.</span><span>"'></form>"</span><span>;</span> </li></ol>
in the method Just change it to
<ol><li value="1"> <span>$sHtml </span><span>=</span><span> $sHtml</span><span>.</span><span>"</form>"</span><span>;</span><span></span> </li></ol>
or change it to
<ol><li value="1"> <span>$sHtml </span><span>=</span><span> $sHtml</span><span>.</span><span>"<input type='submit' value='"</span><span>.</span><span>$button_name</span><span>.</span><span>"'></form>"</span><span>;</span> </li></ol>
I have connected Alipay to my blog very early: www.webyang.net/Index/alipay. I have never cared about this problem ~ I solved it today.
Original text: www.webyang.net/Html/web/article_156.html
Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above has introduced the solution to the problem that the PHP Alipay interface will jump to a confirmation button page when paying, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.