ONE-store / unity_plugins

Apache License 2.0
2 stars 1 forks source link

OnPurchaseFailed() triggered Incorrectly when calling ConsumePurchase() and QueryPurchases() #1

Closed joannaMarscat closed 10 months ago

joannaMarscat commented 11 months ago

When calling ConsumePurchase() after a failed purchase followed by a successful one, OnPurchaseFailed() is triggered. This issue can also be observed when calling QueryPurchases().

How to reproduce:

  1. Call PurchaseClientImpl.Purchase().
  2. Choose "Failed" instead of "Success".
  3. Call PurchaseClientImpl.Purchase().
  4. This time, choose "Success".
  5. Call PurchaseClientImpl.ConsumePurchase().

Expected result: IPurchaseCallback.OnConsumeSucceeded() or IPurchaseCallback.OnConsumeFailed() should be triggered.

Actual result: IPurchaseCallback.OnPurchaseFailed() is triggered. (Consuming is successful)

11-22 15:49:16.279  9494  9533 I Unity   : [OneStoreIAPManager] ConsumePurchasedItem, PurchaseData: kk.apexhub.20001, (inapp)
11-22 15:49:16.284  9494 10395 V PurchaseClientImpl: Consuming api: 7, purchaseToken: SANDBOXT000001969314
11-22 15:49:16.304  1227 10396 E ResolverController: No valid NAT64 prefix (101, <unspecified>/0)
11-22 15:49:16.390  7586  7707 E msgr.msys: E[N data-request]_HandleDataResponse(1596)=>Data request error for task bbab0a13-f999-4b28-8929-6b198e2e7445 (response type 1): (null)
11-22 15:49:16.392  7586  7706 E msgr.msys: E[S task_queue_handling]MCDLightSpeedTaskExecutorNetworkCompletionCallback(1055)=>Handling send error for taskId=1 batchSize=1 queue=cpq_v2
11-22 15:49:16.392  7586  7706 E msgr.msys: E[S task_queue_handling]MCDLightSpeedTaskExecutorNetworkCompletionCallback(1109)=>Error content with 18 bytes: Error Domain=com.facebook.http.error Code=401 UserInfo=0x7c98b7e7c0 {MCFErrorDirectLocalizedDescriptionKey=Client error}
11-22 15:49:16.405  7586  7707 E msgr.msys: E[N data-request]_HandleDataResponse(1596)=>Data request error for task b1f2f378-f64f-4ea7-a03f-26e1ad558873 (response type 1): (null)
11-22 15:49:16.409  7586  7706 E msgr.msys: E[S task_queue_handling]MCDLightSpeedTaskExecutorNetworkCompletionCallback(1055)=>Handling send error for taskId=2 batchSize=5 queue=contact_sharing_settings
11-22 15:49:16.410  7586  7706 E msgr.msys: E[S task_queue_handling]MCDLightSpeedTaskExecutorNetworkCompletionCallback(1109)=>Error content with 18 bytes: Error Domain=com.facebook.http.error Code=401 UserInfo=0x7c98b7e040 {MCFErrorDirectLocalizedDescriptionKey=Client error}
11-22 15:49:16.607  9494 10395 V PurchaseClientImpl: Successfully consumed purchaseToken: SANDBOXT000001969314
11-22 15:49:16.677  9494  9533 E Unity   : [OneStoreIAPManager] OnPurchaseFailed: code= 9, msg=Payment failed. Please check the payment availability and payment method and make a payment again.
11-22 15:49:16.687  9494  9533 E Unity   : Exception: [OneStoreIAPManager] OnPurchaseFailed, msg: Payment failed. Please check the payment availability and payment method and make a payment again.
11-22 15:49:16.687  9494  9533 E Unity   :   at Game.ThirdParty.OneStore.OneStoreIAPManager.OnPurchaseFailed (OneStore.Purchasing.IapResult iapResult) [0x00000] in <00000000000000000000000000000000>:0
11-22 15:49:16.687  9494  9533 E Unity   :   at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0
11-22 15:49:16.687  9494  9533 E Unity   :   at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0
11-22 15:49:16.687  9494  9533 E Unity   :   at OneStore.Core.OneStoreDispatcher.Update () [0x00000] in <00000000000000000000000000000000>:0
11-22 15:49:16.687  9494  9533 E Unity   :

Reproducible with: OnPurchaseFailed: code= 9, code= 6 (logout OneStore after calling PurchaseClientImpl.Purchase())

Not reproducible with: OnPurchaseFailed: code= 1, code= 7

SDK version: unity_plugins release v1.1.2

powerji2001 commented 10 months ago

@joannaMarscat, We attempted to reproduce the issue using the GitHub sample but were unsuccessful. We require additional information, including your code and APK. Consequently, I would like to share that information through our dev center system, as it is considered safer than using GitHub.

Thank you.