Class RecurringAddTransaction
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());
}
-
Field Summary
Fields inherited from class paypal.payflow.BaseTransaction
requestId -
Constructor Summary
ConstructorsConstructorDescriptionRecurringAddTransaction(UserInfo UserInfo, Invoice Invoice, BaseTender Tender, RecurringInfo RecurringInfo, String RequestId) ConstructorRecurringAddTransaction(UserInfo UserInfo, PayflowConnectionData PayflowConnectionData, Invoice Invoice, BaseTender Tender, RecurringInfo RecurringInfo, String RequestId) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidGenerates the transaction request.Gets the OrigId.voidSets the orig Id.Methods inherited from class paypal.payflow.BaseTransaction
addHeader, clearExtendData, getBuyerAuthStatus, getClientInfo, getContext, getExtData, getRequest, getRequestBuffer, getRequestId, getResponse, getTender, getTrxType, getVerbosity, RemoveTransHeader, setBuyerAuthStatus, setClientInfo, setContext, setExtData, setRequestId, setTender, setVerbosity, submitTransaction
-
Constructor Details
-
RecurringAddTransaction
public RecurringAddTransaction(UserInfo UserInfo, PayflowConnectionData PayflowConnectionData, Invoice Invoice, BaseTender Tender, RecurringInfo RecurringInfo, 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 object.RecurringInfo- - Recurring Info object.RequestId- - Request Id *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 ............... *// Create a new RecurringCancelTransaction. RecurringCancelTransaction trans = new RecurringCancelTransaction(user, connection, inv, tender, recurInfo, payflowUtility.getRequestId ()); *
// Submit the transaction. Response resp = trans.submitTransaction();
-
RecurringAddTransaction
public RecurringAddTransaction(UserInfo UserInfo, Invoice Invoice, BaseTender Tender, RecurringInfo RecurringInfo, String RequestId) Constructor- Parameters:
UserInfo- - User Info object populated with user credentials.Invoice- - Invoice object.Tender- - Tender object such as Card Tender object.RecurringInfo- - Recurring Info object.RequestId- - Request Id *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 ............... *// Create a new RecurringCancelTransaction. RecurringCancelTransaction trans = new RecurringCancelTransaction(user, inv, tender, recurInfo, payflowUtility.getRequestId ()); *
// Submit the transaction. Response resp = trans.submitTransaction();
-
-
Method Details
-
getOrigId
Gets the OrigId.- Returns:
- String
-
setOrigId
Sets the orig Id.- Parameters:
origId- String
-
generateRequest
protected void generateRequest()Description copied from class:BaseTransactionGenerates the transaction request.- Overrides:
generateRequestin classRecurringTransaction
-