You can use the api action to call another server action and pass it parameters and then evaluate the output.
It would be much easier though if we had something that allowed reusable series of actions that could be inserted for a code once, use multiple times approach.
I’m integrating our shopping cart with several payment gateways.
So the logic for single/recurring/trial payments is specific to each gateway.
But email notifications and database operations are common to each transactions.
Usually, I would have a “root” logic to dispatch to the correct gateway routine depending of which gateway has to process the payment.
Then the corresponding gateway routine would return a “standard” response that I can pass onto my database and notification routines.