MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

third_party/subscriptions-project/swg.js:17911–17954  ·  view source on GitHub ↗

* @param {!./deps.DepsDef} deps

(deps)

Source from the content-addressed store, hash-verified

17909 * @param {!./deps.DepsDef} deps
17910 */
17911 constructor(deps) {
17912 /** @private @const {!Window} */
17913 this.win_ = deps.win();
17914
17915 /** @private @const {!../components/activities.ActivityPorts} */
17916 this.activityPorts_ = deps.activities();
17917
17918 /** @private {?function(!Promise<!PaymentData>)} */
17919 this.responseCallback_ = null;
17920
17921 /** @private {?PaymentDataRequest} */
17922 this.request_ = null;
17923
17924 /** @private {?Promise<!PaymentData>} */
17925 this.response_ = null;
17926
17927 /** @private @const {!./analytics-service.AnalyticsService} */
17928 this.analytics_ = deps.analytics();
17929
17930 /** @private @const {!RedirectVerifierHelper} */
17931 this.redirectVerifierHelper_ = new RedirectVerifierHelper(this.win_);
17932
17933 /** @private {?PaymentsAsyncClient} */
17934 this.client_ = null;
17935
17936 /** @private @const {!Preconnect} */
17937 this.preconnect_ = new Preconnect(this.win_.document);
17938
17939 // If the page is started from a redirect, immediately initialize
17940 // client to avoid dropping user state.
17941 if (
17942 isExperimentOn(this.win_, ExperimentFlags.PAY_CLIENT_REDIRECT) &&
17943 this.pageIsInitializedFromPayRedirect_()
17944 ) {
17945 this.preconnect(this.preconnect_);
17946 this.initializePaymentsClient_();
17947 }
17948
17949 // Prepare new verifier pair.
17950 this.redirectVerifierHelper_.prepare();
17951
17952 /** @private @const {!./client-event-manager.ClientEventManager} */
17953 this.eventManager_ = deps.eventManager();
17954 }
17955
17956 /**
17957 * @param {!PaymentOptions} options

Callers

nothing calls this directly

Calls 9

preconnectMethod · 0.95
activitiesMethod · 0.80
analyticsMethod · 0.80
prepareMethod · 0.80
eventManagerMethod · 0.80
isExperimentOnFunction · 0.70
winMethod · 0.45

Tested by

no test coverage detected