• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

API client architecture choices

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am very new to API integration and I am keen to understand what my client should look like in terms of architecture. For example, I would like to integrate with a payment system (e.g. https://docs.adyen.com/developers/checkout/api-integration) using one of its available libraries: https://github.com/Adyen/adyen-java-api-library. Should the structure of my client look like the following?



The model package will include all DOA classes, while the services and their implementations for the checkout and the authorization processes are in the implementation and service packages.

I was thinking to develop the client in Java, but i am open to consider other options (Spring?). Any existing and available example is much appreciated.

Thank you

 
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring is not a language, it's a framework and is also written in java and my guess is you wouldn't need the services or implementations, they would be provided by the api.
I don't have to mutch experience with implementing thirth party payment services, but as I guess it would be the user clicks checkout and fills in the payment details, you use that information to sent a request to your thirth party services and they handle the handle everything and send you a response message to let you know if the payment is succesfull or not.
 
Geane Norm
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Demesmaecker wrote:Spring is not a language, it's a framework and is also written in java and my guess is you wouldn't need the services or implementations, they would be provided by the api.
I don't have to mutch experience with implementing thirth party payment services, but as I guess it would be the user clicks checkout and fills in the payment details, you use that information to sent a request to your thirth party services and they handle the handle everything and send you a response message to let you know if the payment is succesfull or not.



Hi,
thank you for your reply. I would appreciate some directions on how my client should look like. Are you actually saying that I will be delegating the request and response in the checkout to the API library? I feel I should be keeping the model package, right? As per https://docs.adyen.com/developers/checkout/api-integration#testingyourintegration, in order to accept online payments, I need an integration that can:

  • Get a list of payment methods available to the shopper.
    Collect the shopper's payment details.
    Make a payment.
    Redirect the shopper to complete the payment.
    Present the payment result to the shopper.


  • I am struggling to understand how to structure my client and make sure that separation of concerns is ensured.

    Thank you
     
    Daniel Demesmaecker
    Rancher
    Posts: 1170
    18
    IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    As I see it you would have at least three packages entities (containing, what you call modes, objects to bind the data) examples would be user, shoppingcart, shopitem, ..., the second would be controllers to handle the data provided from your frontend, the controllers would call a service which would send the request to your third party api
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!