Search code examples
in-app-purchasehuawei-mobile-serviceshuawei-iap

A user wants to subscribe to a product using HUAWEI IAP, but the payment page is inaccessible


Public key and AGC configurations are correct, but when a user tries subscribing to a product, error code -1 is returned, and the payment page fails to be displayed.


Solution

  • In this case, check whether the log contains "errorCode:6". The error code returned to the SDK layer is -1, indicating that the order fails to be created.

    public class OrderStatusCode {
        public static final int ORDER_STATE_SUCCESS = 0;
        public static final int ORDER_STATE_FAILED = -1;
    }

    Check whether the order creation failure is caused by the server. If not, check whether the product created in the PMS contains invalid fields and whether the product is valid.