cancel
Showing results for 
Search instead for 
Did you mean: 

error with Authorization intent

SOLVED
Contributor

error with Authorization intent

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.   

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: error with Authorization intent

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.   

 

1 REPLY 1
Highlighted
Contributor

Re: error with Authorization intent

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.