Home  >  Article  >  Backend Development  >  How to complete WeChat payment with phpsdk+jsapi?

How to complete WeChat payment with phpsdk+jsapi?

尚
Original
2019-11-01 11:56:561904browse

How to complete WeChat payment with phpsdk+jsapi?

First download php_sdk from WeChat official website, the folder will contain several important php files WxPay.Api.php, WxPay.Config.php, etc.

How to complete WeChat payment with phpsdk+jsapi?

Open your wxpay.config.php file to configure the relevant information of WeChat payment, the APPID bound to the payment (must be configured, can be viewed in the account opening email), merchant number, merchant payment key

How to complete WeChat payment with phpsdk+jsapi?Set the merchant certificate path, certificate path, note that the absolute path should be filled in (only required for refunds and order cancellations, you can log in to the merchant platform to download, and fill in the path of the certificate after downloading

How to complete WeChat payment with phpsdk+jsapi? in static Add an online payment button to the page and write relevant instructions. For example, the payment button is online payment. When clicked, the click event is triggered onClick="callpay()"

How to complete WeChat payment with phpsdk+jsapi?

in callpay To add the WeChat payment method, the important WeChat payment files WxPay.JsApiPay.php,lib/WxPay.Api.php

How to complete WeChat payment with phpsdk+jsapi?

How to complete WeChat payment with phpsdk+jsapi? should also be introduced on the page. Instantiate the jsapipay class in and configure the relevant information, title, order number, amount, and callback address

How to complete WeChat payment with phpsdk+jsapi?Finally, click Pay Now. If there are no program problems, the payment window will pop up. Enter payment. Password, you can complete the online payment, and then configure the payment completion operations you want on the callback page, modify the order status, etc.

How to complete WeChat payment with phpsdk+jsapi?

Recommendation: php server

The above is the detailed content of How to complete WeChat payment with phpsdk+jsapi?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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