Home > Backend Development > PHP Tutorial > Solve the problem that when paying through the PHP Alipay interface, it will jump to a confirmation button page

Solve the problem that when paying through the PHP Alipay interface, it will jump to a confirmation button page

WBOY
Release: 2016-07-30 13:31:40
Original
1175 people have browsed it

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>
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login

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>
Copy after login
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template