C# 使用Windows Phone 8报告产品履行情况

C# 使用Windows Phone 8报告产品履行情况,c#,windows-phone-8,in-app-purchase,in-app-billing,fulfillment,C#,Windows Phone 8,In App Purchase,In App Billing,Fulfillment,我的WP8应用程序已在应用程序内购买耗材。据我所知,您必须在商品交付后向市场报告产品的履行情况 await CurrentApp.RequestProductPurchaseAsync(productId, false); if (CurrentApp.LicenseInformation.ProductLicenses[productId].IsActive) { // Report fulfillment CurrentApp.ReportProductFulfillme

我的WP8应用程序已在应用程序内购买耗材。据我所知,您必须在商品交付后向市场报告产品的履行情况

await CurrentApp.RequestProductPurchaseAsync(productId, false);
if (CurrentApp.LicenseInformation.ProductLicenses[productId].IsActive)
{
     // Report fulfillment
     CurrentApp.ReportProductFulfillment(productId);
     ------------
}
所以我的问题是,如果我不能怎么办?例如,如果没有互联网连接

我看到的任何示例代码都会检索产品列表,然后调用
RequestProductPurchaseAsync
,然后直接在
ReportProductFulfillment

基本上我想两者都成功或者两者都不成功。。。如果
RequestProductPurchaseAsync
成功,是否意味着即使我没有报告履行情况,客户也要付费

或者我应该检查相关许可证的
CurrentApp.LicenseInformation
,如果
IsActive
为真,那么我可以放心地假设购买成功,然后我应该报告完成情况。但是,我需要一种方法来知道实现是否也成功,这样,如果需要,我可以再试一次

希望这是有意义的,如果有人有任何想法或可以告诉我一些材料的阅读方向,我将不胜感激。谢谢。

我就是这样做的:

如果没有网络,您甚至不会继续购买体验,或者用户取消购买请求ProductPurchaseAsync将抛出异常,您应该捕获该异常并进行适当处理。如果用户购买了物品,则应立即完成

await CurrentApp.RequestProductPurchaseAsync(productId, false);
if (CurrentApp.LicenseInformation.ProductLicenses[productId].IsActive)
{
     // Report fulfillment
     CurrentApp.ReportProductFulfillment(productId);
     ------------
}

您可以做的不是检查许可证是否处于活动状态,而是:

PurchaseResults receipt = await CurrentApp.RequestProductPurchaseAsync(pID);
string status = receipt.Status.ToString();
if(status == "succeeded")
{
 // do your stuff
}