Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

API client architecture choices

 
Ranch Hand
Posts: 60
  • 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: 60
  • 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
     
    There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
    Devious Experiments for a Truly Passive Greenhouse!
    https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
      Bookmark Topic Watch Topic
    • New Topic