当前位置: 首页>>代码示例>>C#>>正文


C# com.SendBillingRequest方法代码示例

本文整理汇总了C#中com.SendBillingRequest方法的典型用法代码示例。如果您正苦于以下问题:C# com.SendBillingRequest方法的具体用法?C# com.SendBillingRequest怎么用?C# com.SendBillingRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com的用法示例。


在下文中一共展示了com.SendBillingRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

		public override long Run(com.android.vending.billing.IMarketBillingService service)
		{
            Bundle request = makeRequestBundle("REQUEST_PURCHASE");
            request.PutString(Consts.BILLING_REQUEST_ITEM_ID, mProductId);
            request.PutString(Consts.BILLING_REQUEST_ITEM_TYPE, mProductType);
            // Note that the developer payload is optional.
            if (mDeveloperPayload != null) {
                request.PutString(Consts.BILLING_REQUEST_DEVELOPER_PAYLOAD, mDeveloperPayload);
            }

            Bundle response = service.SendBillingRequest(request);
						
            PendingIntent pendingIntent
                    = response.GetParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT) as PendingIntent;
            
			if (pendingIntent == null) 
			{
                Log.Error("BillingService", "Error with requestPurchase");
                return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
            }

            Intent intent = new Intent();
            ResponseHandler.buyPageIntentResponse(pendingIntent, intent);
            return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
                    Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
        }
开发者ID:ddebilt,项目名称:play.billing,代码行数:26,代码来源:RequestPurchase.cs

示例2: Run

		public override long Run(com.android.vending.billing.IMarketBillingService service)
		{
            Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS");
            request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds);
			Bundle response = service.SendBillingRequest(request);
            logResponseCode("confirmNotifications", response);
            return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
                    Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
        }
开发者ID:ddebilt,项目名称:play.billing,代码行数:9,代码来源:ConfirmNotifications.cs

示例3: Run

        public override long Run(com.android.vending.billing.IMarketBillingService service)
		{
            mNonce = Security.generateNonce();

            Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
            request.PutLong(Consts.BILLING_REQUEST_NONCE, mNonce);
            Bundle response = service.SendBillingRequest(request);
            logResponseCode("restoreTransactions", response);
            return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
                    Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
        }
开发者ID:ddebilt,项目名称:play.billing,代码行数:11,代码来源:RestoreTransactions.cs

示例4: Run

		public override long Run(com.android.vending.billing.IMarketBillingService service)
		{
            mNonce = Security.generateNonce();

            Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION");
            request.PutLong(Consts.BILLING_REQUEST_NONCE, mNonce);
            request.PutStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, mNotifyIds);
            Bundle response = service.SendBillingRequest(request);
            logResponseCode("getPurchaseInformation", response);
            return response.GetLong(Consts.BILLING_RESPONSE_REQUEST_ID,
                    Consts.BILLING_RESPONSE_INVALID_REQUEST_ID);
        }
开发者ID:ddebilt,项目名称:play.billing,代码行数:12,代码来源:GetPurchaseInformation.cs

示例5: Run

		public override long Run(com.android.vending.billing.IMarketBillingService service) 
		{
            Bundle request = makeRequestBundle("CHECK_BILLING_SUPPORTED");

			if (mItemType != null)
				request.PutString(Consts.BILLING_REQUEST_ITEM_TYPE, mItemType);
			
            Bundle response = service.SendBillingRequest(request);
            int responseCode = response.GetInt(Consts.BILLING_RESPONSE_RESPONSE_CODE);
            
			if (Consts.DEBUG) 
                Log.Info("BillingService", "CheckBillingSupported response code: " + responseCode.ToString());
                        
			bool billingSupported = (responseCode == (int)Consts.ResponseCode.RESULT_OK);
            ResponseHandler.checkBillingSupportedResponse(billingSupported);
            return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
        }
开发者ID:ddebilt,项目名称:play.billing,代码行数:17,代码来源:CheckBillingSupported.cs


注:本文中的com.SendBillingRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。