HMS Core In-App Purchases (IAP) provides a convenient in-app payment experience and easy access process for applications. The service supports both client and server development forms. For details, please refer to the official documentation .
Last time, we shared and summarized issues related to com.huawei.hmf.tasks.Task/application server verification, verification of failed token purchases, etc. Today, the editor once again summarizes some of the problems in the process of integrating in-app payment services that developers are more concerned about during this period, and proposes solutions. Take it as needed!
content
The sandbox account has been configured correctly, but cannot enter the sandbox environment
In which scenarios will you receive a subscription key event notification cancel?
What is the difference between payOrderId and orderId in InAppPurchaseData?
How to understand that the new subscription will not take effect until the next cycle?
Does the integration of smart screen account, in-app payment and other functions have to be debugged on the Huawei smart screen?
1. The sandbox account is configured correctly, but still cannot enter the sandbox environment
Sandbox environment testing allows developers to complete end-to-end testing without real payment during the joint debugging process of accessing in-app payment services. Developers can configure test accounts in AppGallery Connect and allow these accounts to perform sandbox testing. If you have entered the sandbox environment, the following page will prompt:
Prerequisites for configuring a sandbox environment:
Generally speaking, developers need to configure sandbox testing environment account and sandbox testing version. If the test account is configured correctly, there is a problem with the sandbox test version, for example, the versionName has been changed, but the versionCode has not been changed.
If there is a problem of not entering the sandbox environment, you can call the isSandBoxActivated interface to print out the following field values:
Through the above methods, we can analyze the specific reasons for not entering the sandbox environment. For more information, please refer to the official website
2. In which scenarios will I receive a subscription key event notification cancel?
When a subscription event cancel event occurs, there are generally the following two scenarios.
1) Call the subscription cancellation interface: In the case of receiving a user's complaint that the subscription type product was purchased by mistake or the subscription type commodity is not needed, the developer can call the subscription cancellation interface provided by the in-app payment server to terminate the service, and the purchased subscription type commodity Disappears immediately, and the subscription fee will be refunded immediately
For details, please visit the official website
2) Switching subscription will take effect immediately: the remaining amount of the user's original subscription will be converted into the number of days of the new subscription, and the validity period of the new subscription will be extended. At present, the triggering scenario of this switching effect is that the renewal period of the original subscription is the same as the renewal period of the subscription to be replaced.
For details, please visit the official website
3) The difference between the two: calling the cancellation interface will immediately refund the fee; switching the subscription to take effect immediately scenario will transfer the remaining equity value of the current subscription to the next subscription product, and no refund will be formed.
3. What is the difference between payOrderId and orderId in InAppPurchaseData?
1) payOrderId is the Huawei order number, that is, the order number generated by Huawei after the payment is successful. Each successful payment order will generate a unique order number.
2) orderId is the merchant request number. Every time the payment cashier interface is called, a unique merchant request number will be generated by the Huawei server, representing each request.
Therefore, if the Huawei cashier interface is called, the OrderId will be generated, and the PayOrderId will be generated only after the payment is successful.
4. How to understand that the new subscription will take effect in the next cycle?
The original subscription is set to expire, and the new subscription is pending. New subscriptions will be billed and take effect on the expiration date of the original subscription. At present, the triggering scenario of this switching effect is: the renewal period of the original subscription is different from the renewal period of the subscription to be replaced.
For details, please visit the official website
for example!
The user purchases product A with a subscription period of 1 month for 30 yuan on February 22, and purchases product B with a subscription period of 3 months for 80 yuan on March 10, then you can know:
1) On February 22, 30 yuan of product A will be deducted. On March 10, the contract for product B will be re-signed, and product B will not be deducted for the time being.
2) Product A will be set to expired state, that is, product A will expire on March 22 and will no longer be charged.
3) Product B will be effective and deducted on March 22, and the next deduction will be on June 22.
5. Does the integration of smart screen account, in-app payment and other functions have to be debugged on Huawei smart screen?
The smart screen test relies on the HMS Core TV APK. Without this APK, the corresponding integrated functions will not be available. Generally speaking, Huawei smart screens will be pre-installed with this system application. At this time, some developers will think, can they test the functions of smart screen accounts and in-app payment on mobile phones or other brands of TVs? The answer is no, for two reasons:
1) Due to Huawei's security and privacy regulations, the APK is not exposed to the public in principle.
2) Some capabilities of HMS Core depend on Huawei system, so it may not be available on other brands of TVs. After version 6.2.0.300, Huawei mobile phones cannot be used normally.
For more details of HMS Core in-app payment service, please refer to the official website of in-app payment service
Learn more details>>
Visit the official website of Huawei Developer Alliance
Get development guidance documents
Huawei Mobile Services Open Source Warehouse Address: GitHub , Gitee
Follow us to know the latest technical information of HMS Core for the first time~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。