Class OrderTransaction


public class OrderTransaction extends AuthorizationTransaction
This class is used to create and perform an Order Transaction for Express Checkout. *

An Order transaction represents an agreement to pay one or more authorized amounts up to the specified total over a maximum of 29 days. *

This example shows how to create and perform a order transaction as part of Express Checkout. *

.......... .......... //Populate required data objects. .......... .......... *

// Create a new Order Transaction. OrderTransaction Trans = new OrderTransaction( userInfo, PayflowConnectionData, Invoice, Tender, RequestId); //Submit the transaction. trans.submitTransaction(); *

// Get the Response. Response resp = trans.getResponse(); if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse trxnResponse = resp.transactionResponse(); // Display the transaction response parameters. if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse TrxnResponse = Resp.getTransactionResponse(); if (TrxnResponse != null) { System.out.println("RESULT = " + TrxnResponse.getResult()); System.out.println("RESPMSG = " + TrxnResponse.getRespMsg()); System.out.println("TOKEN = " + Trans.getResponse().getEcSetResponse().getToken()); System.out.println("CORRELATIONID = " + TrxnResponse.getCorrelationId()); // If value is true, then the Request ID has not been changed and the original response // of the original transction is returned. System.out.println("DUPLICATE = " + TrxnResponse.getDuplicate()); } // Get the Context and check for any contained SDK specific errors. Context ctx = resp.getTransactionContext(); if (ctx != null && ctx.getErrorCount() %3E 0) { System.out.println("Errors = " + ctx.ToString()); }

  • Constructor Details

    • OrderTransaction

      public OrderTransaction(UserInfo userInfo, PayflowConnectionData payflowConnectionData, Invoice invoice, PayPalTender tender, String requestId)
      Constructor.
      Parameters:
      userInfo - User Info object populated with user credentials.
      payflowConnectionData - Connection object.
      invoice - Invoice object.
      tender - Tender object
      requestId - String Request Id This example shows how to create and perform a authorization transaction. *

      .......... .......... //Populate required data objects. .......... .......... *

      // Create a new Order Transaction. OrderTransaction Trans = new OrderTransaction( userInfo, PayflowConnectionData, Invoice, Tender, RequestId); //Submit the transaction. trans.submitTransaction(); *

      // Get the Response. Response resp = trans.getResponse(); if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse trxnResponse = resp.transactionResponse(); // Display the transaction response parameters. if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse TrxnResponse = Resp.getTransactionResponse(); if (TrxnResponse != null) { System.out.println("RESULT = " + TrxnResponse.getResult()); System.out.println("RESPMSG = " + TrxnResponse.getRespMsg()); System.out.println("TOKEN = " + Trans.getResponse().getEcSetResponse().getToken()); System.out.println("CORRELATIONID = " + TrxnResponse.getCorrelationId()); // If value is true, then the Request ID has not been changed and the original response // of the original transction is returned. System.out.println("DUPLICATE = " + TrxnResponse.getDuplicate()); } // Get the Context and check for any contained SDK specific errors. Context ctx = resp.getTransactionContext(); if (ctx != null && ctx.getErrorCount() %3E 0) { System.out.println("Errors = " + ctx.ToString()); }

    • OrderTransaction

      public OrderTransaction(UserInfo userInfo, Invoice invoice, PayPalTender tender, String requestId)
      Constructor.
      Parameters:
      userInfo - User Info object populated with user credentials.
      invoice - Invoice object.
      tender - Tender object
      requestId - String Request Id This example shows how to create and perform a authorization transaction. *

      .......... .......... //Populate required data objects. .......... .......... *

      // Create a new Order Transaction. OrderTransaction Trans = new OrderTransaction( userInfo, Invoice, Tender, RequestId); //Submit the transaction. trans.submitTransaction(); *

      // Get the Response. Response resp = trans.getResponse(); if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse trxnResponse = resp.transactionResponse(); // Display the transaction response parameters. if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse TrxnResponse = Resp.getTransactionResponse(); if (TrxnResponse != null) { System.out.println("RESULT = " + TrxnResponse.getResult()); System.out.println("RESPMSG = " + TrxnResponse.getRespMsg()); System.out.println("TOKEN = " + Trans.getResponse().getEcSetResponse().getToken()); System.out.println("CORRELATIONID = " + TrxnResponse.getCorrelationId()); // If value is true, then the Request ID has not been changed and the original response // of the original transction is returned. System.out.println("DUPLICATE = " + TrxnResponse.getDuplicate()); } // Get the Context and check for any contained SDK specific errors. Context ctx = resp.getTransactionContext(); if (ctx != null && ctx.getErrorCount() %3E 0) { System.out.println("Errors = " + ctx.ToString()); }