I’m trying to create an API proxy through Tyk that would allow me to refund users via PayPal’s API automatically.
I have set up registration and payment through an external platform that enables users to complete a one-time payment via PayPal. I now want to enable that same user to automatically delete their account on my platform and refund their purchase if they are unhappy for any reason after 7 days).
To do this, I need to use PayPal API endpoints to authenticate the user, find their transaction ID, and call the endpoint to refund that ID.
For security reasons, I don’t want to store my PayPal credentials locally, and would instead like to create an API proxy where Tyk holds my credentials from PayPal and uses them to enable the refund, and return the result to my platform.
I have successfully created the link to the PayPal API via Tyk and can use Client ID/Secret credentials generated via Tyk. However, these are not the correct credentials for my PayPal account. I see also that it may be possible to use another system external to Tyk to generate these credentials for Tyk instead of the more traditional Tyk-generated method.
Is it possible for me to use the Client ID and Secret credentials provided to me via PayPal to generate an OAuth2.0 access token via my Tyk API? So rather than me use Tyk credentials that don’t link to my account, I can use PayPal’s credentials for my Tyk API?
Sources I’ve used so far: Tyk API Create an API, Tyk OAuth 2.0 guide(s), PayPal API developer docs, plus more that I can’t add as links because of me being a new user