protected internal override long Run()
{
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 = mService.SendBillingRequest(request);
PendingIntent pendingIntent = (PendingIntent)response.GetParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT);
if (pendingIntent == null)
{
Log.Error(TAG, "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);
}