fix some bug about google pay

This commit is contained in:
CounterFire2023 2023-07-10 18:53:58 +08:00
parent f79ec2a94e
commit 85a5500224

View File

@ -63,6 +63,8 @@ public class PayClient extends Activity implements PurchasesUpdatedListener {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) { if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
// The BillingClient is ready. You can query purchases here. // The BillingClient is ready. You can query purchases here.
Log.i(TAG, "BillingClient is ready"); Log.i(TAG, "BillingClient is ready");
} else {
Log.i(TAG, "error init BillingClient with error:: " +billingResult.getResponseCode());
} }
} }
@ -125,9 +127,10 @@ public class PayClient extends Activity implements PurchasesUpdatedListener {
} }
} }
private void purchaseUpdateCb(String funId, String error, String dataStr) { private void purchaseUpdateCb(String funId, String error, String dataStr) {
if (funId == null) { if (funId == null || funId.isEmpty()) {
if (mFunId != null && !mFunId.isEmpty()) { if (mFunId != null && !mFunId.isEmpty()) {
runOnUiThread(() -> JcSDK.nativeCb(mFunId, error, dataStr)); final String _funId = mFunId;
runOnUiThread(() -> JcSDK.nativeCb(_funId, error, dataStr));
mFunId = null; mFunId = null;
} }
} else { } else {