Setting Headers in js client

StanleyR
New Community Member

I've built a nice simple checkout and it works fine but I'd like a bit more info from the actions.order.capture() function call

I've got it all working - I get an authorised payment and receive a result from actions.order.capture - it only contains

{"orderID":"2BJ093.....89303Y","payerID":"YUR6.....ZTCW"}

Reading the api specs I can get more information if I supply a Prefer: return=representation header.  The documentation are all using curl with -H to specify the headers.  I can find nothing in the documents for the js SDK on supplying the headers.  I've tried adding a headers: {'Prefer': 'return=representation'} to my actions.order.create(DATAOBJECT) and also to the actions.order.capture({headers: {"Prefer":
"return=representation"}) but I didn't get anything different back.

Can somebody point where the documentation is for setting the headers please.

 

 

S

Login to Me Too
3 REPLIES 3

JohnnyBurbank
Contributor
Contributor

Did you ever get an answer for this?  I'm looking for this same information also.

Login to Me Too

Spuggiehawk
Contributor
Contributor

Still no answer to this?  Unless there's an almost identical question somewhere that I've missed, it would be very helpful if someone could let us know how to set headers in the request.  It seems that I need to do this to access the payer's address details.  Surely that's a common requirement.

Login to Me Too

Mitchco
New Community Member

Would love to see an answer to this too!

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.