Search Unity

[Solved] Xiaomi IAP - Unable to test consumable purchases

Discussion in 'Unity IAP' started by nickheath, Sep 17, 2018.

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

    nickheath

    Joined:
    Feb 8, 2017
    Posts:
    3
    I have integrated the Xiaomi IAP system and I am able to successfully test non-consumable products, but I am unable to successfully test consumable items.

    What I am seeing:

    Non-consumable
    1. Press purchase button
    2. See debug popup "You're buying X for RMB Y"
    3a. Choosing "Success" prints "[XiaomiPayCallback] result code: 0" to the console and the item is redeemed in game
    3b. Choosing "Failure" prints "[XiaomiPayCallback] result code: -18003" to the console and the item is not redeemed

    Consumable
    1. Press purchase button
    2. No popup is shown, "[XiaomiPayCallback] result code: -18003" is immediately printed to the console, the item is not redeemed

    I have looked into the plugin and -18003 is a "MI_XIAOMI_PAYMENT_ERROR_PAY_FAILURE" error, but I have been unable to see why it is getting into that state.


    Unity version: 5.6.3p1
    Unity Purchasing: 1.21.0
    Platform: Android
    Store: Xiaomi Mi Game Pay
    Device: Non-Xiaomi Samsung Galaxy S5 mini (G800Y) Android 6.0.1
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @nickheath ,
    I just tested Xiaomi IAP with debug mode on my Samsung device and it worked well.
    Could you please confirm that you exported the Consumable product to 'Assets\Plugins\Android\assets\MiGameProductCatalog.prop'?
    Thank you.
     
  3. nickheath

    nickheath

    Joined:
    Feb 8, 2017
    Posts:
    3
    Hi @unityjingyao,
    Yes, I can confirm that the correct catalog file has been exported there. It includes both the consumable and non-consumable products.
     
  4. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Could you please send me your apk file? I'd like to test it on my side. Thank you.
    If you don't want to send it here, please DM me.
     
  5. nickheath

    nickheath

    Joined:
    Feb 8, 2017
    Posts:
    3
    Thanks for your help Jing Yao.

    The issue was that I was programmatically generating the purchase configuration rather than directly loading the MiGameProductCatalog.prop file. All the non-consumable items had a Xiaomi store specific id set, but I had inadvertently skipped the consumable items.
     
Thread Status:
Not open for further replies.