in-app-purchasein-app-billingandroid-inapp-purchase

Sample of Android In-App Purchase receipt(response)


I was searching for sample of response returned by google billing library and I did not found.


Solution

  • Google returns

    1: Response Code: Value is 0 if the purchase was successful, error otherwise.

    2: Signature

    3: Purchase data subscription contains autoRenewing property while managed product does not.

    UPDATE: Android billing library's new version includes acknowledged property. I don't have new response for the product at hand.

    Subscription:{
        "orderId":"GPA.2023-9153-0180-49403",
        "packageName":"com.package.name",
        "productId":"subscription.name.sku",
        "purchaseTime":1565763897962,
        "purchaseState":0,
        "purchaseToken":"kkoohioagkpieamagedjoiji.AO-J1Owj3YPtGxM9YOBSCywUo07BwcX79dAS24w7DvvxVi-gEzsXeRvkY5NGETBH8oDUaWc0oF4M8K3EiJ2v9JUfoGzxPazO51qpksIXGOkVPHI0DVJE3FzOdDd7bqbAIPVLFUo7u6SzdN1nRUlg9xoakvzqY8Kwow",
        "autoRenewing":true,
        "acknowledged":false
      }
    

    The old response:

    Subscription:
    {
            "orderId":"string",
            "packageName":"string",
            "productId":"string",
            "purchaseTime":1423956863083,
            "purchaseState":0,
            "purchaseToken":"apafgjjemjhnoiadmmpffiil.AO-J1OySPl3pYGk4JliUkLj_Fro7FvGWiArPP0R1imx49HOmnJ4MroJNbSwkLk1WfYJmp_8g5ek5C9AAIjG_6GhC03-X0QMwfyc4epN_ZdkZqlxIKj0V5m6QQZDRhLW-8smEQ5R_USG4dtq6JTsK9UoxMO2YFXziGQ",
            "autoRenewing":true
    }
    
    Products:
    {
        "orderId":"GPA.6027-7343-7915-33484",
        "packageName":"com.app.package.name",
        "productId":"quotation.1",
        "purchaseTime":1523956202686,
        "purchaseState":0,
        "purchaseToken":"kjcjjlmljnbifnlpcobchldi.AO-J1OyD96lBh3dYpPpf3yW3H4EzH_2XXFjNjL3jrVf-oPk-T7ZQvf-DF1Zd0LFtzPBn8hqdL_2ML6AXLgzBRkDcFAljIbv4Ck0ARxz-L4LPXAFgQvHGIn4Of00msbbkiI2ENpNKBgd6_MlxT7oTaMU3ltQmld7X2A"
    }