首页
开发手册
应用中心
工具
用户中心
FoundPHP H5 Payment
English
中文简体
English
上一篇
下一篇
#FoundPHP H5 Payment ### FoundPHP Introduction to H5 Payment H5 payment is currently the mainstream payment method for websites, which can be separated from the development of WeChat official accounts or Alipay applets, making it more convenient for companies to collect payments. FoundPHP H5 payment supports WeChat Pay and Alipay payment that are popular in today's society. You can transfer WeChat and Alipay from ordinary H5 web pages to make payments. You can bind bank cards and credit cards in WeChat and Alipay. Calling WeChat and Alipay is equivalent to using banks Card and credit card payment. ------------ #### 1.FoundPHPH5 Quick Generation Tool "FoundPHP H5 Quick Generation Tool" is a tool made for the convenience of developers to quickly develop H5 payment. You only need to fill in the basic data to generate the exclusive H5 program. ##### FoundPHP H5 Quick Generation Tool:https://www.foundphp.com/index.php?m=application&a=pay&t=pay_h5 ##### 1.1 Tool usage ###### Configuration information ![](data/files/edit/21/01/28/210128_17542085.png) | Name | Description | | -------- | ----- | | Project domain | The domain name of the project 'https://www.foundphp.com/' | | Payment request address | Call the payment program address '?m=pay&a=h5_pay' | |Form ID | The ID of the form that needs to submit data on the page.| | Error message | The content prompted on the page when the payment fails to be called. | ###### Payment info ![](data/files/edit/21/01/28/210128_18227080.png) | Name | Description | | -------- | ----- | | Amount | H5 project payment amount| | Payment title | Payment item title| | Body | Payment item content | | Goods tag | Payment product label | | Notify url | Asynchronous callback address | After filling in the above information, click Generate to generate the exclusive program. ![](data/files/edit/21/01/28/210128_19322552.png) 1.Download the payment plugin package and unzip it to the framework directory plugin\class. ![](data/files/edit/21/01/28/210128_19519142.png) 2.Download the H5 payment PHP program and store it under the project payment request directory. > Suppose the payment directory is?m=pay&a=h5_pay > Then download and save the H5 payment PHP program to plugin\model\pay, and rename it to h5_pay.php. ![](data/files/edit/21/01/28/210128_19533828.png) 3.Download the H5 payment JS script and load this script on the H5 page. > On the H5 page, you need to define the following tags, click the "Pay" button to call the payment program. ```java
//You can set your own form here.
Pay
``` Introduce js effect, automatically load WeChat payment and Alipay payment options. ![](data/files/edit/21/01/28/210128_19578394.png) After clicking pay, WeChat payment or Alipay payment will pop up. ![](data/files/edit/21/01/28/210128_20024595.png) ![](https://dev.foundphp.com/data/file/edit/20/06/16/200616_18049427.jpg)