Class CreditTransaction

java.lang.Object
paypal.payflow.BaseTransaction
paypal.payflow.CreditTransaction

public final class CreditTransaction extends BaseTransaction
This class is used to create and perform an Credit Transaction.

Reference credit transaction can be performed on successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous transaction.

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

// Create a new Credit Transaction.
// Following is an example of a reference credit type of transaction.
CreditTransaction Trans = new CreditTransaction("PNRef of a previous
// transaction.",
User, Connection, Inv, PayflowUtility.getRequestId());

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

if (resp != null)
{
// Get the Transaction Response parameters.
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());
}
}

// 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

    • CreditTransaction

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

      Reference credit transaction can be performed on successful. transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous // transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      // transaction.
      CreditTransaction trans = new CreditTransaction("PNRef of a
      // previous transaction.",
      User, Connection, Inv, PayflowUtility.getRequestId());

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

      if (resp != null)
      {
      // Get the Transaction Response parameters.
      TransactionResponse trxnResponse = resp.getTransactionResponse();
      if (trxnResponse != null)
      {
      System.out.println("RESULT = " + TrxnResponse.Result);
      System.out.println("PNREF = " + TrxnResponse.Pnref);
      System.out.println("RESPMSG = " + TrxnResponse.RespMsg);
      }
      }

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

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

      Reference credit transaction can be performed on successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      // transaction.
      CreditTransaction trans = new CreditTransaction("PNRef of a
      // previous transaction.",
      User, Inv, PayflowUtility.getRequestId());

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

      if (resp != null)
      {
      // Get the Transaction Response parameters.
      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());
      }
      }

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

    • CreditTransaction

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

      Reference credit transaction can be performed on successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      transaction.
      CreditTransaction trans = new CreditTransaction("PNRef of a
      previous transaction.",
      User, Connection, Inv, tender, PayflowUtility.getRequestId());

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

      if (resp != null)
      {
      // Get the Transaction Response parameters.
      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());
      }
      }

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

    • CreditTransaction

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

      Reference credit transaction can be performed on successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      // transaction.
      CreditTransaction trans = new CreditTransaction("PNRef of a
      // previous transaction.",
      User, Inv, tender, PayflowUtility.getRequestId());

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

      if (Resp != null)
      {
      // Get the Transaction Response parameters.
      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());
      }
      }

      // Get the Context and check for any contained SDK specific errors.
      Context ctx = Resp.TransactionContext;
      if (ctx != null &&ctx.getErrorCount() %3E 0)
      {
      System.out.println("Errors = " + ctx.ToString());
      }


    • CreditTransaction

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

      Reference credit transaction can be performed on // successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous // transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      // transaction.
      CreditTransaction Trans = new CreditTransaction("PNRef of a
      // previous transaction.",
      User, Connection, PayflowUtility.getRequestId());

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

      if (resp != null)
      {
      // Get the Transaction Response parameters.
      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());
      }
      }

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

    • CreditTransaction

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

      Reference credit transaction can be performed on successful transactions in order to credit the amount. Therefore, a reference credit transaction takes the PNRef of a previous transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a reference credit type of
      // transaction.
      CreditTransaction Trans = new CreditTransaction("PNRef of a
      // previous transaction.", PayflowUtility.requestId);

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

      if (Resp != null)
      {
      // Get the Transaction Response parameters.
      TransactionResponse TrxnResponse = Resp.TransactionResponse;
      if (TrxnResponse != null)
      {
      System.out.println("RESULT = " + TrxnResponse.Result);
      System.out.println("PNREF = " + TrxnResponse.Pnref);
      System.out.println("RESPMSG = " + TrxnResponse.RespMsg);
      }
      }

      // Get the Context and check for any contained SDK specific errors.
      Context Ctx = Resp.TransactionContext;
      if (ctx != null && ctx.getErrorCount() %3E 0)
      {
      System.out.println("Errors = " + ctx.ToString());
      }

    • CreditTransaction

      public CreditTransaction(UserInfo userInfo, PayflowConnectionData PayflowConnectionData, Invoice invoice, BaseTender tender, String requestId)
      Constructor.
      Parameters:
      userInfo - User Info object populated with user credentials.
      PayflowConnectionData - Connection credentials object.
      invoice - Invoice object.
      tender - tender object such as Card tender.
      requestId - Request Id.

      This class is used for a stand alone credit transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a stand alone credit type of
      // transaction.
      CreditTransaction Trans = new CreditTransaction(User, Inv,
      // Connection,
      tender, PayflowUtility.requestId);

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

      if (Resp != null)
      {
      // Get the Transaction Response parameters.
      TransactionResponse TrxnResponse = Resp.TransactionResponse;
      if (TrxnResponse != null)
      {
      System.out.println("RESULT = " + TrxnResponse.Result);
      System.out.println("PNREF = " + TrxnResponse.Pnref);
      System.out.println("RESPMSG = " + TrxnResponse.RespMsg);
      }
      }

      // Get the Context and check for any contained SDK specific errors.
      Context Ctx = Resp.TransactionContext;
      if (ctx != null && ctx.getErrorCount() %3E 0)
      {
      Console.WriteLine(Environment.NewLine + "Errors = " +
      // Ctx.ToString());
      }

    • CreditTransaction

      public CreditTransaction(UserInfo userInfo, Invoice invoice, BaseTender tender, String requestId)
      Constructor.
      Parameters:
      userInfo - User Info object populated with user credentials.
      invoice - Invoice object.
      tender - tender object such as Card tender.
      requestId - Request Id.

      This class is used for a stand alone credit transaction.

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

      // Create a new Credit Transaction.
      // Following is an example of a stand alone type of transaction.
      CreditTransaction trans = new CreditTransaction(User, Inv,
      tender, PayflowUtility.getRequestId());

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

      if (resp != null)
      {
      // Get the Transaction Response parameters.
      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());
      }
      }

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


  • Method Details

    • getOrigPPRef

      public String getOrigPPRef()
      gets the OrigPPRef
      Returns:
      origPPRef

      maps to PayflowParameter ORIGPPREF

    • setOrigPPRef

      public void setOrigPPRef(String origPPRef)
      sets the OrigPPRef
      Parameters:
      origPPRef - String

      maps to PayflowParameter ORIGPPREF

    • generateRequest

      protected void generateRequest()
      Generates the transaction request.
      Overrides:
      generateRequest in class BaseTransaction