问下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 可以访问微信接口吗?

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 11
sanders

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

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

直接 php index.php 调试散

1个月前 评论

file

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

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

file

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

1个月前 评论

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