Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 3.55 KB

SALESFORCE_INTEGRATION.md

File metadata and controls

73 lines (61 loc) · 3.55 KB

Integration of Salesforce (external system) with local system's customer catalog

  1. Potential Salesforce Integration:

  1. Environment Setup:

  • The 'simple-salesforce' module can be used to interact with the Salesforce Contact Object through REST APIs.
  • Reference: https://pypi.org/project/simple-salesforce/
  • A developer account will be required along with credentials to login to the Salesforce instance through the module.
  1. Integration Module:

  • Create a new module for the Salesforce integration (e.g., salesforce_integration.py).
  • Define functions and classes to interact with Salesforce, such as creating, reading, updating, and deleting customer records.
  1. Customer Model:

  • Create a corresponding Customer model in your application (e.g., SalesforceCustomer) that matches Salesforce's structure. It should inherit from a common Base model.
  1. API Endpoints:

  • Create API endpoints for Salesforce-related operations, similar to the ones we have for Stripe integration.
  • These endpoints should handle the creation, retrieval, updating, and deletion of customer/contact records in Salesforce.
  1. Kafka Topics:

  • Establish separate Kafka topics for Salesforce events, such as salesforce-customer-created, salesforce-customer-updated, and salesforce-customer-deleted.
  • This will help in the queueing of Salesforce events and their processing by the consumer/worker.
  1. Producer:

  • Create a separate producer for Salesforce events to ensure loose coupling.
  • Implement logic to produce events when a customer is created, updated, or deleted in the local system, as well as when these actions happen in Salesforce.
  1. Consumer:

  • Create a new Kafka consumer to handle Salesforce events to ensure loose coupling.
  • Implement event handlers to create, update, or delete customers in the local system based on Salesforce events.
  • Ensure that the consumer can distinguish between events originating from Stripe and Salesforce.
  1. Webhook Configuration:

  • If Salesforce supports webhooks or push notifications, configure the application to listen for Salesforce events and translate them into Kafka messages.
  1. Authentication and Authorization:

  • Implement Salesforce authentication mechanisms to access Salesforce APIs securely.
  • Ensure that user roles and permissions are well-defined for the Salesforce integration.
  1. Testing:

  • Extensively test the integration to ensure data consistency and error handling.
  • Perform integration testing to confirm that both Stripe and Salesforce data is synchronized correctly.
  1. Monitoring and Error Handling:

  • Implement logging and monitoring to keep track of integration events and errors.
  • Implement strategies to handle errors and exceptions.