hojjat-reyhane / Cafebazaar-IAB-for-Unity

6 stars 1 forks source link

The Raw `INAPP_PURCHASE_DATA` for the Purchase Signature is MISSING #5

Closed CodeMasterYi closed 4 years ago

CodeMasterYi commented 4 years ago

How Can I Find the Raw INAPP_PURCHASE_DATA for the purchase Signature?

hojjat-reyhane commented 4 years ago

I didn't get exactly what you meant! What do you need it for?

CodeMasterYi commented 4 years ago

BDA88C59-14A0-44B3-9973-52B9363720AB The Origin Json is important for server-side verification. you lost the raw data.

CodeMasterYi commented 4 years ago

1D4F3F30-DB56-4BDD-92F7-D2B84752F2D1 the raw INAPP_PURCHASE_DATA is needed in server-side signature verification.~

CodeMasterYi commented 4 years ago

Long for your help!

hojjat-reyhane commented 4 years ago

I was checking the problem. The original Json is not included because of the problem due to putting one Json in another then passing it to Unity and parsing the data. I think you can regenerate it on Unity side with the data in Purchase class. Although you can just use the Purchase.OrderId and SKU for server-side verification using Bazaar API. It's completely reliable.

CodeMasterYi commented 4 years ago

I think you can regenerate it on Unity side with the data in Purchase class. Fields' Order is Important for signature verification.

hojjat-reyhane commented 4 years ago

Yes you're right. If I give you the Jar which prints the original Json can you fix it by yourself? I really have limited time today for full testing.

hojjat-reyhane commented 4 years ago

I checked again. Currently the purchase result is printing which is actually the original Json + itemType + signature. So the order is not changed, you just have to remove itemType and signature from the end of Purchase.json. The order is: orderId, packageName, productId, purchaseTime, purchaseState, developerPayload, purchaseToken

CodeMasterYi commented 4 years ago

OK, thank you for your help.