During the sandbox payment test, the server performs the order token verification, and the verification fails with an error code of 8 - huawei-mobile-services

During the sandbox payment test, the server performs the order token verification, and the verification fails with an error code of 8. Because the product is not owned, the consumption or confirmation fails.
May I ask whether the token verification cannot be performed under the sandbox payment test?

Generally erroCode:8 returns due to a user failed to consume or confirm a product because the user does not own the product.
Please check that product is already purchased , if it is already purchased, please check and consume product by calling the consumeOwnedPurchase API to consume the product and send a notification to the Huawei IAP server to update the delivery status ,purchaseToken is passed in the API call request. After the consumption is complete, the Huawei IAP server resets the product status to available for purchase. Then the product can be purchased again.
For more details , please refer the below link:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/api-purchase-confirm-for-order-service-0000001051066054-V5

Related

How can I restore Non-Consumable IAP services from HMS IAP server side?

I am implementing HMS plugins to show ads and IAP service for my app through Unity. Everything is fine, ads and IAP are both working fine.
There is one thing that I cannot figure out and that is when I purchase a non-consumable IAP product, the app works fine but when the next time I want to restore that IAP purchase, nothing came back from the server. How can I get all of my IAP data that a user make from that app? And how should I handle non-consumable IAP from my side? Please help.
If you want to restore non-consumable after payment completed, HMS Core (APK) returns a purchase order details JSON string InAppPurchaseData and a signature string inAppDataSignature.
The app can verify the signature string to ensure the accuracy of the order details. If the app has high-security requirements and needs to verify order information on the Huawei IAP server, the app can parse the purchase token parameter from InAppPurchaseData and call below API to send a verification request to Huawei IAP server. The purchase token parameter is used to uniquely identify the mapping between a product and a user.
Server-side API
POST /applications/purchases/tokens/verify Content-Type: application/json;
charset=UTF-8 Authorization:
BasicQVQ6Q1YzQ1NPbVlBaGwrZUtRWExtMTBVV2pyWXZHTVF4MmYvcVMya1B0ZElLY3UwaFJrdFNTMmxwdk1FQkIyY
ldXWGt0REVaR3I4UjFUTTRLMVlmNXdwWU80RG04THdXQWxjaFhEYjBMUjBNTUJtWnFYcGFtazc3THN3UnFJbkhHK28
xekdqRzNSMg== Accept: application/json Content-Length: 143 { "purchaseToken":
"00000173741056a37eef310dff9c6a86fec57efafe318ae478e52d9c4261994d64c8f6fc8ea1abbdx5347.5.3
089", "productId": "prd1" }
API-ObtainOwnedPurchases:
Queries information about all purchased in-app products, including consumables, non-consumables, and auto-renewable subscriptions.
● When an app launches, the obtainOwnedPurchases API is called to check whether the delivery failure occurs. If so, redeliver the corresponding products. After the successful redelivery, the consumeOwnedPurchase API is called to consume them.
● If an exception occurs during payment, the obtainOwnedPurchases API is called to check whether the payment is successful. If the delivery failure occurs, redeliver the corresponding product.
● If a product has been purchased but is not consumed, error code 60051 is returned during the payment. In this case, the obtainOwnedPurchases API is called to check whether the delivery failure occurs. If so, redeliver the corresponding product.

sandbox : how to get paypal payment details if failed to return back? -PHP

I am using Paypal Sandbox for at my site to process payments.
I am saving payment stuffs after the user returned successfully to the store using an URL defined for payment successful/canceled.
But suppose the user loses connection due to any technical issue (e.g. server down or failed internet connection), then how I will get the payment details, especially in cases of the paid orders?
Hi please check this below URL
https://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/checkout-and-payment-with-paypal

Handle recurring payments with paypal

I'am having troubles about how to handle the paypal recurrent payment system.
I followed every instruction in the website, but once i create the profile, paypal puts it in pending, making me doubt about the reliability of the service itself.
I tried to look over the internet but i didn't really get how this should work...
i made the first call with SetExpressCheckout in order to create the request, when the token is returned, i send the token to the paypal page, the user confirms the payment, then i call the CreateRecurringPaymentsProfile method to confirm the operation (passing PAYERID and TOKEN and setting the AMT value for the first payment and the PROFILESTARTDATE as now +1 month for the future payments)
Now when i try to read the response from the last call (or if i go to the buyer/seller paypal account) i see that the payment is in pending and i have to wait an undefined amount of time before this payment is activated.
Now the real question is: can i trust the fact that even if the payment is in pending, i'll receive the payment and so i can set set the user as member or i have to check and wait until the status is 'active' with the GetRecurringPaymentsProfileDetails method?
PS: i'm doing this in the sandbox version, maybe the official version is a bit faster and more reliable?
Thank you!
In Sandbox as in Live when you call CreateRecurringPaymentsProfile you will also get the response in which it will give you the status of the profile (ActiveProfile or PendingProfile). When the status is in Penidng it means that the system is in process of creating the recurring payment profile. You can then check your IPN messages for an update. It is normal but obviously if you notice that all the profiles you create get into Pending and never activate then there could be a bug but should not be the case. In here is the PayPal technical guide for this API: https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/

Can ExpressCheckout identify if the transaction is approved?

Some time ago I developed a custom shopping cart for a simple website which sell mainly digital goods. I integrated ExpressCheckout on it, and after the DoExpressCheckout operation, if the response contains ACK equal to Success or SuccessWithWarning (just as the sample code at that time says) then I immediately set access to the content for the user.
I see this is a great mistake, since yesterday a transaction did not appear at the owner's account, but appears in the site since user had access. After contacting PayPal we checked this particular transaction was denied. To late, since access was already granted to the user.
So what should I do? Is it because of the SucessWithWarning not reviewed, or never I should grant access to a user just by finishing DoExpressCheckout? Shall I use IPN to receive information about the transaction to only after grant the user access to the content?
Yes, you'll want to use IPN for post-transaction processing, and you'll only want to grant access once the payment status is completed.
In the case of an e-check you'll get an IPN with a status of pending, and then you'll get another IPN with updated status once that e-check clears (or fails).
Of course, this happens in real-time so you can automate the process accordingly based on the data sent.

Receipt Verification for Auto-Renewable Subscription in iOS

In my application I am using Auto-Renewable Transection. Now I have some queries in it. I have read steps for receipt verification in Apple Documentation and also refer lot's of blogs but I am not Clear about the following my scenario which I can't get.
i.e I am subscribing for 1 month and after completion of that transection I get receipt of that transection. I am verifying it successfully. Now I need to send receipt parameter to my web service That I am sending If receipt status is '0' mean receipt is verified. Now I want to verify receipt at every time once I am starting of application that receipt is verified or not I yes the send parameter to web services and if not then send false parameter to web service.
1). Is it ok if I save receipt on completion of transection and verify that receipt at every time when app start. But will it work. Will it give me latest parameter in response. i.e if one month completed then expire date and purchase date para change so that will take effect on it.
Please suggest me the best way so That I can continues check the status of receipt and can call web services as best as I can.
Thanks In Advance