问下easywechat,如何直接composer,下载下来测试下?

情况是这样的,我想建立一个测试项目,测试一下easywechat的支付接口,然后我先composer init 之后得到一个composer.json文件

{
    "name": "test/easy",
    "autoload": {
        "psr-4": {
            "Test\\Easy\\": "src/"
        }
    },
    "authors": [
        {
            "name": "test",
            "email": "test.com"
        }
    ],
    "require": {
        "overtrue/laravel-wechat": "^5.1"
    },
    "config": {
        "allow-plugins": {
            "easywechat-composer/easywechat-composer": true
        }
    }
}

然后composer install
然后我建立一个index.php

<?php
use EasyWeChat\Factory;

require_once __DIR__ . '/vendor/autoload.php';

$config=[
    'app_id' => 'wxee2ddf0023',
    'secret' => 'ffdfb39127a44cffe',
    'response_type' => 'array',
    'log' => [
        'level' => 'debug',
        'file' => __DIR__.'/wechat.log',
    ],
];
print_r($config);

$app = Factory::miniProgram($config);

$data = $app->shipping->getOrder([
    'transaction_id' => '2006003449092'
]);
print_r($data);

然后我访问index.php 就报错了,问下如何单独使用easywechat包,不用框架,直接单独使用?

还有一个问题,我在本地用的127.0.0.1 可以访问微信接口吗?

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 11

overtrue/laravel-wechat 你看包名 肯定依赖laravel啊

file

你看官网人家也没引导你用laravel-wechat

2个月前 评论
sanders

报错信息发一下,不然怎么定位问题哪?

2个月前 评论
donggan (楼主) 2个月前
dryang 2个月前
donggan (楼主) 2个月前
hongfs 2个月前
sanders (作者) 2个月前

直接 php index.php 调试散

2个月前 评论

file

2个月前 评论
donggan (楼主) 2个月前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!