Download the PHP package mangdin/thinkphp5.1-weixinpay without Composer

On this page you can find all versions of the php package mangdin/thinkphp5.1-weixinpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package thinkphp5.1-weixinpay

thinkphp5.1-weixinpay

thinkphp5.1 微信网站扫码支付

将目录下的weixin_pc_pay.php移到config目录,修改对应参数即可。

公共函数:

/**
 * 微信扫码支付
 * @param  array $order 订单 必须包含支付所需要的参数 body(产品描述)、total_fee(订单金额)、out_trade_no(订单号)、product_id(产品id)
 */
function weixinpay($order){
    $order['trade_type']='NATIVE';
    $weixinpay = new mangdin\weixinpay\Weixinpay();
    return $weixinpay->pay($order);

}

控制器调用支付代码

/**
     * 微信PC 扫码支付
     * @param $orderid  订单ID
     */
    public function weixinpay($orderid){
        $order=array(
            'body'=>$subject['goods']['title'], //订单描述
            'total_fee'=>$price*100,  //订单金额
            'out_trade_no'=>$subject['sn'], //订单编号
            'product_id'=>$subject['goods']['id'] //商品ID,可不传
        );
        $url = weixinpay($order); //该URL地址即为扫码支付地址,将此地址转为二维码即可
    }

回调控制器代码

/**
     * notify_url接收页面
     */
    public function notify(){
        // 导入微信支付sdk
        $wxpay=new \mangdin\weixinpay\Weixinpay();
        $result=$wxpay->notify();
        if ($result) {
            // 验证成功 修改数据库的订单状态等 $result['out_trade_no']为订单号
        }
    }

All versions of thinkphp5.1-weixinpay with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mangdin/thinkphp5.1-weixinpay contains the following files

Loading the files please wait ....