src/runtime/contributions-flow.js
/**
   * Starts the contributions flow or alreadyMember flow.
   * @return {!Promise}
   */
Starts the contributions flow or alreadyMember flow.
@return {!Promise}
Starts the contributions flow or alreadyMember flow . @return { !Promise }
start() {
    return this.activityIframeViewPromise_.then((activityIframeView) => {
      if (!activityIframeView) {
        return Promise.resolve();
      }
      this.deps_
        .callbacks()
        .triggerFlowStarted(SubscriptionFlows.SHOW_CONTRIBUTION_OPTIONS);
      activityIframeView.onCancel(() => {
        this.deps_
          .callbacks()
          .triggerFlowCanceled(SubscriptionFlows.SHOW_CONTRIBUTION_OPTIONS);
      });
      activityIframeView.on(
        AlreadySubscribedResponse,
        this.handleLinkRequest_.bind(this)
      );
      activityIframeView.on(SkuSelectedResponse, this.startPayFlow_.bind(this));
      this.activityIframeView_ = activityIframeView;
      return this.dialogManager_.openView(this.activityIframeView_);
    });
  }
start ( ) { return this . activityIframeViewPromise_ . then ( ( activityIframeView ) => { if ( ! activityIframeView ) { return Promise . resolve ( ) ; } this . deps_ . callbacks ( ) . triggerFlowStarted ( SubscriptionFlows . SHOW_CONTRIBUTION_OPTIONS ) ; activityIframeView . onCancel ( ( ) => { this . deps_ . callbacks ( ) . triggerFlowCanceled ( SubscriptionFlows . SHOW_CONTRIBUTION_OPTIONS ) ; } ) ; activityIframeView . on ( AlreadySubscribedResponse , this . handleLinkRequest_ . bind ( this ) ) ; activityIframeView . on ( SkuSelectedResponse , this . startPayFlow_ . bind ( this ) ) ; this . activityIframeView_ = activityIframeView ; return this . dialogManager_ . openView ( this . activityIframeView_ ) ; } ) ; }
Starts the contributions flow or alreadyMember flow.
Starts the contributions flow or alreadyMember flow .
// Start/cancel events.