How to apply clean architecture concepts in a software that depends on External APIs.
A business that offers some kind of subscription to its users. Its convinient to store some subscription data and how its related with the users inside our database.
The Subscription use case is responsible to receive data from a request, send part of this data to the External Subscription API, validate the response to ensure that the subscription was generated and finally persist a Subscription Entity to a internal database.
I'd put this logic inside the SubscriptionRepository that depends on a "ExternalSubscriptionRepository", is that a fair implementation?
Considering that these payment apis usually have very especific rules and processes, how to prevent our Subscription use case to be very coupled with this logic? Is that a problem or its part of the game?
Ex: External Service A, needs 1,2,3 parameters to create a Subscription and External Service B needs parameters 2,4,1.