[Huawei Developers] Freemind R:
Your app may fail to launch HUAWEI In-App Purchases (IAP) if you have integrated the IAP SDK 4.0.4.300 or later into it.

Problem

When a user initiates a payment request, the payment page is not displayed.

Troubleshooting

Check the result code returned by the HMS Core SDK, and perform a check by referring to the official documentation.

Capture all app logs, and search for the keyword hms_pay to locate the fault.

Possible Causes

Common Products (Consumables/Non-Consumables) Not Activated

When you create a product in AppGallery Connect, the product is not activated by default. A user cannot pay for an unactivated product.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/025/805/385/5190049000025805385.20201102021846.76413312018576059270007955913400:50511116074733:2800:1FA6D212A09584CE894603E268A62FFB883932BB3862EC425B7F2454A4E0A78F.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/025/805/385/5190049000025805385.20201102021846.76413312018576059270007955913400:50511116074733:2800:1FA6D212A09584CE894603E268A62FFB883932BB3862EC425B7F2454A4E0A78F.png[/IMG]

Result code: 60003 (indicating incorrect product information)

Search for the keyword hms_pay. The following log information will be found:

2020-09-30 14:48:52.850 21970-17650/? E/hms_pay: hms_pay [Network-Request]parse createOrder, responseCode = 6, subErrCode = 214, responseMessage = Product info cannot be found.

2020-09-30 14:48:52.850 21970-17650/? I/hms_pay: hms_pay baseBiz result:: get result Success

2020-09-30 14:48:52.850 21970-17650/? I/hms_pay: hms_pay createOrder onResponse responseCode:6,responseMessage:Product info cannot be found.

2020-09-30 14:48:52.851 21970-17650/? E/hms_pay: hms_pay createOrder fail, returnCode: 6

Subscriptions Not Activated

Result code: -1 (indicating common failure)

Search for the keyword hms_pay. The following log information will be found:

2020-09-30 15:20:38.940 21970-22803/? E/hms_pay: hms_pay [Network-Request]parse createOrder, responseCode = 6, subErrCode = 221, responseMessage = product status must 0(online)

2020-09-30 15:20:38.940 21970-22803/? I/hms_pay: hms_pay baseBiz result:: get result Success

2020-09-30 15:20:38.943 21970-22803/? I/hms_pay: hms_pay getCurrentTime error, content is inValid

2020-09-30 15:20:38.945 21970-22803/? I/hms_pay: hms_pay no InAppPurchaseData

2020-09-30 15:20:38.946 21970-22803/? E/hms_pay: hms_pay SubscribeRequestInterceptor createOrder, errorCode: 6

Incorrect Product ID

The ID of the product to be paid needs to be passed in the createPurchaseIntent API. If the product ID has not been configured in AppGallery Connect, no ID will be passed and IAP therefore cannot be launched.

Result code: 60003 (indicating incorrect product information)

Search for the keyword hms_pay. The following log information will be found:

2020-09-30 15:07:59.438 21970-19979/? E/hms_pay: hms_pay [Network-Request]parse createOrder, responseCode = 6, subErrCode = 214, responseMessage = Product info cannot be found.

2020-09-30 15:07:59.439 21970-19979/? I/hms_pay: hms_pay baseBiz result:: get result Success

2020-09-30 15:07:59.447 21970-19979/? I/hms_pay: hms_pay createOrder onResponse responseCode:6,responseMessage:Product info cannot be found.

2020-09-30 15:07:59.448 21970-19979/? E/hms_pay: hms_pay createOrder fail, returnCode: 6

Incorrect Parameter Setting (setPriceType) for Common Products

You can create consumables, non-consumables, and subscriptions in AppGallery Connect. In the createPurchaseIntent API, the setPriceType parameter must be set, and the product type must be the same as that configured on your server.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/025/805/385/5190049000025805385.20201102014719.01387306199490561604524463262719:50511116074733:2800:34811AFDC97AECA124CCAB43BA596494A635D07277E05C66EA7302D4C89BEC7C.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/025/805/385/5190049000025805385.20201102014719.01387306199490561604524463262719:50511116074733:2800:34811AFDC97AECA124CCAB43BA596494A635D07277E05C66EA7302D4C89BEC7C.png[/IMG]

Result code: 60006 (indicating that the product type is inconsistent with that defined in the PMS)

Search for the keyword hms_pay. The following log information will be found:

2020-09-30 15:05:08.560 21970-18765/? E/hms_pay: hms_pay [Network-Request]parse createOrder, responseCode = 6, subErrCode = 216, responseMessage = Product type doesn't match that in pms.

2020-09-30 15:05:08.560 21970-18765/? I/hms_pay: hms_pay baseBiz result:: get result Success

2020-09-30 15:05:08.561 21970-18765/? I/hms_pay: hms_pay createOrder onResponse responseCode:6,responseMessage:Product type doesn't match that in pms.

2020-09-30 15:05:08.561 21970-18765/? E/hms_pay: hms_pay createOrder fail, returnCode: 6

Incorrect Parameter Setting (setPriceType) for Subscriptions

Result code: -1 (indicating common failure)

Search for the keyword hms_pay. The following log information will be found:

2020-09-30 15:24:48.019 21970-23368/? E/hms_pay: hms_pay [Network-Request]parse createOrder, responseCode = 6, subErrCode = , responseMessage = App doesn't exist from pms.

2020-09-30 15:24:48.019 21970-23368/? I/hms_pay: hms_pay baseBiz result:: get result Success

2020-09-30 15:24:48.019 21970-23368/? I/hms_pay: hms_pay createOrder onResponse responseCode:6,responseMessage:App doesn't exist from pms.

2020-09-30 15:24:48.020 21970-23368/? E/hms_pay: hms_pay createOrder fail, returnCode: 6

For more details, you can go to:

Result code documentation:

https://developer.huawei.com/consumer/en/doc/HMSCore-References-V5/client-error-code-0000001050746111-V5