error with Authorization intent

kim_g
Contributor
Contributor

I'm using a server-side call (Java SDK) to setup an authorization.  The logs below show that is successful as expected:  

 

      : PayPal Status Code: 201

      : PayPal Status: CREATED

[Removed. Phone #s not permitted]6860D

     : PayPal Intent: AUTHORIZE

     : PayPal Total Amount: USD 2.00

 

When it returns to the client and the client-side attempts to contact PayPal, this error is thrown from the JS:  

 

Uncaught Error: Expected intent from order api call to be capture, got authorize. Please ensure you are passing intent=authorize to the sdk

 

Any idea what I'm doing wrong?  My server-side unit tests all complete with no issues.   

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

kim_g
Contributor
Contributor

Found the issue....needed to include 'intent=authorize' on the JS reference. 

 

Since I won't know for certain if I'm doing an authorization or transaction until after the user clicks the PayPal button and my server is contacted, guess I'll just set it when the page is loaded and some will go through the authorization route unnecessarily.   

 

View solution in original post

Login to Me Too
1 REPLY 1
Solved

kim_g
Contributor
Contributor

Found the issue....needed to include 'intent=authorize' on the JS reference. 

 

Since I won't know for certain if I'm doing an authorization or transaction until after the user clicks the PayPal button and my server is contacted, guess I'll just set it when the page is loaded and some will go through the authorization route unnecessarily.   

 

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.