I would like to know if its possible to send CF7 form submission data to a plugin to process a payment using an API.
The workflow should be as below,
User fills in form on frontend (CF7 form) --> Submits the form --> Before mail is sent data is passed to plugin (plugin A) --> Plugin A Gets the data and processes payment (using payment info submitted) --> Returns data to functions.php --> Submits return data to another plugin (plugin B) --> Plugin B then stores the data in database --> returns true --> Mail is sent (via CF7)
I have looked at hooks but I am not sure if they work in that manner.
I have build the plugin so that it works with the Payment Gateway, however I am unable to find a way to actually pass the data from the CF7 form submission to the plugin.
Further Info --
I have built the plugin using OOP methods.