codecloud/symfony-shopify-bundle
Composer 安装命令:
composer require codecloud/symfony-shopify-bundle
包简介
Makes Shopify app development a breeze
README 文档
README
This bundle enables quick and easy integration with Shopify.
Features
- Shopify OAuth signup flow with a few configuration options.
- Thin wrapper around Guzzle for easy API interactions. All API endpoints are supported.
- Symfony firewall to verify incoming API requests are authenticated (to embed app in Shopify Admin)
- Webhook support to listen for Shopify events.
The Store Model
Stores are represented by instances of ShopifyStoreInterface. It is up to you to provide an implementation of it and handle persistence.
OAUTH Configuration
// app/confiy.yml code_cloud_shopify: store_manager_id: { id of your store manager service } oauth: api_key: { your app's API Key } shared_secret: { your app's shared secret } scope: { the scopes your app requires, i.e.: "read_customers,write_customers" } redirect_route: { the route to redirect users to after installing the app, i.e.: "admin_dashboard".. } webhooks: - orders/create - customers/update
API Usage
You can access the API of an authorized store via the `` service:
// in Controller $api = $this->get('')->getForStore("name-of-store"); $customers = $api->Customer->findAll(); $orders = $api->Order->findAll();
Webhooks
You can register a list of webhooks you are interested in receiving. The bundle will automatically register them with Shopify and dispatch an event every time a webhook is received.
<?php namespace AppBundle\Event; use CodeCloud\Bundle\ShopifyBundle\Event\WebhookEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class WebhookListener implements EventSubscriberInterface { public static function getSubscribedEvents() { return [ WebhookEvent::NAME => 'onWebhook', ]; } public function onWebhook(WebhookEvent $event) { switch ($event->getTopic()) { case 'orders/create': // your custom logic here break; case 'orders/update': // your custom logic here break; } } }
Security & Authentication
By default, the bundle provides session-based authentication for admin areas embedded within Shopify.
security: providers: codecloud_shopify: id: codecloud_shopify.security.admin_user_provider firewalls: admin: pattern: ^/admin provider: codecloud_shopify guard: authenticators: - codecloud_shopify.security.session_authenticator
Authenticated users will be an instance of CodeCloud\Bundle\ShopifyBundle\Security\ShopifyAdminUser,
their username will be the name of the authenticated store (storename.myshopify.com), and their roles will include ROLE_SHOPIFY_ADMIN.
For development purposes, you can impersonate any existing store.
# in config_dev.yml code_cloud_shopify: dev_impersonate_store: "{store-name}.myshopify.com"
Credits
Many thanks to David Smith for originally creating this bundle.
codecloud/symfony-shopify-bundle 适用场景与选型建议
codecloud/symfony-shopify-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.11k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2015 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「shopify」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codecloud/symfony-shopify-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codecloud/symfony-shopify-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codecloud/symfony-shopify-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The bundle for easy using json-rpc api on your project
Bundle Symfony DaplosBundle
Shopify package for Laravel to aide in app development
A basic Shopify API wrapper with REST and GraphQL support.
A set of APIs to retrieve data from Shopify
PHP SDK for Shopify API
统计信息
- 总下载量: 1.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-07