diff options
Diffstat (limited to 'platform/android/java/src/com')
3 files changed, 13 insertions, 10 deletions
diff --git a/platform/android/java/src/com/android/godot/GodotPaymentV3.java b/platform/android/java/src/com/android/godot/GodotPaymentV3.java index 9d2893cde6..23f5bf34d3 100644 --- a/platform/android/java/src/com/android/godot/GodotPaymentV3.java +++ b/platform/android/java/src/com/android/godot/GodotPaymentV3.java @@ -24,8 +24,12 @@ public class GodotPaymentV3 extends Godot.SingletonBase { } }); }; + +/* public string requestPurchasedTicket(){ + activity.getPaymentsManager() + } - +*/ static public Godot.SingletonBase initialize(Activity p_activity) { return new GodotPaymentV3(p_activity); @@ -40,8 +44,8 @@ public class GodotPaymentV3 extends Godot.SingletonBase { - public void callbackSuccess(){ - GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{}); + public void callbackSuccess(String ticket){ + GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{ticket}); } public void callbackFail(){ diff --git a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java index 08fc405183..531a786dc9 100644 --- a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java +++ b/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java @@ -61,7 +61,7 @@ abstract public class HandlePurchaseTask { pc.setConsumableFlag("block", productId, true); pc.setConsumableValue("token", productId, purchaseToken); - success(purchaseToken, productId); + success(purchaseData); return; } catch (JSONException e) { error(e.getMessage()); @@ -71,7 +71,7 @@ abstract public class HandlePurchaseTask { } } - abstract protected void success(String purchaseToken, String sku); + abstract protected void success(String ticket); abstract protected void error(String message); abstract protected void canceled(); diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java index 325e3a0751..983f655c35 100644 --- a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java @@ -84,8 +84,9 @@ public class PaymentsManager { new HandlePurchaseTask(activity){ @Override - protected void success(String purchaseToken, String sku) { - validatePurchase(purchaseToken, sku); + protected void success(String ticket) { + godotPaymentV3.callbackSuccess(ticket); + //validatePurchase(purchaseToken, sku); } @Override @@ -112,7 +113,7 @@ public class PaymentsManager { @Override protected void success() { - godotPaymentV3.callbackSuccess(); + godotPaymentV3.callbackSuccess(""); } @@ -145,7 +146,5 @@ public class PaymentsManager { this.godotPaymentV3 = godotPaymentV3; } - - } |