What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi Everyone, I have doubt about third party integration in spryker, Is there any framework provided by spryker for third party integration?
Please guide me for this.
That pretty much depends on what you want to integrate.
Is it file based, for example CSV/XML/etc., probably the middleware is the best place to look at: https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-ingestion/spryker-middleware.html#overview
For all others it pretty much depends on where you want to integrate it and how deeply the 3rd party should be integrated.
But there is no out of the box feature which just maps a field from a 3rd party api to an internal field if you ask for something like this. Mainly because there is often a lot more necessary to integrate the 3rd party (authentication, error handling, synchronous/asynchronous integration parts).
Maybe you can explain what you want in more detail so others can give a better guidance on where to start
Is There is already any api is using in spryker
In https://github.com/spryker-eco/ there are plenty of integration examples, most of them are HTTP API based
using middleware ?
or using any otherway?
Is it file based, for example CSV/XML/etc., probably the middleware is the best place to look at
Middleware is mainly focused on file based integrations.
You can implement a Reader that reads from an API instead of a file, but I'm not sure if this is the best approach for what you want to achieve, as it is still unclear what you want to integrate where.
If you could give a few more information what you want to integrate and into which part of spryker it is easier to give you an advice. Your initial question is so generic that I can only give you the possible directions for an integration
tell me please which middleware in existing spryker code i can take hint from
i want to integrate basic get and post api in spryker
which is returning json data
On that basic information, there is the Guzzle HTTP Client in Spryker you can use to access any HTTP based API.
Guzzle Documentation is available at https://docs.guzzlephp.org/en/stable/
i have done it using curl
Which is fine as well
this is monual way
but i am finding out of the box available framework in spryker for third party api call
can you help me to call an api using middleware in spryker
I have the feeling we go in circles here. From your initial, generic question, middleware was one direction you could go with, given the limited information you gave.
If you want to import batches of data, primarily file based, middleware is the way to go, how is documented at https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-ingestion/spryker-middleware.html#pipeline-structure
But if you want to integrate for example a payment provider into the checkout there are better options.
So again, please give a few more specific information on what you want to integrate into which part of Spryker. Depending on this information middleware can be the best option, but maybe another solution would fit a lot better.
Something like:
I want to integrate a JSON API from payment provider X into the checkout so a Customer is able to pay via Creditcard and the payment is processed through payment provider X.
ok suppose i want to use rezorpay so how
i can do it
So you want to integrate a payment provider.
You can have a look at https://github.com/spryker-eco/adyen to see how to integrate a new payment provider. Sadly payment providers are very complex, as they need to be integrated into the checkout and into the OMS to work properly.
This requires to write a few spryker plugins (see https://github.com/spryker-eco/adyen/tree/master/src/SprykerEco/Zed/Adyen/Communication/Plugin, https://github.com/spryker-eco/adyen/tree/master/src/SprykerEco/Yves/Adyen/Plugin)