File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
packages/manager/modules/billing/src/common Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 1- export const isLabeuEnvironment = ( hostname = window . location . hostname ) =>
1+ /* global globalThis */
2+
3+ const isLabeuEnvironment = ( hostname = window . location . hostname ) =>
24 / \. l a b e u \. / . test ( hostname ) ;
35
4- export const isProdEnvironment = ( hostname = window . location . hostname ) =>
6+ const isProdEnvironment = ( hostname = window . location . hostname ) =>
57 / (?: c a | u s | e u ) \. o v h c l o u d \. c o m / . test ( hostname ) ;
68
7- export const getWillPaymentUrl = ( ) => {
9+ const getLabeuEntryPoint = ( ) => {
10+ const v = globalThis ?. __WP_LABEU_ENTRY_POINT__ ;
11+ return typeof v === 'string' ? v : '' ;
12+ } ;
13+
14+ const getWillPaymentUrl = ( ) => {
815 if ( isProdEnvironment ( ) ) {
916 return '/order/payment/assets/remoteEntry.js' ;
1017 }
1118
12- return (
13- ( isLabeuEnvironment ( ) &&
14- ( typeof __WP_LABEU_ENTRY_POINT__ === 'string' ? __WP_LABEU_ENTRY_POINT__ : '' ) ) ||
15- 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js'
16- ) ;
19+ if ( isLabeuEnvironment ( ) ) {
20+ return getLabeuEntryPoint ( ) || '/order/payment/assets/remoteEntry.js' ;
21+ }
22+
23+ return 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js' ;
1724} ;
25+
26+ exports . isLabeuEnvironment = isLabeuEnvironment ;
27+ exports . isProdEnvironment = isProdEnvironment ;
28+ exports . getWillPaymentUrl = getWillPaymentUrl ;
You can’t perform that action at this time.
0 commit comments