Package org.xrace.desjardins.trx

Examples of org.xrace.desjardins.trx.Request


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

      @Override
      public void setValue(java.lang.Object object, java.lang.Object value)
          throws IllegalStateException, IllegalArgumentException
      {
        try
        {
          Request target = (Request) object;
          target.setInput((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: _input
    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.setFixed("text");
      typeValidator.setWhiteSpace("preserve");
    }
    desc.setValidator(fieldValidator);
    //-- initialize element descriptors

    //-- _merchant
    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
        org.xrace.desjardins.trx.Merchant.class, "_merchant",
        "merchant", 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
      {
        Request target = (Request) object;
        return target.getMerchant();
      }

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


    getDesjardins3Service().processReturnDialog(responseString.toString());
  }

  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));
View Full Code Here

public class Desjardins3Helper
{
  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();
View Full Code Here

    BigDecimal amount = BigDecimal.valueOf(transaction.getFacture()
        .getTotal());
    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());
View Full Code Here

  public String runTrx(Transaction transaction)
  {
    Validate.notNull(transaction);

    Request loginRequest = Desjardins3Helper.toLoginRequest(transaction,
        context);

    Response loginResponse = requestResponse(loginRequest);

    Desjardins3LoginContext loginContext = Desjardins3Helper
        .toLoginContext(loginResponse);

    Request purchaseRequest = Desjardins3Helper.toPurchaseRequest(
        transaction, context, loginContext);

    String purchaseResponse = requestResponseString(purchaseRequest);
    String url = getTransactionURL(purchaseResponse);
View Full Code Here

TOP

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

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.