Class CaptureTransaction


public final class CaptureTransaction extends ReferenceTransaction
This class is used to perform a capture transaction.

Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

// Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Connection, PayflowUtility.getrequestId(); *

// Submit the transaction. Response resp = trans.SubmitTransaction(); *

if (Resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse(); if (TrxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

// 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()); }

  • Field Details

    • captureComplete

      public String captureComplete
      Complete type for a capture. Y or N.
  • Constructor Details

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, PayflowConnectionData payflowConnectionData, Invoice Invoice, String requestId)
      Parameters:
      origId - String Original Transaction Id
      userInfo - UserInfo object populated with user credentials.
      payflowConnectionData - PayflowConnectionData Connection credentials object.
      Invoice - Invoice object.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

      *

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

      // Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Connection, Inv, PayflowUtility.requestId); *

      // Submit the transaction. Response resp = trans.SubmitTransaction(); *

      if (resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse(); if (trxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      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()); }

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, Invoice invoice, String requestId)
      Parameters:
      origId - Original Transaction Id.
      userInfo - UserInfo object populated with user credentials.
      invoice - Invoice object.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

      // Create a new Capture Transaction. CaptureTransaction Trans = new CaptureTransaction("PNRef of Authorization transaction", User, Inv, PayflowUtility.requestId); *

      // Submit the transaction. Response resp = trans.submitTransaction(); *

      if (resp != null) { TransactionResponse trxnResponse = Resp.TransactionResponse; if (trxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      // 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()); }

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, PayflowConnectionData PayflowConnectionData, Invoice invoice, BaseTender tender, String requestId)
      Parameters:
      origId - Original Transaction Id.
      userInfo - User Info object populated with user credentials.
      PayflowConnectionData - Connection credentials object.
      invoice - Invoice object.
      tender - BaseTender object.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

      // Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Connection, Inv, tender, PayflowUtility.requestId); *

      // Submit the transaction. Response Resp = Trans.submitTransaction(); *

      if (resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse(); if (trxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      // 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()); }

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, Invoice invoice, BaseTender tender, String requestId)
      Parameters:
      origId - Original Transaction Id.
      userInfo - User Info object populated with user credentials.
      invoice - Invoice object.
      tender - BaseTender object.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

      // Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Inv, tender, PayflowUtility.requestId); *

      // Submit the transaction. Response resp = trans.submitTransaction(); *

      if (Resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse; if (trxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      // 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()); }

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, PayflowConnectionData payflowConnectionData, String requestId)
      Parameters:
      origId - Original Transaction Id.
      userInfo - User Info object populated with user credentials.
      payflowConnectionData - Connection credentials object.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

      // Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Connection, PayflowUtility.getrequestId()); *

      // Submit the transaction. Response resp = trans.submitTransaction(); *

      if (Resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse(); if (TrxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      // 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()); }

    • CaptureTransaction

      public CaptureTransaction(String origId, UserInfo userInfo, String requestId)
      Parameters:
      origId - Original Transaction Id.
      userInfo - UserInfo object populated with user credentials.
      requestId - Request Id.

      Capture transaction needs to be performed on a successful authorization transaction in order to capture the amount. Therefore, a capture transaction always takes the PNRef of a authorization transaction.

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

      // Create a new Capture Transaction. CaptureTransaction trans = new CaptureTransaction("PNRef of Authorization transaction", User, Connection, PayflowUtility.getrequestId()); *

      // Submit the transaction. Response Resp = trans.submitTransaction(); *

      if (Resp != null) { TransactionResponse trxnResponse = resp.getTransactionResponse(); if (trxnResponse != null) { System.out.println("RESULT = " + trxnResponse.getResult()); System.out.println("PNREF = " + trxnResponse.getPnref()); System.out.println("RESPMSG = " + trxnResponse.getRespMsg()); System.out.println("AUTHCODE = " + trxnResponse.getAuthCode()); System.out.println("AVSADDR = " + trxnResponse.getAVSAddr()); System.out.println("AVSZIP = " + trxnResponse.getAVSZip()); } } *

      // 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(Environment.NewLine + "Errors = " + ctx.toString()); }

  • Method Details

    • getcaptureComplete

      public String getcaptureComplete()
      Gets the captureComplete for a capture. Possible values can be Y/N.
      Returns:
      captureComplete String

      Maps to Payflow Parameter: CAPTURECOMPLETE

    • setcaptureComplete

      public void setcaptureComplete(String captureComplete)
      Indicates if this Delayed Capture transaction is the last capture you intend to make. The values are: Y (default) / N NOTE: If CAPTURECOMPLETE is Y, any remaining amount of the original reauthorized transaction is automatically voided.
      Parameters:
      captureComplete - String

      Maps to Payflow Parameter: CAPTURECOMPLETE

    • generateRequest

      protected void generateRequest()
      Description copied from class: BaseTransaction
      Generates the transaction request.
      Overrides:
      generateRequest in class ReferenceTransaction