Open bryancasler opened 9 months ago
In addition, we can check all individual gateways available on the page and determine if they are in test mode.
For example, for Stripe, the presence of the substring "test" in the key indicates that it is a test gateway:
EngagingNetworks.paymentGateways.find(gateway => gateway.gateway === "stripe")?.key.includes("test");
With the new VGS fields
EngagingNetworks.vault.environment
will returnlive
orsandbox
which gives us an easy way to check if the page is configured with a testing or live gateway. While not guaranteed to cover 100% of scenarios, it could be a good safeguard to prevent clients from accidentally pushing live a page with a test gateway (something that happens from time to time).We could add a
before:body
like we do withengridcss=false
or expose the.page-alert
section which has never been used. Or we could piggy back off the "debug" circle and create a visual representation there.