Giter VIP home page Giter VIP logo

Comments (11)

KadoBOT avatar KadoBOT commented on September 26, 2024 1

Yes, it will be bumped to v4 (#92), I'm gonna merge it today.

from adyen-go-api-library.

KadoBOT avatar KadoBOT commented on September 26, 2024

Hi @namanhkapur

Thanks for your request. I think it should be straight forward to include the models (we even have our own library to do so), I think the reason why we did not include it, was because there is no real API just events and currently the models are bound to the APIs. Although, your case is valid and I believe it makes sense to include them.

I can do so investigation in the next 2 weeks, but if you can tackle this, it would be great. A good starting point is the library I've mentioned above. If you need go templates, they are included in this repo.

Let me know if you need any help.

Best Regards,

from adyen-go-api-library.

namanhkapur avatar namanhkapur commented on September 26, 2024

I had a look at the adyen-openapi-generator library -- seems like it'd be hard to automatically generate the models in this case as there is no API to pull from. Is that right?

Is there a fast way to use the library to do so. How would you envision the process?

from adyen-go-api-library.

KadoBOT avatar KadoBOT commented on September 26, 2024

You can still generate, although if you look at the OpenAPI spec for the Notifications, the paths are not valid (but needed if we want to have an OpenAPI schema).

So my suggestion is, generate the models as if it was a real API, get rid of the generated API file (keep only the models) and then we can create something similar to the solution you proposed.

from adyen-go-api-library.

namanhkapur avatar namanhkapur commented on September 26, 2024

Ah makes sense -- okay I seem to have been able to create all the notification model files. Do you suggest I open a PR with only the model files? They can live in src/platformsnotificationevents

from adyen-go-api-library.

KadoBOT avatar KadoBOT commented on September 26, 2024

Sure! But keep it as a draft, so we can work on some helpers to unmarshal the notification JSON responses.

from adyen-go-api-library.

deepu105 avatar deepu105 commented on September 26, 2024

Just providing models would be sufficient IMO, and thanks to @namanhkapur for taking this up. In go, ideal way to do JSON unmarshal is indeed like @namanhkapur suggested below, so we don't have to do any helper as we won't be adding any value there. Go can unmarshall json to a struct as long as they match in structure.

if err := json.Unmarshal(reqBody, &notification); err != nil {
	return err
}

from adyen-go-api-library.

KadoBOT avatar KadoBOT commented on September 26, 2024

Great, we can merge the PR then as soon as your comments are addressed

from adyen-go-api-library.

KadoBOT avatar KadoBOT commented on September 26, 2024

Thanks for contributing @namanhkapur, I'll merge yours and other changes to the master branch asap.

from adyen-go-api-library.

deepu105 avatar deepu105 commented on September 26, 2024

Thank you @namanhkapur
We would like to send you some swag as token of appreciation. If you like that can you send a postal address to "[email protected]"

from adyen-go-api-library.

namanhkapur avatar namanhkapur commented on September 26, 2024

Thanks for all of your help -- really appreciate the support! To get the newly merged master, should we upgrade to the latest version (v4) when it's released? Also, I sent my address 😄

from adyen-go-api-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.