Server side verification of Google Play in-app billing purchase signature failed

前端 未结 1 800
时光说笑
时光说笑 2020-12-21 12:04

i\'m currently integrating Google Play in-app billing to my androidgame project, i have a Node.js server set up and plan to send it the \"originalJson\" and \"signature\" va

相关标签:
1条回答
  • 2020-12-21 12:32

    It seems that your originalJson string is missing some necessary escaping.

    I've managed to verify the signature with the escaping added back in:

    var originalJson = '{"orderId":"GPA.1312-8694-0319-25069","packageName":"com.shihu.sm.testin","productId":"com.shihu.sm.testin.diamond","purchaseTime":1452598011176,"purchaseState":0,"developerPayload":"{\\"iabProductId\\":\\"com.shihu.sm.testin.diamond\\",\\"gOrderId\\":\\"2cb77de1a2a94db18b6df84f8037ea5b\\",\\"serverId\\":\\"6\\",\\"productId\\":\\"202\\"}","purchaseToken":"bjoncdcebeclpklebmadidgb.AO-J1OyEbKLL0rhWQAc1hjdWyJPXHkAoHZTfZasqUuFWKWyAlnj-opiDLYILNRpnWgcblO8vV37fWf0kpeNMRZcgRT-fRxAO4P8VQPmU-TJakB-sCiRx8sUxL4nxnUBMnZdFWdpaIZDW5tP3Ck4aO57n1o66PwnjZw"}';
    

    Pay attention to the \\'s. The string is different otherwise.

    0 讨论(0)
提交回复
热议问题