UpdateElement() public method

public UpdateElement ( String name, String newValue ) : void
name String
newValue String
return void
Esempio n. 1
0
 public new void OnFormReceived(XsollaForm form)
 {
     XsollaForm.CurrentCommand command = form.GetCurrentCommand ();
     switch (command) {
         case XsollaForm.CurrentCommand.FORM:
                 XsollaError error = form.GetError();
                 if (!form.IsValidPaymentSystem ()) {
                     OnErrorReceived (XsollaError.GetUnsuportedError ());
                 } else if (error == null) {
                     form.UpdateElement (XsollaApiConst.CARD_NUMBER, _cardNumber);
                     form.UpdateElement (XsollaApiConst.CARD_EXP_YEAR, _cardExpYear);
                     form.UpdateElement (XsollaApiConst.CARD_EXP_MONTH, _cardExpMonth);
                     form.UpdateElement (XsollaApiConst.CARD_CVV, _cardCvv);
                     form.UpdateElement (XsollaApiConst.CARD_ZIP, _cardZip);
                     form.UpdateElement (XsollaApiConst.CARD_HOLDER, _cardHolder);
                     NextStep (form.GetXpsMap());
                 } else {
                     OnErrorReceived (error);
                 }
             break;
         case XsollaForm.CurrentCommand.CHECK:
             if(form.GetItem(XsollaApiConst.CARD_ZIP) != null)
             {
                 form.UpdateElement (XsollaApiConst.CARD_ZIP, _cardZip);
                 NextStep (form.GetXpsMap());
             } else {
                 OnNextStepRecieved(form);
             }
             break;
         case XsollaForm.CurrentCommand.ACCOUNT:
         case XsollaForm.CurrentCommand.STATUS:
         case XsollaForm.CurrentCommand.CREATE:
         default:
             break;
     }
 }
Esempio n. 2
0
        public new void OnFormReceived(XsollaForm form)
        {
            XsollaForm.CurrentCommand command = form.GetCurrentCommand();
            switch (command)
            {
            case XsollaForm.CurrentCommand.FORM:
                XsollaError error = form.GetError();
                if (!form.IsValidPaymentSystem())
                {
                    OnErrorReceived(XsollaError.GetUnsuportedError());
                }
                else if (error == null)
                {
                    form.UpdateElement(XsollaApiConst.CARD_NUMBER, _cardNumber);
                    form.UpdateElement(XsollaApiConst.CARD_EXP_YEAR, _cardExpYear);
                    form.UpdateElement(XsollaApiConst.CARD_EXP_MONTH, _cardExpMonth);
                    form.UpdateElement(XsollaApiConst.CARD_CVV, _cardCvv);
                    form.UpdateElement(XsollaApiConst.CARD_ZIP, _cardZip);
                    form.UpdateElement(XsollaApiConst.CARD_HOLDER, _cardHolder);
                    NextStep(form.GetXpsMap());
                }
                else
                {
                    OnErrorReceived(error);
                }
                break;

            case XsollaForm.CurrentCommand.CHECK:
                if (form.GetItem(XsollaApiConst.CARD_ZIP) != null)
                {
                    form.UpdateElement(XsollaApiConst.CARD_ZIP, _cardZip);
                    NextStep(form.GetXpsMap());
                }
                else
                {
                    OnNextStepRecieved(form);
                }
                break;

            case XsollaForm.CurrentCommand.ACCOUNT:
            case XsollaForm.CurrentCommand.STATUS:
            case XsollaForm.CurrentCommand.CREATE:
            default:
                break;
            }
        }
Esempio n. 3
0
 private void OnValueChange(InputField _input, string elemName)
 {
     _form.UpdateElement(elemName, _input.text);
 }
//		void ValidateCard(InputField _inputField){
//			string text = _inputField.text;
//		}

        public void OnEndEdit(XsollaFormElement element, InputField _input)
        {
            form.UpdateElement(element.GetName(), _input.text);
        }