Search Unity

[Solved] IOS Payments Errors

Discussion in 'Unity IAP' started by BBO_Lagoon, Oct 20, 2017.

Thread Status:
Not open for further replies.
  1. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi, I use unity purchasing and all goes well on android.
    On IOS I have some errors that I don't understand:

    The problem is that the function OnValidationComplete on my code is only called after a server check so I don't understand how it could be called directly after PurchasingManager.ProcessPurchaseIfNew.
    Anyway I added all null reference check on the function and I still get the same reports.

    Here is the function:

    Code (csharp):
    1. private static void OnValidationComplete()
    2. {
    3.     Logger.Log( "[Boutique] OnValidationComplete" );
    4.  
    5.     if( m_StoreController != null && ProduitEnValidation != null )
    6.         m_StoreController.ConfirmPendingPurchase( ProduitEnValidation );
    7.    
    8.     ProduitEnValidation  = null;
    9.     PaiementEnValidation = null;
    10.     ReceiptEnValidation  = null;
    11.    
    12.     CallOnComplete( ModelPaiements.last_payment_status == "OK" );
    13. }
    Maybe someone could help me ?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is PurchasingManager.ProcessPurchaseIfNew a function that you wrote? Can you provide the code? Are you certain that you are not getting a server call in this function? A process purchase function might be expected to call a validation method.
     
  3. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,267
    @JeffDUnity3D PurchasingManager.ProcessPurchaseIfNew is a method in Unity's Purchasing dll. Looks like the default since it's coming from the Purchasing namespace.

    @Binouze if you are verifying receipts yourself, did you set the transaction to pending then in your ProcessPurchase callback implementation?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it! Sorry, I missed that. We would likely need to see the rest of the code to determine what is going on, I don't believe we've seen this reported before. You may need to open support ticket if you are not comfortable posting more code here. From the Analytics Dashboard, click on the Support tab.
     
  5. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi yes I keep the payment in pending status until the server response.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Understood, please keep us posted on your progress, and open a support ticket if you need.
     
  7. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Apparently this error was caused by pending payment retried on the start of the app, before user logged in to the server so impossible to validate payment server side. I made some change on my code to delay the payment initialization after the user login. I wait for some other fix to be tested to push in in production.
    I think there where a problem on the function causing the error reported by the error report, because this function didn't cause any problem the problem was on the function that was making the call to the server just before this one.
     
Thread Status:
Not open for further replies.