Package org.xrace.desjardins.trx

Examples of org.xrace.desjardins.trx.Merchant


  }

  public void testPurchaseRequest() throws Exception
  {
    Request request = new Request();
    Merchant merchant = new Merchant();
    merchant.setId("24");
    merchant.setKey(StringUtils.repeat("1", 32));
    request.setMerchant(merchant);

    Transactions transactions = new Transactions();
    Transaction transaction = new Transaction();
    transaction.setId("test_1");
    transaction.setKey(StringUtils.repeat("2", 32));
    transaction.setType(TransactionTypeType.PURCHASE);
    transaction.setCurrency("CAD");
    transaction.setCurrencyText("$CAD");
    transaction.setAmount(1200);
    transaction.setLanguage(LanguageType.FR);
    transaction.setCustomer_email("shbehna@gmail.com");
    transactions.addTransaction(transaction);
    merchant.setTransactions(transactions);

    Urls urls = new Urls();
    Url url = new Url();
    url.setName(UrlNameType.RESPONSE);
    url.setPath("http://192.168.0.1/");
View Full Code Here


  public static Request toLoginRequest(Transaction transaction,
      Desjardins3GlobalContext context)
  {
    Request request = new Request();
    request.setInput(null);
    Merchant merchant = new Merchant();
    merchant.setKey(context.getMerchantKey());
    request.setMerchant(merchant);

    Login login = new Login();
    merchant.setLogin(login);

    Trx trx = new Trx();
    trx.setId(context.getTxIdPrefix() + transaction.getId().toString());
    login.setTrx(new Trx[]
    { trx });
View Full Code Here

    BigInteger amountInt = amount.multiply(BigDecimal.valueOf(100))
        .toBigInteger();

    Request purchaseRequest = new Request();
    purchaseRequest.setInput(null);
    Merchant merchant = new Merchant();
    merchant.setId(loginContext.getMerchantId());
    merchant.setKey(globalContext.getMerchantKey());
    purchaseRequest.setMerchant(merchant);

    Transactions transactions = new Transactions();
    org.xrace.desjardins.trx.Transaction trxDesjardins = new org.xrace.desjardins.trx.Transaction();
    trxDesjardins.setId(globalContext.getTxIdPrefix()
        + transaction.getId().toString());
    trxDesjardins.setKey(loginContext.getTransactionKey());
    trxDesjardins.setType(TransactionTypeType.PURCHASE);
    trxDesjardins.setCurrency("CAD");
    trxDesjardins.setCurrencyText("$CAD");
    trxDesjardins.setAmount(amountInt.longValue());
    trxDesjardins.setLanguage(LanguageType.FR);
    transactions.addTransaction(trxDesjardins);
    merchant.setTransactions(transactions);

    Urls urls = new Urls();
    Url urlResponse = new Url();
    urlResponse.setName(UrlNameType.RESPONSE);
    urlResponse.setPath(globalContext.getUrlresponse());
View Full Code Here

    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getId();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target.setId((java.lang.String) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
      }

      @Override
      public java.lang.Object newInstance(java.lang.Object parent)
      {
        return null;
      }
    };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    //-- validation code for: _id
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    { //-- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
      typeValidator.setMinLength(1);
    }
    desc.setValidator(fieldValidator);
    //-- _key
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        java.lang.String.class, "_key", "key",
        org.exolab.castor.xml.NodeType.Attribute);
    desc.setImmutable(true);
    handler = new org.exolab.castor.xml.XMLFieldHandler()
    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getKey();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target.setKey((java.lang.String) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
      }

      @Override
      public java.lang.Object newInstance(java.lang.Object parent)
      {
        return null;
      }
    };
    desc.setSchemaType("string");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);

    //-- validation code for: _key
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { //-- local scope
      org.exolab.castor.xml.validators.StringValidator typeValidator;
      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
      fieldValidator.setValidator(typeValidator);
      typeValidator.setWhiteSpace("preserve");
      typeValidator.setLength(32);
    }
    desc.setValidator(fieldValidator);
    //-- initialize element descriptors

    //-- _transactions
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        org.xrace.desjardins.trx.Transactions.class, "_transactions",
        "transactions", org.exolab.castor.xml.NodeType.Element);
    handler = new org.exolab.castor.xml.XMLFieldHandler()
    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getTransactions();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target
              .setTransactions((org.xrace.desjardins.trx.Transactions) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
      }

      @Override
      public java.lang.Object newInstance(java.lang.Object parent)
      {
        return null;
      }
    };
    desc.setSchemaType("org.xrace.desjardins.trx.Transactions");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    //-- validation code for: _transactions
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { //-- local scope
    }
    desc.setValidator(fieldValidator);
    //-- _templates
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        org.xrace.desjardins.trx.Templates.class, "_templates",
        "templates", org.exolab.castor.xml.NodeType.Element);
    handler = new org.exolab.castor.xml.XMLFieldHandler()
    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getTemplates();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target
              .setTemplates((org.xrace.desjardins.trx.Templates) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
      }

      @Override
      public java.lang.Object newInstance(java.lang.Object parent)
      {
        return null;
      }
    };
    desc.setSchemaType("org.xrace.desjardins.trx.Templates");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    //-- validation code for: _templates
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { //-- local scope
    }
    desc.setValidator(fieldValidator);
    //-- _classes
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        org.xrace.desjardins.trx.Classes.class, "_classes", "classes",
        org.exolab.castor.xml.NodeType.Element);
    handler = new org.exolab.castor.xml.XMLFieldHandler()
    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getClasses();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target.setClasses((org.xrace.desjardins.trx.Classes) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
      }

      @Override
      public java.lang.Object newInstance(java.lang.Object parent)
      {
        return null;
      }
    };
    desc.setSchemaType("org.xrace.desjardins.trx.Classes");
    desc.setHandler(handler);
    desc.setRequired(true);
    desc.setMultivalued(false);
    addFieldDescriptor(desc);
    addSequenceElement(desc);

    //-- validation code for: _classes
    fieldValidator = new org.exolab.castor.xml.FieldValidator();
    fieldValidator.setMinOccurs(1);
    { //-- local scope
    }
    desc.setValidator(fieldValidator);
    //-- _login
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        org.xrace.desjardins.trx.Login.class, "_login", "login",
        org.exolab.castor.xml.NodeType.Element);
    handler = new org.exolab.castor.xml.XMLFieldHandler()
    {
      @Override
      public java.lang.Object getValue(java.lang.Object object)
          throws IllegalStateException
      {
        Merchant target = (Merchant) object;
        return target.getLogin();
      }

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Merchant target = (Merchant) object;
          target.setLogin((org.xrace.desjardins.trx.Login) value);
        }
        catch (java.lang.Exception ex)
        {
          throw new IllegalStateException(ex.toString());
        }
View Full Code Here

TOP

Related Classes of org.xrace.desjardins.trx.Merchant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.