此处填写包描述。

v0.1.2 2021-10-14 09:26 UTC

This package is auto-updated.

Last update: 2024-09-14 15:48:43 UTC


README

.

安装

$ composer require cblink-service/shop -vvv

用法

<?php
$config = [
    'private' => true,
    'debug' => true,
    'base_url' => 'https://127.0.0.1',
    'app_id' => 1234,
    'key' => 'xxxxx',
    'secret' => 'xxxxxxxxx',
];

$app = new Cblink\Service\Shop\Application($config);

// 创建饿了么应用
$app->app->create([
    'name' => '应用名称',
    'type' => \Cblink\Service\Shop\ShopConst::TYPE_ELEME,
    'config' => [
        'app_id' => 'xxxx',
        'secret' => 'xxxx',
        'debug' => true,
    ]
]);

// 创建美团应用
$app->app->create([
    'name' => '应用名称',
    'type' => \Cblink\Service\Shop\ShopConst::TYPE_MEITUAN,
    'config' => [
        'developer_id' => 'xxxx',
        'sign' => 'xxxx',
    ]
]);

// 查询应用下的通知地址
$app->app->notifies('应用id');

// 保存或修改通知地址
$app->app->createNotify('应用id', \Cblink\Service\Shop\ShopConst::EVENT_ORDER_CREATE, 'https://www.baodu.com');

// state参数最终会在授权跳转页面去返回
$app->eleme->getAuthUrl('xxxx', '授权成功的跳转地址', 'state');

// 美团
$app->meituan->getAuthUrl('xxxx', '授权成功的跳转地址', 'state');

贡献

您可以通过以下三种方式之一进行贡献

  1. 使用问题跟踪器提交错误报告。
  2. 问题跟踪器上回答问题或修复错误。
  3. 贡献新功能或更新wiki。

代码贡献流程并不非常正式。您只需要确保您遵循PSR-0、PSR-1和PSR-2编码规范。任何新的代码贡献都必须附带适用的单元测试。

许可证

MIT