I have the following string which was the result of running a stringify command in node:
"{\"packageName\":\"com.something.something\",\"productId\":\"product_credit_50\",\"purchaseTime\":1484696888772,\"purchaseState\":0,\"purchaseToken\":\"xxxxxxxxxxxxxxxxxxxxxxx.XX-X1Xxx0QZlCo1hk7cEPqocpIpttvxSPCjwf5cqvraOTXAv7k9nglTSCdpWjAuqZ2w1rtRJTYbJ6483YG09huOCQesngxGe_gD_f83mrMsu7Yw5tEioPE1vyORGMVykhykRYn-vaE8TTQ3CgLxFafPJ7cEJwEl59w\"}"
The command I used to get the string is as follows:
var tmpreceipt = JSON.stringify(googleReceiptData);
I then executed the following command to remove the escaped characters:
var receipt = tmpreceipt.replace("\\\"", "\"");
The problem i have is that it only removes the first "\". The result of receipt is:
"{"packageName\":\"com.something.something\",\"productId\":\"product_credit_50\",\"purchaseTime\":1484696888772,\"purchaseState\":0,\"purchaseToken\":\"xxxxxxxxxxxxxxxxxxxxxxx.XX-X1Xxx0QZlCo1hk7cEPqocpIpttvxSPCjwf5cqvraOTXAv7k9nglTSCdpWjAuqZ2w1rtRJTYbJ6483YG09huOCQesngxGe_gD_f83mrMsu7Yw5tEioPE1vyORGMVykhykRYn-vaE8TTQ3CgLxFafPJ7cEJwEl59w\"}"
What I am doing wrong? Thanks in advance.