voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.06k stars 289 forks source link

Error: Missing public key #293

Closed 92Harsha closed 4 years ago

92Harsha commented 5 years ago
 let receipt = {
    "data":  '{"orderId":"GPA.3688-7453-9084-04836","packageName":"com.myapp","productId":"com.myapp.coins.10coins","purchaseTime":15724436038097,"purchaseState":0,"purchaseToken":"edgbpfkacopakokjllfoohgg.AO-J1Ow2MCW-baqvROp-IvUzbyMBjJefAe9b34f3w"}',
    "signature": MYSIGNATUREKEY
  }

const response = await iap.validate(receipt);
iap.setup(async function(){
  if (iap.isValidated(response)) {
    const purchase = await getPurchaseData(response);
  }
}

i am getting this error message: ERROR: [VERBOSE] Try validate against live public key: undefined [VERBOSE] Failed against sandbox public key: Error: missing public key "{\"error\":{},\"status\":1,\"message\":\"missing public key\"}"

chr4ss1 commented 4 years ago

have you set GOOGLE_IAB_PUBLICKEY_LIVE and GOOGLE_IAB_PUBLICKEY_SANDBOX environment variables that you get from developer.android.com -> google play console?