2017 © Pedro Peláez
 

symfony-bundle salesforce-bundle

A Salesforce bundle for Sylius framework

image

swisscat/salesforce-bundle

A Salesforce bundle for Sylius framework

  • Tuesday, October 31, 2017
  • by swisscat
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

[WORK IN PROGRESS] - SalesforceBundle

(Yet another) Salesforce synchronization tool, using a RabbitMQ engine to defer and bulk synchronization. Using Streaming API to fetch back records from Salesforce., (*1)

Installation

Require the bundle:, (*2)

composer require swisscat/salesforce-bundle

Register the bundle:, (*3)

// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ... ,
        new \OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
        new \Swisscat\SalesforceBundle\SalesforceBundle(),
    ];
}

Generate a Salesforce Enterprise WSDL, (*4)

Fill in basic config, (*5)

salesforce:
    soap_client:
        wsdl: "%kernel.root_dir%/config/sf.wsdl"
        username: <username>
        password: <password>
        token: <token>

Update schema:, (*6)

bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate

Configuration

Edit config.yml, (*7)

salesforce:
    soap_client:
        wsdl: "%kernel.root_dir%/config/sf.wsdl"
        username: <username>
        password: <password>
        token: <token>

old_sound_rabbit_mq:
    connections:
        default:
            host:     'localhost'
            port:     5672
            user:     'guest'
            password: 'guest'
            vhost:    '/'
            lazy:     true
            connection_timeout: 60
            keepalive: true
            use_socket: false # default false
    producers:
        sync_salesforce:
            connection:       default
            exchange_options: {name: 'sync-salesforce', type: direct}
            service_alias:    sync_salesforce # no alias by default
    consumers:
        salesforce_back:
            connection:       default
            exchange_options: {name: 'salesforce', type: direct}
            queue_options:    {name: 'salesforce'}
            callback:         sylius.consumer.salesforce_back
    batch_consumers:
        sync_salesforce:
            connection:       default
            exchange_options: {name: 'sync-salesforce', type: direct}
            queue_options:    {name: 'sync-salesforce'}
            callback:         sylius.consumer.salesforce
            qos_options:      {prefetch_size: 0, prefetch_count: 2, global: false}

Run the command to process records, (*8)

bin/console rabbitmq:batch:consumer sync_salesforce

Run the command to fetch Topic Updates (See https://github.com/swisscat/salesforce-amqp-connector), (*9)

bin/console rabbitmq:consumer salesforce_back

Roadmap

  • [ ] Refactor / cleanup
  • [ ] Complete tests
  • [ ] Improve RabbitMQ exchange configuration
  • [ ] Provide queue configurability on ecommerce
  • [ ] Handle failures on ecommerce publish
  • [ ] Generalize bundle for other providers (i.e magento)
  • [ ] Authentication with Token for Java API
  • [ ] Implement bundle logic for reconciliation (Master: SF/ECOM/storing conflicts)
  • [ ] Improve mapping definition (custom functions)
  • [ ] Implement mapping associations (entity relations)

The Versions