Search Unity

I want to convert Google IAP Receiept to String?

Discussion in 'Scripting' started by ExtelSolution, Feb 28, 2018.

  1. ExtelSolution

    ExtelSolution

    Joined:
    Jun 13, 2017
    Posts:
    2
    I want to change the response from the google IAP unity
    From this:
    "{"Store":"GooglePlay","TransactionID":"Example","Payload":"{\"json\":\"{\\\"orderId\\\":\\\"Example\\\",\\\"packageName\\\":\\\"com.Example.Example\\\",\\\"productId\\\":\\\"Example\\\",\\\"purchaseTime\\\":Example,\\\"purchaseState\\\":0,\\\"purchaseToken\\\":\\\"Example\\\"}\",\"signature\":\"Example\"}"}", "transactionDate":"Example"}

    To this format:
    "{\"Store\":\"GooglePlay\",\"TransactionID\":\"Example\",\"Payload\":\"{\\\"json\\\":\\\"{\\\\\\\"orderId\\\\\\\":\\\\\\\"Example\\\\\\\",\\\\\\\"packageName\\\\\\\":\\\\\\\"Example\\\\\\\",\\\\\\\"productId\\\\\\\":\\\\\\\"Example\\\\\\\",\\\\\\\"purchaseTime\\\\\\\":Example,\\\\\\\"purchaseState\\\\\\\":0,\\\\\\\"purchaseToken\\\\\\\":\\\\\\\"Example\\\\\\\"}\\\",\\\"signature\\\":\\\"Example\\\"}\"}", "transactionDate":"Example"}
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    The first line looks like a json string that is returned, so it's already a string. Why do you need to convert it further?