2017 © Pedro Peláez
 

library symfony-shopify-bundle

Makes Shopify app development a breeze

image

codecloud/symfony-shopify-bundle

Makes Shopify app development a breeze

  • Saturday, November 25, 2017
  • by codecloud
  • Repository
  • 4 Watchers
  • 5 Stars
  • 88 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 3 Versions
  • 13 % Grown

The README.md

Symfony Shopify Bundle

This bundle enables quick and easy integration with Shopify., (*1)

Build Status on Travis Scrutinizer Quality Score, (*2)

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., (*3)

OAUTH Configuration

``` yml // app/confiy.yml, (*4)

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, (*5)


## API Usage You can access the API of an authorized store via the `` service: ``` php // 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., (*6)

<?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., (*7)

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., (*8)

For development purposes, you can impersonate any existing store., (*9)

# 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., (*10)

The Versions

25/11 2017

dev-master

9999999-dev https://github.com/richtermeister/symfony-shopify-bundle

Makes Shopify app development a breeze

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony shopify

22/05 2017

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/codecloud/symfony-shopify-bundle

Makes Shopify app development a breeze

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

symfony shopify

08/04 2015

1.0.0

1.0.0.0 https://github.com/codecloud/symfony-shopify-bundle

Makes Shopify app development a breeze

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

symfony shopify