Package paypal.payflow
package paypal.payflow
-
ClassDescriptionThis class is used to create and use an ACH( Automatic Clearing House ) Tender type.This class holds the advice detail related information.This class is used to create and perform an Authorization Transaction.Used for BankAcct information.Abstract base Class of all response data objects.This abstract class serves as base class of all tender objects.This class is the base class for all transaction objects.Used for Billing Address informationUsed for the buyerauth operationUsed for BuyerAuth Status information.This abstract class serves as base class for Buyer auth transactions.This class is used to create and perform a Validate Authentication transaction.This class is used to create and perform a Verify Enrollment transaction.This class is used to perform a capture transaction.Used for Card tender related information.Used for Check Payment related information.Used for Check tender related information.This class is used to store the Payflow Client related properties.This class contains all error messages generated for the class containing the context.This also contains the highest severity level contained by the context.Used for Credit Card related information CreditCard is associated with CardTender.This class is used to create and perform an Credit Transaction.This class is used as the currency data type by all data and transaction objects.Used for Customer related information.Used for the type of device the card holder is using.Used for ExpressCheckout with Billing Agreement (Reference Transaction) without Purchase DO operation.Used for ExpressCheckout DO operation.UUsed for ExpressCheckout Do operation.Used for ExpressCheckout with Billing Agreement (Reference Transaction) without Purchase GET operation.Used for ExpressCheckout GET operation.Used for ExpressCheckout update operation.Used for ExpressCheckout with Billing Agreement (Reference Transaction) without Purchase SET operation.Used for ExpressCheckout SET operation.Used for ExpressCheckout UPDATE operation.This class contains the error message along with the message code, severity level of the error and the stack trace.This class serves as base class of all ExpressCheckout request classes.This class serves as base class of all ExpressCheckout response classes./// Used for Extended param information ///Used for storing Fraud Protection Services XML response message after parsing them.Container class for response messages specific Fraud Protections Services.This class is used to perform a fraud review transaction.This class is used to perform an inquiry transaction.Used as the Purchase Invoice class.Interface for all request data objects.Interface for all response data objects.This class holds the line item related information.This is a singleton class which can be used for logging of the messages.Used for Magtek related information.Used for Merchant related information.This class is used to create and perform an Order Transaction for Express Checkout.PayflowAPI is used to submit a Name-value pair or XMLPay request to PayPal payment gateway for online payment processing.Used for Payflow Host related information.PayflowConstants class contains all the global constants used throughout the SDK.This class contains all the utility function's which may be required during a transaction.PayPal Pay Later is a new, convenient, and secure service that allows you to offer your customers promotional financing.This class holds the PayPal Pay Later Promotional related information.Used for PayPal tender related information.Used for Purchase card related information PurchaseCard is associated with CardTender.
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()); }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()); }Used for recurring transaction related information <p>RecurringInfo contains the required and optional parameters specific to all the recurring transactions.</p> Following examples shows how to use the RecurringInfo. ............................ //Populate other data objects. ............................ RecurringInfo RecurInfo = new RecurringInfo(); // The date that the first payment will be processed. // This will be of the format mmddyyyy. RecurInfo.Start = "01012009"; RecurInfo.ProfileName = "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.PayPeriod = "WEEK"; // Create a new Recurring Add Transaction. RecurringAddTransaction Trans = new RecurringAddTransaction( User, Connection, Inv, Card, RecurInfo, PayflowUtility.RequestId); // Submit the transaction. Response Resp = Trans.SubmitTransaction(); if (Resp != null) { // Get the Transaction Response parameters. TransactionResponse TrxnResponse = Resp.TransactionResponse; if (TrxnResponse != null) { Console.WriteLine("RESULT = " + TrxnResponse.Result); Console.WriteLine("RESPMSG = " + TrxnResponse.RespMsg); } // Get the Recurring Response parameters. RecurringResponse RecurResponse = Resp.RecurringResponse; if (RecurResponse != null) { Console.WriteLine("RPREF = " + RecurResponse.RPRef); Console.WriteLine("PROFILEID = " + RecurResponse.ProfileId); } } // Get the Context and check for any contained SDK specific errors. Context Ctx = Resp.TransactionContext; if (Ctx != null & Ctx.getErrorCount() > 0) { Console.WriteLine(Environment.NewLine + "Errors = " + Ctx.ToString()); } Console.WriteLine(Environment.NewLine + "Press Enter to Exit ..."); Console.ReadLine();}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()); }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()); }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()); }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()); }Container class for all the messages related to recurring transactions.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()); }This class is used as base class for all reference transactions.Container class for response messages. This class enclosed response data objects specific to following: <ol> <li>Transaction response -- Response messages common to all transactions.</li> <li>Fraud response -- Fraud Filters response messages.</li> <li>Recurring response -- Recurring transaction response messages.</li> <li>Buyerauth response -- Buyer auth response messages. (Not supported.)</li> </ol> <p>Additionally the Response class also contains the transaction context, full request response string values.</p> {@link FraudResponse} {@link TransactionResponse} {@link RecurringResponse} {@link BuyerAuthResponse} {@link Context} Following example shows, how to obtain response of a transaction and how to use it. .......... // Trans is the transaction object. * ................... // 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.Result); System.out.println("RESPMSG = " + trxnResponse.RespMsg); } * <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()); } } * <p> // 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()); }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()); }This class is used to set the SDK level properties.Used for shipping address informationUsed for swipe card information *Used for transaction response.Used for PayPal User account information This is a required class for a strong assembly transactions.This class holds the USER1 to USER10 related information.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()); }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()); }