private void GetMerchantsPageAndFill(int page) { MerchantElement[] merchantsList = merchantListParent.GetComponentsInChildren <MerchantElement>(false); foreach (var m in merchantsList) { DestroyImmediate(m.gameObject); } GetMerchantsRequest request = new GetMerchantsRequest() { CustomerKey = MundiPaggSession.CurrentSession.CustomerKey, PageNumber = page, PageSize = 10 }; MundiPaggClientAPI.GetMerchants(request, result => { merchantsResult = result; SetupMerchantsResult(); UpdatePaginationView(); }, error => { MessagePopup.Open(error.ErrorCode.ToString(), error.GetErrorMessage()); } ); }
private void OpenAndSetupSalePopup() { salePopup.Open(); salePopup.OnSaleClick = creditCardTransaction => { SaleRequest request = new SaleRequest() { MerchantKey = currentMerchant.MerchantKey, CreditCardTransactionCollection = new CreditCardTransaction[] { creditCardTransaction } }; MundiPaggClientAPI.Sale(request, result => { salePopup.Close(); float transactionCost = creditCardTransaction.AmountInCents / 100f; CreditCardTransactionResult transactionResult = result.CreditCardTransactionResultCollection[0]; if (transactionResult.Success) { MessagePopup.Open("Sucesso", string.Format("Compra de R$ {0:0.00} efetuada com sucesso!", transactionCost)); } else { MessagePopup.Open("Erro", transactionResult.AcquirerMessage); } }, error => { MessagePopup.Open(error.ErrorCode.ToString(), error.GetErrorMessage()); } ); }; }
private void OnDeployButton() { if (agentWayPointManager.IsHolding (SyncData.CurrentMainBase.Position.Parse3Int().ToClientPosition())) { //Debugger.Log("Has a agent on base"); MessagePopup.Open("Has a agent on base"); return; } if (refTag != null && refTag.Slider.Value > 0) { Singleton.Instance <EventListenersController>().Emit("S_DEPLOY"); DecreaseQuality(); Close(); } }
private void R_CREATE_GUILD(SocketIOEvent obj) { Debugger.Log(obj); int success = -1; obj.data["R_CREATE_GUILD"].GetField(ref success, "Enum"); if (success == 1) { int cost = 500; PlayerInfo.Info.Diamond -= cost; } else { string msg = ""; obj.data["R_CREATE_GUILD"].GetField(ref msg, "Message"); MessagePopup.Open(msg); } }
public void StartLogin() { string username = usernameField.text; string password = passwordField.text; LoginRequest request = new LoginRequest() { Username = username, Password = password }; MundiPaggClientAPI.Login(request, result => { usernameField.text = string.Empty; passwordField.text = string.Empty; ScreenManager.instance.ChangeScreen(nextScreenId); }, error => { MessagePopup.Open(error.ErrorCode.ToString(), error.GetErrorMessage()); } ); }