Skip to main content

Installation and activation readiness

In this guide you will learn:

  • Implement extension installation and Oauth
  • Collect merchant payment gateway credentials
  • Activate payment extension in an application

Implement extension installation and Oauth

Below diagram explains how extension installation and Oauth works. Follow the steps explained in implement-oauth guide to let merchants install and launch your extension in their platform panel.

QG4

  1. A new merchant installs or an existing merchant opens your payment extension.
  2. install/open request: In case of both install/open, Fynd Platform calls your extension in iframe on {Extension URL}/fp/install endpoint. Know more.
  3. Creates OAuth handshake URL and redirects to it.
    1. Add a condition: If you receive application_id in install/open request, make sure to add it as query parameter in redirect_url parameter of OAuth handshake URL. This would help your extension to identify the application_id in Auth callback request in step 7.
  4. Fynd Platform checks the extension is already installed. If extension is not already installed then it executes steps 5 and 6.
  5. Fynd Platform shows OAuth handshake page to merchant and ask for installation approval.
  6. Merchant accepts installation request.
  7. Auth callback request: Fynd Platform redirects the client to redirect_url provided by extension in OAuth handshake URL with one time authorization_code.
  8. Extension checks whether it already has active offline access_token for the company_id. If no, extension requests an offline access_token using authorization_code.
  9. Fynd Platforms respond with offline access_token, expiration details and refresh_token.
  10. Extension saves the access_token and makes sure it updates it using refresh_token before expiration. access_token is unique for each company_id and can be used to call Platform API for that company.
note

In case, your extension fails to update access_token before expiration, it can request offline access_token when merchant opens the extension next time as explained in step 8.

  1. Extension redirects the client to its home page for the merchant's company_id and application_id.

Collect merchant payment gateway credentials

After completing the OAuth, Extension redirects the client to its home page for the merchant's company_id and application_id. Extension is supposed to collect merchant's payment gateway credentials on this page and upon successfully collecting and validating the credentials, show a success message to the merchant. The credentials should be stored at company_id * application_id as merchant may have different credentials for different applications within the company.

Activate payment extension

When merchant opens the payment settings of an application within the company, Fynd Platform calls getActivationReadiness API of extension to check whether it has collected and saved valid payment gateway credentials for that application_id. Upon receiving success response from extension, Fynd Platform change the status from Available for Activation to Inactive and allows merchant to activate the extension for the application. Once the merchant activates the extension for the application, its status changes to Active.

QG4

Test the installation and activation flow