Skip to main content

POWR-Square Integration

  • SquareInstall model has access_token and refresh_token encryptions as per Square’s security requirements

alt_text

  • SQUARE_FORM_BUILDER_SECRET, SQUARE_FORM_BUILDER_CLIENT_ID, SQUARE_MULTI_SLIDER_SECRET, SQUARE_MULTI_SLIDER_CLEINT_ID keys are being kept as Heroku config vars, because Square requires us to not store these keys in source control
  • Sign in to developer account at https://developer.squareup.com/apps using [email protected] from lastpass and applications page will be shown:

alt_text

  • Open any of the apps and click Oauth section on the left to see the redirect URL:

alt_text

  • Click Webhooks section to see all added webhooks and Send Test Event functionality is available for testing them:

alt_text

    If the square_install record is expired, then redirected to ‘SQUARE_BASE_URL/oauth2/authorize?...’ which redirects back to POWR using the redirect URL set in Square dashboard.
  • GET ‘users/oauth_square’

      This endpoint is set as a redirect URL in Square dashboard. ‘error’ param is present if the user denies to give square permissions. If the user allows, then square_install record is created/updated.
  • GET ‘users/oauth_square/revoke’

      This endpoint is for revoking the square access from POWR (account page).
  • POST ‘users/oauth_square/revoke’

      This webhook endpoint is triggered when revoking the square access from Square.