import { Platform } from 'react-native'


class responseParser {


  private platform = Platform.OS;

  private responseData:any;

  constructor(){}

  SetRequestData(data: any) {

    this.responseData = data;

  }

  GetRequestData() {

    return this.responseData;

  }

  ParsePaymentOptions(response:any){

    // if(this.platform === 'android'){

    //   return Object.keys(response)

    // }

    return response;

  }

  ParseVAS(response:any){

    return this.DeleteStatusResponse(response);
  }

  ParseEmiDetails(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseChecoIsDomastic(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseBinInfo(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseGetConfig(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseCheckBalance(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseEligibleBinsForEmi(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseDeleteTokenisedUserCard(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseGetTokenisedCard(response:any){
    
    return this.DeleteStatusResponse(response);

  }

  ParseGetTokenisedCardDetails(response:any){

    return this.DeleteStatusResponse(response);

  }

  ParseTransectionInfo(response:any){

    return this.DeleteStatusResponse(response);

  }

  DeleteStatusResponse(response:any):any{

    if(this.platform === 'android'){

      delete response.responseStatus;

    }

    return response;

  }


}

export default new responseParser();
