Exemplo n.º 1
0
        public void SendData(ButtonClickEvent e, SingleNode <ContinueButtonComponent> button, [JoinByScreen] SingleNode <QiwiWalletScreenComponent> screen, [JoinAll] SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod, [JoinAll] SingleNode <ClientSessionComponent> session)
        {
            QiwiProcessPaymentEvent eventInstance = new QiwiProcessPaymentEvent {
                Account = screen.component.Account
            };

            Node[] nodes = new Node[] { selectedGood, selectedMethod };
            base.NewEvent(eventInstance).AttachAll(nodes).Schedule();
            screen.Entity.AddComponent <LockedScreenComponent>();
        }
        public void InitScreen(NodeAddedEvent e, SingleNode <MobilePaymentCheckoutScreenComponent> screen, [JoinAll] SingleNode <MobilePaymentDataComponent> mobilePayment, [JoinAll] SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod)
        {
            double price = selectedGood.goodsPrice.Price;

            price = !selectedGood.Entity.HasComponent <SpecialOfferComponent>() ? selectedGood.goodsPrice.Round(selectedGood.goods.SaleState.PriceMultiplier * price) : selectedGood.Entity.GetComponent <SpecialOfferComponent>().GetSalePrice(price);
            screen.component.SetPrice(price, selectedGood.goodsPrice.Currency);
            base.DeleteEntity(mobilePayment.Entity);
            screen.component.SetTransactionNumber(mobilePayment.component.TransactionId);
            screen.component.SetPhoneNumber(mobilePayment.component.PhoneNumber);
        }
Exemplo n.º 3
0
        public void InitScreen(NodeAddedEvent e, SingleNode <QiwiWalletScreenComponent> screen, UserNode user, SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod)
        {
            double price = selectedGood.goodsPrice.Price;

            price = !selectedGood.Entity.HasComponent <SpecialOfferComponent>() ? selectedGood.goodsPrice.Round(selectedGood.goods.SaleState.PriceMultiplier * price) : selectedGood.Entity.GetComponent <SpecialOfferComponent>().GetSalePrice(price);
            screen.component.Receipt.SetPrice(price, selectedGood.goodsPrice.Currency);
        }
Exemplo n.º 4
0
        public void SendData(ButtonClickEvent e, SingleNode <ContinueButtonComponent> button, [JoinByScreen] SingleNode <MobilePaymentScreenComponent> screen, [JoinAll] SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod, [JoinAll] SingleNode <ClientSessionComponent> session)
        {
            string str = screen.component.PhoneCountryCode + screen.component.PhoneNumber.Replace(" ", string.Empty);
            MobilePaymentDataComponent component = new MobilePaymentDataComponent {
                PhoneNumber = str
            };

            base.CreateEntity("MobilePayment").AddComponent(component);
            PlatBoxBuyGoodsEvent eventInstance = new PlatBoxBuyGoodsEvent {
                Phone = str
            };

            Entity[] entities = new Entity[] { selectedGood.Entity, selectedMethod.Entity };
            base.NewEvent(eventInstance).AttachAll(entities).Schedule();
            base.ScheduleEvent <ShowScreenLeftEvent <PaymentProcessingScreenComponent> >(screen);
            PaymentStatisticsEvent event3 = new PaymentStatisticsEvent {
                Action = PaymentStatisticsAction.PROCEED,
                Item   = selectedGood.Entity.Id,
                Screen = screen.component.gameObject.name,
                Method = selectedMethod.Entity.Id
            };

            base.ScheduleEvent(event3, session);
        }
Exemplo n.º 5
0
        public void InitScreen(NodeAddedEvent e, SingleNode <MobilePaymentScreenComponent> screen, SingleNode <PhoneCodesComponent> phoneCodes, UserNode user, SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod)
        {
            screen.component.PhoneCountryCode = phoneCodes.component.Codes[user.userCountry.CountryCode];
            double price = selectedGood.goodsPrice.Price;

            price = !selectedGood.Entity.HasComponent <SpecialOfferComponent>() ? selectedGood.goodsPrice.Round(selectedGood.goods.SaleState.PriceMultiplier * price) : selectedGood.Entity.GetComponent <SpecialOfferComponent>().GetSalePrice(price);
            screen.component.Receipt.SetPrice(price, selectedGood.goodsPrice.Currency);
        }
Exemplo n.º 6
0
        public void SendData(ButtonClickEvent e, SingleNode <ContinueButtonComponent> button, [JoinByScreen] SingleNode <BankCardPaymentScreenComponent> screen, [JoinAll] SelectedGoodNode selectedGood, [JoinAll] SelectedMethodNode selectedMethod, [JoinAll] SingleNode <AdyenPublicKeyComponent> adyenProvider, [JoinAll] SingleNode <ClientSessionComponent> session)
        {
            BankCardPaymentScreenComponent component = screen.component;
            Card card = new Card {
                number      = component.Number.Replace(" ", string.Empty),
                expiryMonth = int.Parse(component.MM).ToString(),
                expiryYear  = "20" + component.YY,
                holderName  = component.CardHolder,
                cvc         = component.CVC
            };
            AdyenBuyGoodsByCardEvent eventInstance = new AdyenBuyGoodsByCardEvent {
                EncrypedCard = new Encrypter(adyenProvider.component.PublicKey).Encrypt(card.ToString())
            };

            Entity[] entities = new Entity[] { selectedGood.Entity, selectedMethod.Entity };
            base.NewEvent(eventInstance).AttachAll(entities).Schedule();
            base.ScheduleEvent <ShowScreenLeftEvent <PaymentProcessingScreenComponent> >(screen);
            PaymentStatisticsEvent event3 = new PaymentStatisticsEvent {
                Action = PaymentStatisticsAction.PROCEED,
                Item   = selectedGood.Entity.Id,
                Screen = screen.component.gameObject.name,
                Method = selectedMethod.Entity.Id
            };

            base.ScheduleEvent(event3, session);
        }
Exemplo n.º 7
0
        public void InitScreenPrice(NodeAddedEvent e, SingleNode <BankCardPaymentScreenComponent> screen, SelectedGoodNode selectedGood)
        {
            double price = selectedGood.goodsPrice.Price;

            price = !selectedGood.Entity.HasComponent <SpecialOfferComponent>() ? selectedGood.goodsPrice.Round(selectedGood.goods.SaleState.PriceMultiplier * price) : selectedGood.Entity.GetComponent <SpecialOfferComponent>().GetSalePrice(price);
            screen.component.Receipt.SetPrice(price, selectedGood.goodsPrice.Currency);
        }