src/runtime/pay-client.js
/**
   * Calls the provided callback with the generated redirect verifier. This
   * API is sync/async, which is a big anti-pattern. However, it's necessary
   * to reduce the risk of popup blockers. If the verifier is already available
   * (see `prepare` method), the callback will be called immediately and thus
   * in the same event loop as the user action.
   *
   * The return verifier could be `null`. This could mean either that its
   * generation failed, or if the platform doesn't support necessary APIs, such
   * as Web Crypto. The redirect can still proceed and try to fallback on GAIA
   * as a redirect verifier. The set of platforms where GAIA is not available
   * and the redirect verifier cannot be created is negligible.
   *
   * The key corresponding to the returned verifier is stored in the session
   * storage and can be later restored using `restoreKey` method.
   *
   * @param {function(?string)} callback
   */
Calls the provided callback with the generated redirect verifier. This
API is sync/async, which is a big anti-pattern. However, it's necessary
to reduce the risk of popup blockers. If the verifier is already available
, the callback will be called immediately and thus
in the same event loop as the user action.

The return verifier could be `null`. This could mean either that its
generation failed, or if the platform doesn't support necessary APIs, such
as Web Crypto. The redirect can still proceed and try to fallback on GAIA
as a redirect verifier. The set of platforms where GAIA is not available
and the redirect verifier cannot be created is negligible.

The key corresponding to the returned verifier is stored in the session
storage and can be later restored using `restoreKey` method.

@param {function(?string)} callback
Calls the provided callback with the generated redirect verifier . This API is sync / async which is a big anti - pattern . However it ' s necessary to reduce the risk of popup blockers . If the verifier is already available the callback will be called immediately and thus in the same event loop as the user action . The return verifier could be ` null ` . This could mean either that its generation failed or if the platform doesn ' t support necessary APIs such as Web Crypto . The redirect can still proceed and try to fallback on GAIA as a redirect verifier . The set of platforms where GAIA is not available and the redirect verifier cannot be created is negligible . The key corresponding to the returned verifier is stored in the session storage and can be later restored using ` restoreKey ` method . @param { function ( ?string ) } callback
useVerifier(callback) {
    this.getOrCreatePair_((pair) => {
      if (pair) {
        try {
          this.win_.localStorage.setItem(REDIRECT_STORAGE_KEY, pair.key);
        } catch (e) {
          pair = null;
        }
      }
      callback((pair && pair.verifier) || null);
    });
  }
useVerifier ( callback ) { this . getOrCreatePair_ ( ( pair ) => { if ( pair ) { try { this . win_ . localStorage . setItem ( REDIRECT_STORAGE_KEY , pair . key ) ; } catch ( e ) { pair = null ; } } callback ( ( pair && pair . verifier ) || null ) ; } ) ; }
Calls the provided callback with the generated redirect verifier.
Calls the provided callback with the generated redirect verifier .
// If storage has failed, there's no point in using the verifer. // However, there are other ways to recover the redirect, so it's // not necessarily a fatal condition.