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

On this page you can find all versions of the php package mangdin/thinkphp5.1-weixinpay-wap. 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-wap

thinkphp5.1-weixinpay-wap

thinkphp5.1 微信支付 手机H5 支付

将根目录的weixinpay_wap.php拷贝到config目录

调用支付的控制器代码:

    /**
     * 微信H5支付
     * @param $orderid  //订单号
     */
    public function h5wap($orderid){// 获取配置项
        \think\facade\Config::get('weixinpay_wap.');
        $order=array(
            'body' => '测试描述',// 商品描述(需要根据自己的业务修改)
            'total_fee' => 1,// 订单金额  以(分)为单位(需要根据自己的业务修改)
            'out_trade_no' => time().rand(1000,9999),// 订单号(需要根据自己的业务修改)
            'product_id' => '234242342',// 商品id(需要根据自己的业务修改)
            'trade_type' => 'MWEB',// JSAPI公众号支付
            );
        //统一下单 获取prepay_id
        $redirect_url=urlencode('http://'.$_SERVER['HTTP_HOST'].'/index.php');  //支付完成后跳回地址
        $weixin = new \mangdin\weixinpaywap\WeixinH4Pay();
        $unified_order= $weixin->unifiedOrder($order);
        $this->redirect($unified_order['mweb_url']."&redirect_url=".$redirect_url);

    }

回调控制器代码:

    /**
     * notify_url接收页面
     */
    public function notify(){
        // 导入微信支付sdk
        $wxpay=new \mangdin\weixinpaywap\WeixinH4Pay();
        $result=$wxpay->notify();
        if ($result) {
            //完成支付后处理业务逻辑

        }
    }

注意,支付控制器代码一定要通过其他方法调用,不可以直接访问,否则会提示 “商家参数格式有误,请联系商家解决”


All versions of thinkphp5.1-weixinpay-wap 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-wap contains the following files

Loading the files please wait ....