Skip to content

Commit

Permalink
Added in UsedByGodot Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
FinepointCGI committed May 19, 2023
1 parent fcaff43 commit 06e2288
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.godotengine.godot.plugin.GodotPlugin;
import org.godotengine.godot.plugin.SignalInfo;
import org.godotengine.godot.plugin.googleplaybilling.utils.GooglePlayBillingUtils;
import org.godotengine.godot.plugin.UsedByGodot;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -91,15 +92,16 @@ public void startConnection() {
public void endConnection() {
billingClient.endConnection();
}

@UsedByGodot
public boolean isReady() {
return this.billingClient.isReady();
}

@UsedByGodot
public int getConnectionState() {
return billingClient.getConnectionState();
}

@UsedByGodot
public void queryPurchases(String type) {
billingClient.queryPurchasesAsync(type, new PurchasesResponseListener() {
@Override
Expand All @@ -118,7 +120,7 @@ public void onQueryPurchasesResponse(BillingResult billingResult,
}
});
}

@UsedByGodot
public void querySkuDetails(final String[] list, String type) {
List<String> skuList = Arrays.asList(list);

Expand All @@ -141,7 +143,7 @@ public void onSkuDetailsResponse(BillingResult billingResult,
}
});
}

@UsedByGodot
public void acknowledgePurchase(final String purchaseToken) {
AcknowledgePurchaseParams acknowledgePurchaseParams =
AcknowledgePurchaseParams.newBuilder()
Expand All @@ -159,7 +161,7 @@ public void onAcknowledgePurchaseResponse(BillingResult billingResult) {
});
}


@UsedByGodot
public void consumePurchase(String purchaseToken) {
ConsumeParams consumeParams = ConsumeParams.newBuilder()
.setPurchaseToken(purchaseToken)
Expand Down Expand Up @@ -190,7 +192,7 @@ public void onBillingSetupFinished(BillingResult billingResult) {
public void onBillingServiceDisconnected() {
emitSignal("disconnected");
}

@UsedByGodot
public Dictionary confirmPriceChange(String sku) {
if (!skuDetailsCache.containsKey(sku)) {
Dictionary returnValue = new Dictionary();
Expand All @@ -211,12 +213,12 @@ public Dictionary confirmPriceChange(String sku) {
returnValue.put("status", 0); // OK = 0
return returnValue;
}

@UsedByGodot
public Dictionary purchase(String sku) {
return purchaseInternal("", sku,
BillingFlowParams.ProrationMode.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY);
}

@UsedByGodot
public Dictionary updateSubscription(String oldToken, String sku, int prorationMode) {
return purchaseInternal(oldToken, sku, prorationMode);
}
Expand Down Expand Up @@ -259,11 +261,12 @@ private Dictionary purchaseInternal(String oldToken, String sku, int prorationMo
}

return returnValue;
}
}
@UsedByGodot
public void setObfuscatedAccountId(String accountId) {
obfuscatedAccountId = accountId;
}

@UsedByGodot
public void setObfuscatedProfileId(String profileId) {
obfuscatedProfileId = profileId;
}
Expand Down

0 comments on commit 06e2288

Please sign in to comment.