Table of Contents
This is a capstone project at the College of Charleston in partnership with world-class payment management company Zuora. Our team was tasked to work with our client, Wes Spears, at Zuora on a project they chose. In order to mimic a real-world, industry-style project, our team implemented the SCRUM framework.
The purpose of this project was to develop an API to sync account and contact information between Zuora and Salesforce. This will be able to save developers time and save the business money by being able to sync information efficiently and quickly.
This project team was comprised of four College of Charleston students. Each team member served as Scrum Master for at least one sprint.
- Henry Smith
- Sydney Camenzuli
- Nathan Everette
- West Harrell
Client and Zuora contact: Wes Spears (Zuora)
Professor: Dr. Ellie Lovellette
This solution is designed to automatically capture updates from a Salesforce Account or Contact sObject and apply those changes to the equivalent zObject in Zuora. The process flow will vary slightly depending on which type of sObject is updated.
Once an Account or Contact is updated in Salesforce, a bespoke Apex trigger will fire on that sObject. The trigger will then take the updated information and build a map of strings and objects for each equivalent field between Salesforce and Zuora for that type of sObject (see below for a complete map of equivalent fields). It is worth noting that the UpdateContactTrigger builds an additional map of strings and objects to store mailing address information.
Once the trigger has finished gathering and storing all the sObject’s information, it will check to see if the custom field ‘ZuoraID’ is empty. If this field is empty, then the process will end here, as there is no given Zuora ID for an equivalent zObject to be updated. If a Zuora ID is given, then the trigger will serialize the completed map of strings and objects into a JSON. The trigger will then pass this JSON, along with the Zuora ID, to a bespoke helper class, depending on the type of sObject that was updated.
The helper class will then take the given JSON and make a Zuora REST API call to update the equivalent zObject, matched via the given Zuora ID from Salesforce. The helper class also takes care of authentication and utilizes OAuth 2.0. This uses a separate method within the helper class to generate a token using the Client ID and Client Secret of the user’s Zuora sandbox’s OAuth 2.0 Provider.
- The user has access to both Salesforce and Zuora as well as their respective sandbox development environments
- The sObject already has an equivalent zObject
- The user has a method of obtaining the Zuora ID for each Account and Contact sObject they wish to sync (i.e. using a Data Query)
- The triggers ‘UpdateAccountTrigger’ and ‘UpdateContactTrigger’ have been added to the Salesforce workspace
- The classes ‘UpdateAccountHelper’ and ‘UpdateContactHelper’ have been added to the Salesforce workspace
- The aforementioned classes and triggers have been configured correctly (more details below)
- The Salesforce Account and Contact sObjects have a custom field ‘zID’ for storing its Zuora ID
- The user’s Salesforce workspace has a custom ‘ZuoraSyncError’ sObject
- The user’s Zuora sandbox already has an OAuth 2.0 Provider set up
- The user has the aforementioned OAuth 2.0 Provider’s Client ID and Client Secret