only enable fiat on prod, staging and dev
This commit is contained in:
		
							parent
							
								
									1b4780c25b
								
							
						
					
					
						commit
						5cacd2635e
					
				@ -11,6 +11,7 @@ import { MiningStats } from '../../services/mining.service';
 | 
				
			|||||||
import { IAuth, AuthServiceMempool } from '../../services/auth.service';
 | 
					import { IAuth, AuthServiceMempool } from '../../services/auth.service';
 | 
				
			||||||
import { EnterpriseService } from '../../services/enterprise.service';
 | 
					import { EnterpriseService } from '../../services/enterprise.service';
 | 
				
			||||||
import { ApiService } from '../../services/api.service';
 | 
					import { ApiService } from '../../services/api.service';
 | 
				
			||||||
 | 
					import { isDevMode } from '@angular/core';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type PaymentMethod = 'balance' | 'bitcoin' | 'cashapp' | 'applePay' | 'googlePay';
 | 
					export type PaymentMethod = 'balance' | 'bitcoin' | 'cashapp' | 'applePay' | 'googlePay';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -82,6 +83,13 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
 | 
				
			|||||||
  timePaid: number = 0; // time acceleration requested
 | 
					  timePaid: number = 0; // time acceleration requested
 | 
				
			||||||
  math = Math;
 | 
					  math = Math;
 | 
				
			||||||
  isMobile: boolean = window.innerWidth <= 767.98;
 | 
					  isMobile: boolean = window.innerWidth <= 767.98;
 | 
				
			||||||
 | 
					  isProdDomain = ['mempool.space',
 | 
				
			||||||
 | 
					    'mempool-staging.va1.mempool.space',
 | 
				
			||||||
 | 
					    'mempool-staging.fmt.mempool.space',
 | 
				
			||||||
 | 
					    'mempool-staging.fra.mempool.space',
 | 
				
			||||||
 | 
					    'mempool-staging.tk7.mempool.space',
 | 
				
			||||||
 | 
					    'mempool-staging.sg1.mempool.space'
 | 
				
			||||||
 | 
					   ].indexOf(document.location.hostname) > -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private _step: CheckoutStep = 'summary';
 | 
					  private _step: CheckoutStep = 'summary';
 | 
				
			||||||
  simpleMode: boolean = true;
 | 
					  simpleMode: boolean = true;
 | 
				
			||||||
@ -398,15 +406,14 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
 | 
				
			|||||||
   * Square
 | 
					   * Square
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  insertSquare(): void {
 | 
					  insertSquare(): void {
 | 
				
			||||||
 | 
					    if (!this.isProdDomain && !isDevMode()) {
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (window['Square']) {
 | 
					    if (window['Square']) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    let statsUrl = 'https://sandbox.web.squarecdn.com/v1/square.js';
 | 
					    let statsUrl = 'https://sandbox.web.squarecdn.com/v1/square.js';
 | 
				
			||||||
    if (document.location.hostname === 'mempool-staging.fmt.mempool.space' ||
 | 
					    if (this.isProdDomain) {
 | 
				
			||||||
        document.location.hostname === 'mempool-staging.va1.mempool.space' ||
 | 
					 | 
				
			||||||
        document.location.hostname === 'mempool-staging.fra.mempool.space' ||
 | 
					 | 
				
			||||||
        document.location.hostname === 'mempool-staging.tk7.mempool.space' ||
 | 
					 | 
				
			||||||
        document.location.hostname === 'mempool.space') {
 | 
					 | 
				
			||||||
      statsUrl = '/square/v1/square.js';
 | 
					      statsUrl = '/square/v1/square.js';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -416,6 +423,9 @@ export class AccelerateCheckout implements OnInit, OnDestroy {
 | 
				
			|||||||
    })();
 | 
					    })();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  setupSquare(): void {
 | 
					  setupSquare(): void {
 | 
				
			||||||
 | 
					    if (!this.isProdDomain && !isDevMode()) {
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    const init = (): void => {
 | 
					    const init = (): void => {
 | 
				
			||||||
      this.initSquare();
 | 
					      this.initSquare();
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user