/// <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);
     }
 }
        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);
        }
Example #3
0
        /// <summary>
        /// Handles the <see cref="Control.MouseUp"/> event from the <see cref="ShopItemPB"/>s on this form.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
        void ShopItemPB_OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            var src = (ShopItemPB)sender;

            if (src.ItemInfo != null)
            {
                if (RequestPurchase != null)
                {
                    RequestPurchase.Raise(this, EventArgsHelper.Create(src.Slot));
                }
            }
        }
Example #4
0
        public static void insertReqPurchase(string detil, DateTime needDate, string time)
        {
            RequestPurchase newRp = new RequestPurchase();

            newRp.EmployeeId            = LoginHandler.idEmp;
            newRp.RequestPurchaseDetail = detil;
            newRp.RequestPurchaseDate   = DateTime.Now;
            newRp.PurchaseTimeNeed      = time;
            newRp.RequestPurchaseStatus = "Waiting Approval";

            DatabaseConnectionHandler.GetInstance().RequestPurchase.Add(newRp);
            DatabaseConnectionHandler.GetInstance().SaveChanges();
        }
 /// <summary>
 /// This is called when we receive a response code from Market for a
 /// RequestPurchase request that we made.  This is NOT used for any
 /// purchase state changes.  All purchase state changes are received in
 /// <seealso cref="#onPurchaseStateChange(PurchaseState, String, int, long)"/>.
 /// This is used for reporting various errors, or if the user backed out
 /// and didn't purchase the item.  The possible response codes are:
 ///   RESULT_OK means that the order was sent successfully to the server.
 ///       The onPurchaseStateChange() will be invoked later (with a
 ///       purchase state of PURCHASED or CANCELED) when the order is
 ///       charged or canceled.  This response code can also happen if an
 ///       order for a Market-managed item was already sent to the server.
 ///   RESULT_USER_CANCELED means that the user didn't buy the item.
 ///   RESULT_SERVICE_UNAVAILABLE means that we couldn't connect to the
 ///       Android Market server (for example if the data connection is down).
 ///   RESULT_BILLING_UNAVAILABLE means that in-app billing is not
 ///       supported yet.
 ///   RESULT_ITEM_UNAVAILABLE means that the item this app offered for
 ///       sale does not exist (or is not published) in the server-side
 ///       catalog.
 ///   RESULT_ERROR is used for any other errors (such as a server error).
 /// </summary>
 public abstract void onRequestPurchaseResponse(RequestPurchase request, ResponseCode responseCode);