class
This class is used to create and perform an
Authorization Transaction.
class
This abstract class serves as base class for
Buyer auth transactions.
final class
This class is used to create and perform
a Validate Authentication transaction.
final class
This class is used to create and perform
a Verify Enrollment transaction.
final class
This class is used to perform a capture transaction.
final class
This class is used to create and perform an
Credit Transaction.
final class
This class is used to perform a fraud review transaction.
final class
This class is used to perform an inquiry transaction.
class
This class is used to create and perform an Order Transaction for Express Checkout.
class
This class is used to perform a recurring transaction with
add action.
RecurringAddTransaction is used to add a new recurring profile
either by submitting the data that defines the profile or by converting an
existing transaction into a profile. Upon successful creation of a profile,
PayPal activates the profile, performs the Optional Transaction if specified,
initiates the payment cycle, and returns a Profile ID (a 12-character string that
uniquely identifies the profile for searching and reporting). Upon failure, PayPal
does not generate the profile and returns an error message.
...............
// Populate data objects
...............
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
// The date that the first payment will be processed.
// This will be of the format mmddyyyy.
recurInfo.setStart("01012009");
recurInfo.setProfileName ("PayPal");
// Specifies how often the payment occurs. All PAYPERIOD values must use
// capital letters and can be any of WEEK / BIWK / SMMO / FRWK / MONT /
// QTER / SMYR / YEAR
recurInfo.setPayPeriod ("WEEK");
// Create a new RecurringAddTransaction
RecurringAddTransaction trans = new RecurringAddTransaction(
user, connection, inv, card, recurInfo, 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("RESPMSG = " + trxnResponse.getRespMsg());
}
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This class is used to perform a recurring transaction with
Cancel action.
* <p>
RecurringCancelTransaction is used to cancel the recurring profile
to deactivate the profile from performing further transactions. The profile is
marked as cancelled and the customer is no longer billed. PayPal records the
cancellation date.
</p>
...............
// Populate data objects
...............
* <p>
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
recurInfo.setOrigProfileId ("RT0000001350");
* <p>
// Create a new RecurringCancelTransaction
RecurringCancelTransaction trans = new RecurringCancelTransaction(
user, connection, recurInfo, PayflowUtility.getRequestId());
* <p>
// Submit the transaction.
Response resp = trans.submitTransaction();
* <p>
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());
}
* <p>
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This class is used to perform a recurring transaction with
Inquiry action.
* <p>
RecurringInquiryTransaction is used to request two different sets of information:
To view the full set of payment information for a profile, include the
PAYMENTHISTORY=Y name/value pair with the Inquiry action.
To view the status of a customer's profile, submit an Inquiry action that does
not include the PAYMENTHISTORY parameter (alternatively, submit
PAYMENTHISTORY=N).
</p>
...............
// Populate data objects
...............
* <p>
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
recurInfo.setOrigProfileId ("RT0000001350");
* <p>
// Create a new Recurring Inquiry Transaction.
RecurringInquiryTransaction trans = new RecurringInquiryTransaction(
user, connection, recurInfo, PayflowUtility.getRequestId());
* <p>
// Submit the transaction.
Response resp = trans.submitTransaction();
* <p>
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());
}
* <p>
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
System.out.println("STATUS = " + recurResponse.getStatus());
System.out.println("PROFILENAME = " + recurResponse.getProfileName());
System.out.println("START = " + recurResponse.getStart());
System.out.println("TERM = " + recurResponse.getTerm());
System.out.println("NEXTPAYMENT = " + recurResponse.getNextPayment());
System.out.println("PAYPERIOD = " + recurResponse.getPayPeriod());
System.out.println("NEXTPAYMENT = " + recurResponse.getNextPayment());
System.out.println("TENDER = " + recurResponse.getTender());
System.out.println("AMT = " + recurResponse.getAmt());
System.out.println("ACCT = " + recurResponse.getAcct());
System.out.println("EXPDATE = " + recurResponse.getExpDate());
System.out.println("AGGREGATEAMT = " + recurResponse.getAggregateAmt());
System.out.println("AGGREGATEOPTIONALAMT = " + recurResponse.getAggregateOptionalAmt());
System.out.println("MAXFAILPAYMENTS = " + recurResponse.getMaxFailPayments());
System.out.println("NUMFAILPAYMENTS = " + recurResponse.getNumFailPayments());
System.out.println("RETRYNUMDAYS = " + recurResponse.getRetryNumDays());
System.out.println("STREET = " + recurResponse.getStreet());
System.out.println("ZIP = " + recurResponse.getZip());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This class is used to perform a recurring transaction with
modify action.
RecurringModifyTransaction is used to modify any profile value by
sending any subset of the profile parameters, including an Optional Transaction.
The Modify action is useful, for example, when an inactive customer wishes to
restart payments using a new valid credit card. The Modify action changes a
profiles STATUS to active but does not change the START date.
...............
// Populate data objects
...............
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
recurInfo.setOrigProfileId ("RT0000001350");
recurInfo.setProfileName ("PayPal Inc.");
////////////////////////////////////
// Create a new Recurring modify Transaction.
RecurringModifyTransaction trans = new RecurringModifyTransaction(
user, connection, recurInfo, 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("RESPMSG = " + trxnResponse.getRespMsg());
}
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This class is used to perform a recurring transaction with
Payment action.
RecurringPaymentTransaction action performs a real-time retry on
a transaction that is in the retry state. The response string is similar
to the string for Optional transactions, except that, upon approval,
the profile is updated to reflect the successful retry.
</p>
...............
// Populate data objects
...............
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
recurInfo.setOrigProfileId ("RT0000001350");
// The date that the first payment will be processed.
// This will be of the format mmddyyyy.
RecurInfo.setPaymentNum ("01012009");
// Create a new Invoice data object with the Amount, Billing Address etc. details.
Invoice inv = new Invoice();
// Set Amount.
Currency amt = new Currency(new Double(25.12));
inv.setAmt (amt);
inv.setPoNum ("PO12345");
inv.setInvNum ("INV12345");
// Set the Billing Address details.
BillTo bill = new BillTo();
bill.setBillToStreet ("123 Main St.");
bill.setBillToZip ("12345");
inv.setBillTo (bill);
// Create a new RecurringPaymentTransaction.
RecurringPaymentTransaction trans = new RecurringPaymentTransaction(
user, connection, recurInfo, 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("RESPMSG = " + trxnResponse.getRespMsg());
}
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This class is used to perform a recurring transaction with
reactivate action.
RecurringReactivatetransaction reactivates a profile with inactive STATUS.
(Profiles can be deactivated for the following reasons: the term has completed,
the profile reached maximum allowable payment failures, or the profile is canceled.)
Reactivation gives the option to alter any profile parameter, including an
Optional Transaction and a new start date must be specified .
...............
// Populate data objects
...............
//Set the Recurring related information.
RecurringInfo recurInfo = new RecurringInfo();
recurInfo.setOrigProfileId ("RT0000001350");
// The date that the first payment will be processed.
// This will be of the format mmddyyyy.
recurInfo.setStart ("01012009");
////////////////////////////////////
// Create a new Recurring ReActivate Transaction.
RecurringReActivateTransaction trans = new RecurringReActivateTransaction(
user, connection, recurInfo, 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("RESPMSG = " + trxnResponse.getRespMsg());
}
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("/n" + "Errors = " + Ctx.ToString());
}
class
This is the base class of all different recurring action transactions.
Each derived class of RecurringTransaction specifies a unique action
transaction. This class can also be directly used to perform a recurring
transaction. Alternatively, a new class can be extended from this to
create a specific recurring action transaction.
</p>
...............
// Populate data objects
...............
//Set the Recurring related information.
recurringInfo recurInfo = new recurringInfo();
// The date that the first payment will be processed.
// This will be of the format mmddyyyy.
recurInfo.setStart("01012009");
recurInfo.setProfileName ("PayPal");
// Specifies how often the payment occurs. All PAYPERIOD values must use
// capital letters and can be any of WEEK / BIWK / SMMO / FRWK / MONT /
// QTER / SMYR / YEAR
recurInfo.setPayPeriod ("WEEK");
//////////////////////////////////////////////////
// Create a new Recurring Transaction.
RecurringTransaction trans = new RecurringTransaction("A", recurInfo,
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("RESPMSG = " + trxnResponse.getRespMsg());
}
// Get the Recurring Response parameters.
RecurringResponse recurResponse = resp.getRecurringResponse();
if (recurResponse != null)
{
System.out.println("RPREF = " + recurResponse.getRPRef());
System.out.println("PROFILEID = " + recurResponse.getProfileId());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("Errors = " + ctx.ToString());
}
class
This class is used as base class for all reference transactions.
final class
This class is used to perform a voice authorization transaction.
* This class is used to create and perform a Sale Transaction.
...............
// Populate data objects
...............
// Create a new SaleTransaction.
SaleTransaction trans = new SaleTransaction(user,
connection, inv, tender, PayflowUtility.RequestId);
// 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());
System.out.println("AUTHCODE = " + trxnResponse.getAuthCode());
System.out.println("AVSADDR = " + trxnResponse.getAVSAddr());
System.out.println("AVSZIP = " + trxnResponse.getAVSZip());
System.out.println("IAVS = " + trxnResponse.getIAVS());
}
// Get the Fraud Response parameters.
FraudResponse fraudResp = resp.getFraudResponse();
if (fraudResp != null)
{
System.out.println("PREFPSMSG = " + fraudResp.getPreFpsMsg());
System.out.println("POSTFPSMSG = " + fraudResp.getPostFpsMsg());
}
}
// Get the Context and check for any contained SDK specific errors.
Context ctx = resp.getTransactionContext();
if (ctx != null & ctx.getErrorCount() > 0)
{
System.out.println("Errors = " + ctx.toString());
}
final class
This class is used to perform a voice authorization transaction.
Some transactions cannot be authorized over the Internet (for example, high dollar
amounts)'processing networks generate Referral (Result Code 13) transactions.
In these situations, contact the customer service department of the
merchant bank and provide the payment information as requested.
If the transaction is approved, the bank provides a voice authorization
code (AUTHCODE) for the transaction. This must be included as AUTHCODE
as part of a Voice Authorization transaction.
...............
// Populate data objects
...............
// Create a new Voice Auth Transaction.
VoiceAuthTransaction trans = new VoiceAuthTransaction("123PNI",
user, connection, inv, card, PayflowUtility.RequestId);
// 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() > 0)
{
System.out.println("Errors = " + ctx.toString());
}
class
This class is used to perform a void transaction.
The Void transaction prevents a transaction from being settled, but does
not release the authorization (hold on funds) on the cardholder's account.
Delayed Capture, Sale, Credit, Authorization, and Voice
Authorization transactions can be voided. A Void transaction cannot be voided.
The Void must occur prior to settlement.
................
// Populate data objects
...............
// Create a new Void Transaction.
// The ORIGID is the PNREF no. for a previous transaction.
VoidTransaction trans = new VoidTransaction("V63A0A07BE5A",
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() > 0)
{
System.out.println("Errors = " + ctx.toString());
}