How would I run a node.js script in order to pass the value of a 'pseudocode' into an API Call header?

I am trying to pass a node.js script result into an API Call header in order to authorize PayPal returns. I have a partnership with PayPal in order to access this feature, and have all the other necessary authorization headers which work to onboard users, complete checkouts, and capture orders. So knowing that my other headers work, I know that this specific header is the only one I need to figure out in order to complete returns on behalf of my merchants.

The header in question is a " PayPal-Auth-Assertion" header. Here is the PayPal documentation page which explains quite simply what is needed to authorize a return.

https://developer.paypal.com/docs/multiparty/issue-refund/

The only problem is that I can’t figure out where to create a node.js script and pass the resulting value into the API Call header. That documentation also gives the option of using java, but again, I’m not sure how I would incorporate that into the API header.

Any help is appreciated!

1 Like

The page you linked seems to have some errors in rendering the conntent of the example code. It’s shocking that the documentation of a company like this one is completely messed up.

Anyway, if you want to run code that is meant to run on nodejs you need to create a plugin with a server side action.

I’ll give the plugin build a shot, thanks!

This topic was automatically closed after 70 days. New replies are no longer allowed.