定制 highliuk/reserve-with-google 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

highliuk/reserve-with-google

Composer 安装命令:

composer require highliuk/reserve-with-google

包简介

Reserve with Google PHP SDK, to simplify the Appointments Redirect integration

README 文档

README

Reserve with Google PHP SDK, to simplify the Appointments Redirect integration.

Installation

Use composer to install the package:

composer require highliuk/reserve-with-google

Usage

use HighLiuk\Rwg\Feeds\Merchants;
use HighLiuk\Rwg\Models\Merchant;

// create the merchants feed
$merchants = new Merchants;

// add a merchant to the feed
$merchant = new Merchant(
    id: 'appointments-merchant-1',
    name: 'Lorem ipsum Barbershop',
    telephone: '+11111222233',
    url: 'https://barbershop.com',
    latitude: 37.422113,
    longitude: -122.084041,
    country: 'US',
    locality: 'Mountain View',
    region: 'California',
    postal_code: '94043',
    street_address: '1600 Amphitheater Drive'
);
$merchants->add($merchant);

// export the feed
$merchants->export(__DIR__);

This will generate two files in the specified directory, ready to be uploaded to the Reserve With Google dropbox:

  • merchant_{timestamp}.json.gz - the actual feed data
  • merchant_{timestamp}.filesetdesc.json.gz - the fileset descriptor file

Supported feeds

Merchants

use HighLiuk\Rwg\Models\Merchant;

$merchant = new Merchant(
    id: 'appointments-merchant-1',
    name: 'Lorem ipsum Barbershop',
    telephone: '+11111222233',
    url: 'https://barbershop.com',
    latitude: 37.422113,
    longitude: -122.084041,
    country: 'US',
    locality: 'Mountain View',
    region: 'California',
    postal_code: '94043',
    street_address: '1600 Amphitheater Drive'
);

Generated files:

merchant_{timestamp}.json.gz
{
    "data": [
        {
            "entityId": "appointments-merchant-1",
            "name": "Lorem ipsum Barbershop",
            "telephone": "+11111222233",
            "url": "https://barbershop.com",
            "location": {
                "latitude": 37.422113000000003,
                "longitude": -122.084041,
                "address": {
                    "country": "US",
                    "locality": "Mountain View",
                    "region": "California",
                    "postalCode": "94043",
                    "streetAddress": "1600 Amphitheater Drive"
                }
            }
        }
    ]
}
merchant_{timestamp}.filesetdesc.json.gz
{
    "generationTimestamp": "1725266494",
    "name": "reservewithgoogle.entity",
    "dataFile": ["merchant_1725266494.json.gz"]
}

Actions

use HighLiuk\Rwg\Models\Action;

$action = new Action(
    merchant_id: 'appointments-merchant-1',
    link_id: 'appointment-link-1',
    url: 'https://www.epapartnerwebsite.com/appointment/appointment-partner-1',
);

Generated files:

action_{timestamp}.json.gz
{
    "data": [
        {
            "entityId": "appointments-merchant-1",
            "linkId": "appointment-link-1",
            "url": "https://www.epapartnerwebsite.com/appointment/appointment-partner-1",
            "actions": [{ "appointmentInfo": {} }]
        }
    ]
}
action_{timestamp}.filesetdesc.json.gz
{
    "generationTimestamp": "1725266606",
    "name": "reservewithgoogle.action.v2",
    "dataFile": ["action_1725266606.json.gz"]
}

Services

use HighLiuk\Rwg\Feeds\Services;
use HighLiuk\Rwg\Models\Duration;
use HighLiuk\Rwg\Models\Price;
use HighLiuk\Rwg\Models\Range;
use HighLiuk\Rwg\Models\Service;
use HighLiuk\Rwg\Models\ServiceInfo;

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

$services = new Services;

$service = new Service(
    id: 'service-1',
    merchant_id: 'appointments-merchant-1',
    localized_service_info: [
        'en' => new ServiceInfo(
            name: 'Service Type 1',
            category: 'Haircut',
            description: 'Lorem ipsum dolor sit amet'
        ),
        'es' => new ServiceInfo(
            name: 'Servicio Tipo 1',
            category: 'Cortes de pelo',
            description: 'el cliente esta muy contento'
        ),
    ],
    service_price: new Price(
        range: Range::exact(40000000),
        currency_code: 'USD',
    ),
    action_link: 'https://www.rwgpartnerwebsite.com/appointment/service-1/in-person-1',
    service_duration: new Duration(
        range: Range::exact(360),
    ),
);

Generated files:

service_{timestamp}.json.gz
{
    "data": [
        {
            "merchantId": "appointments-merchant-1",
            "serviceId": "service-1",
            "localizedServiceName": {
                "value": "Service Type 1",
                "localizedValue": [
                    { "locale": "en", "value": "Service Type 1" },
                    { "locale": "es", "value": "Servicio Tipo 1" }
                ]
            },
            "localizedServiceCategory": {
                "value": "Haircut",
                "localizedValue": [
                    { "locale": "en", "value": "Haircut" },
                    { "locale": "es", "value": "Cortes de pelo" }
                ]
            },
            "localizedServiceDescription": {
                "value": "Lorem ipsum dolor sit amet",
                "localizedValue": [
                    { "locale": "en", "value": "Lorem ipsum dolor sit amet" },
                    { "locale": "es", "value": "el cliente esta muy contento" }
                ]
            },
            "servicePrice": {
                "priceInterpretation": "INTERPRETATION_EXACT",
                "minPrice": { "priceMicros": "40000000", "currencyCode": "USD" }
            },
            "actionLink": [
                {
                    "url": "https://www.rwgpartnerwebsite.com/appointment/service-1/in-person-1"
                }
            ],
            "serviceDuration": {
                "durationInterpretation": "INTERPRETATION_EXACT",
                "minDurationSec": "360"
            }
        }
    ]
}
service_{timestamp}.filesetdesc.json.gz
{
    "generationTimestamp": "1725265955",
    "name": "glam.service.v0",
    "dataFile": ["service_1725265955.json.gz"]
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

highliuk/reserve-with-google 适用场景与选型建议

highliuk/reserve-with-google 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「redirect」 「google」 「merchant」 「reserve」 「appointments」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 highliuk/reserve-with-google 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 highliuk/reserve-with-google 我们能提供哪些服务?
定制开发 / 二次开发

基于 highliuk/reserve-with-google 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 31
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-02