private void requestPurchase(Intent intent, int startId) { string packageName = PackageName; string itemId = intent.GetStringExtra(EXTRA_ITEM_ID); string developerPayload = intent.GetStringExtra(EXTRA_DEVELOPER_PAYLOAD); RequestPurchase request = new RequestPurchase(packageName, startId, itemId, developerPayload); runRequestOrQueue(request); }
/// <summary> /// This is called when we receive a response code from Android Market for a /// RequestPurchase request that we made. This is used for reporting various /// errors and also for acknowledging that an order was sent successfully to /// the server. This is NOT used for any purchase state changes. All /// purchase state changes are received in the <seealso cref="BillingReceiver"/> and /// are handled in <seealso cref="Security#verifyPurchase(String, String)"/>. </summary> /// <param name="context"> the context </param> /// <param name="request"> the RequestPurchase request for which we received a /// response code </param> /// <param name="responseCode"> a response code from Market to indicate the state /// of the request </param> public static void responseCodeReceived(Context context, RequestPurchase request, ResponseCode responseCode) { if (sPurchaseObserver != null) { sPurchaseObserver.onRequestPurchaseResponse(request, responseCode); } }