There's no reason for this code to be inside the form builder function, especially since the end result on either success or failure is a redirect back to the form without the authorization code parameter. Move it to a separate function for the sake of clarity.

CommentFileSizeAuthor
#2 3302124-2.square_access_function.patch5.61 KBrszrama

Comments

rszrama created an issue. See original summary.

rszrama’s picture

Status: Active » Needs review
StatusFileSize
new5.61 KB

I've also created a function for returning the Authorize URL, updating it to the new route used by Square.

rszrama’s picture

Status: Needs review » Fixed

Tested / committed.

  • rszrama committed c290ce5 on 8.x-1.x
    Issue #3302124 by rszrama: Refactor the access token request out of the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.