public class

PaypalCloudConnector

extends Object
java.lang.Object
   ↳ org.mule.module.paypal.PaypalCloudConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Cloud connector for Paypal.

PayPal is a service that enables you to pay, send money, and accept payments without revealing your financial information.

PayPal acts like a digital wallet where you can securely store all your payment options, such as your bank account and credit card. When you want to make a payment, you don't have to pull out your credit card or type your billing info every time. Simply click on the PayPal checkout button, log in to your PayPal account, and select your preferred payment method. We'll complete the payment process—without sharing your info with merchants and sellers.

This connector lets mule users to perform

Summary

Fields
private CurrencyCode defaultCurrency Default currency used if none is specified in the operation
private PaypalFacade facade
private final MapObjectMapper mom
private String password Paypal password
private String signature PayPal-generated unique digital signature.
private String subject An indicator in an API call of the account for whom the call is being made
private String username Paypal username
Public Constructors
PaypalCloudConnector()
PaypalCloudConnector(PaypalFacade paypalFacade)
Advanced constructor
Public Methods
AddressVerifyResponseType addressVerify(String email, String street, String zip)
Confirms whether a postal address and postal code match those of the specified PayPal account holder.
DoAuthorizationResponseType authorize(String transactionId, String amount, CurrencyCode amountCurrency, TransactionEntity transactionEntity)
Authorize a payment
DoCaptureResponseType capture(String authorizationId, boolean complete, String amount, CurrencyCode amountCurrency, String invoiceId, String note, String softDescriptor)
Capture an authorized payment.
DoDirectPaymentResponseType doDirectPayment(String ipAddress, Map<String, Object> cardDetails, Map<String, Object> paymentDetails, PaymentActionCode paymentAction, Boolean setReturnFMFDetails)
Process a credit card payment.
DoVoidResponseType doVoid(String authorizationId, String note)
Void an order or an authorization.
GetBalanceResponseType getBalance(Boolean returnAllCurrencies)
Obtain the available balance for a PayPal account.
CurrencyCode getDefaultCurrency()
PaypalFacade getFacade()
GetPalDetailsResponseType getPalDetails()
Obtain your Pal ID, which is the PayPal-assigned merchant account number, and other information about your account.
String getPassword()
String getSignature()
String getSubject()
GetTransactionDetailsResponseType getTransactionDetails(String transactionId)
Obtain information about a specific transaction.
String getUsername()
void initialise()
ManagePendingTransactionStatusResponseType managePendingTransactionStatus(String transactionId, FMFPendingTransactionAction action)
Accept or deny a pending transaction held by Fraud Management Filters.
MassPayResponseType massPay(String emailSubject, List<MassPayRequestItemType> massPayItems, ReceiverInfoCode receiverType)
Make a payment to one or more PayPal account holders.
DoReauthorizationResponseType reAuthorize(String authorizationId, String amount, CurrencyCode amountCurrency)
Reauthorize an amount for a previously authorized transaction.
RefundTransactionResponseType refundTransaction(String transactionId, String invoiceId, Refund refundType, String amount, CurrencyCode amountCurrency, String memo)
Issue a refund to the PayPal account holder associated with a transaction.
void setDefaultCurrency(CurrencyCode defaultCurrency)
void setFacade(PaypalFacade facade)
void setPassword(String password)
void setSignature(String signature)
void setSubject(String subject)
void setUsername(String username)
Protected Methods
CurrencyCode coalesceCurrencyToDefaultCurrency(CurrencyCode currencyCode)
BasicAmountType getAmount(String value, CurrencyCode currency)
Builds a BasicAmountType to use in operations.
CompleteCodeType getCompleteCode(Boolean complete)
CurrencyCodeType getCurrency(CurrencyCode actualParameter)
Returns the currency to use in operations
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private CurrencyCode defaultCurrency

Default currency used if none is specified in the operation

private PaypalFacade facade

private final MapObjectMapper mom

private String password

Paypal password

private String signature

PayPal-generated unique digital signature.

private String subject

An indicator in an API call of the account for whom the call is being made

private String username

Paypal username

Public Constructors

public PaypalCloudConnector ()

public PaypalCloudConnector (PaypalFacade paypalFacade)

Advanced constructor

Parameters
paypalFacade Facade that performs the operations

Public Methods

public AddressVerifyResponseType addressVerify (String email, String street, String zip)

Confirms whether a postal address and postal code match those of the specified PayPal account holder.

Parameters
email The email of the account's holder
street The street to verify
zip The zip address to verify
Returns
  • AddressVerifyResponseType with the confirmation status of for parameter.

public DoAuthorizationResponseType authorize (String transactionId, String amount, CurrencyCode amountCurrency, TransactionEntity transactionEntity)

Authorize a payment

Parameters
transactionId The value of the order's transaction identification number returned by PayPal. Character length and limits: 19 single-byte characters maximum.
amount Amount to authorize. Limitations: Value is a positive number which cannot exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).
amountCurrency The currency in which amount is expressed. If it is null, then the defaultCurrency is used.
transactionEntity Type of transaction to authorize. The only allowable value is Order, which means that the transaction represents a customer order that can be fulfilled over 29 days.
Returns
  • DoAuthorizationResponseType with transaction and authorization information.

public DoCaptureResponseType capture (String authorizationId, boolean complete, String amount, CurrencyCode amountCurrency, String invoiceId, String note, String softDescriptor)

Capture an authorized payment.

Parameters
authorizationId The authorization identification number of the payment you want to capture. This is the transaction id returned from DoExpressCheckoutPayment or DoDirectPayment. Character length and limits: 19 single-byte characters maximum.
complete The value Complete indicates that this the last capture you intend to make. The value NotComplete indicates that you intend to make additional captures
amount Amount to capture. Limitations: Value is a positive number which cannot exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).
amountCurrency The currency in which amount is expressed. If it is null, then the defaultCurrency is used.
invoiceId Your invoice number or other identification number that is displayed to the merchant and customer in his transaction history. NOTE: This value on DoCapture will overwrite a value previously set on DoAuthorization. NOTE: The value is recorded only if the authorization you are capturing is an order authorization, not a basic authorization. Character length and limits: 127 single-byte alphanumeric characters.
note An informational note about this settlement that is displayed to the payer in email and in his transaction history. Character length and limits: 255 single-byte characters.
softDescriptor The soft descriptor is a per transaction description of the payment that is passed to the consumer's credit card statement.
Returns
  • A DoCaptureResponseType. Only the authorization ID, transaction ID, transaction type, payment date, gross amount and payment status are guaranteed to be returned. If you need the values of other fields and they are not returned, you can obtain their values later by calling GetTransactionDetails or by using the reporting mechanism.

public DoDirectPaymentResponseType doDirectPayment (String ipAddress, Map<String, Object> cardDetails, Map<String, Object> paymentDetails, PaymentActionCode paymentAction, Boolean setReturnFMFDetails)

Process a credit card payment.

Parameters
ipAddress IP address of the payer's browser. NOTE: PayPal records this IP addresses as a means to detect possible fraud. Character length and limitations: 15 single-byte characters, including periods, for example: 255.255.255.255.
cardDetails Credit card details
paymentDetails Payment details
paymentAction How you want to obtain payment: () "Authorization" indicates that this payment is a basic authorization subject to settlement with PayPal Authorization & Capture. () "Sale" indicates that this is a final sale for which you are requesting payment.
setReturnFMFDetails Flag to indicate whether you want the results returned by Fraud Management Filters. By default, you do not receive this information.
Returns
  • DoDirectPaymentResponseType with information about the payment.

public DoVoidResponseType doVoid (String authorizationId, String note)

Void an order or an authorization.

Parameters
authorizationId The original authorization ID specifying the authorization to void or, to void an order, the order ID. IMPORTANT: If you are voiding a transaction that has been reauthorized, use the ID from the original authorization, and not the reauthorization. Character length and limits: 19 single-byte characters.
note An informational note about this void that is displayed to the payer in email and in his transaction history. Character length and limits: 255 single-byte characters
Returns

public GetBalanceResponseType getBalance (Boolean returnAllCurrencies)

Obtain the available balance for a PayPal account.

Parameters
returnAllCurrencies If true, returns the balance for each currency holding, otherwise only the balance for the primary currency holding
Returns
  • the balance for the account GetBalanceResponseType

public CurrencyCode getDefaultCurrency ()

public PaypalFacade getFacade ()

public GetPalDetailsResponseType getPalDetails ()

Obtain your Pal ID, which is the PayPal-assigned merchant account number, and other information about your account. You need the account number when working with dynamic versions of PayPal buttons and logos.

Returns
  • GetPalDetailsResponseType with the account details.

public String getPassword ()

public String getSignature ()

public String getSubject ()

public GetTransactionDetailsResponseType getTransactionDetails (String transactionId)

Obtain information about a specific transaction.

Parameters
transactionId Unique identifier of a transaction. NOTE: The details for some kinds of transactions cannot be retrieved with GetTransactionDetails. You cannot obtain details of bank transfer withdrawals, for example. Character length and limitations: 17 single-byte alphanumeric characters.
Returns
  • GetTransactionDetailsResponseType with the transaction details.

public String getUsername ()

public void initialise ()

Throws
InitialisationException

public ManagePendingTransactionStatusResponseType managePendingTransactionStatus (String transactionId, FMFPendingTransactionAction action)

Accept or deny a pending transaction held by Fraud Management Filters.

Parameters
transactionId The transaction ID of the payment transaction.
action The operation you want to perform on the transaction, which is one of the following actions: () Accept - accepts the payment () Deny - rejects the payment
Returns
  • ManagePendingTransactionStatusResponseType with the ID and current status of the transactin.

public MassPayResponseType massPay (String emailSubject, List<MassPayRequestItemType> massPayItems, ReceiverInfoCode receiverType)

Make a payment to one or more PayPal account holders.

Parameters
emailSubject The subject line of the email that PayPal sends when the transaction is completed. The subject line is the same for all recipients. Character length and limitations: 255 single-byte alphanumeric characters.
massPayItems Details of each payment. NOTE: A single request can include up to 250 MassPayItems.
receiverType Indicates how you identify the recipients of payments in this call to MassPay. Must be EmailAddress or UserID.
Returns
  • MassPayResponseType with no specific information about the payments.

public DoReauthorizationResponseType reAuthorize (String authorizationId, String amount, CurrencyCode amountCurrency)

Reauthorize an amount for a previously authorized transaction.

Parameters
authorizationId The value of a previously authorized transaction identification number returned by PayPal. Character length and limits: 19 single-byte characters maximum.
amount Amount to reauthorize. Limitations: Value is a positive number which cannot exceed $10,000 USD in any currency. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).
amountCurrency The currency in which amount is expressed. If it is null, then the defaultCurrency is used.
Returns
  • DoReauthorizationResponseType containing payment status and the new authorization identification number.

public RefundTransactionResponseType refundTransaction (String transactionId, String invoiceId, Refund refundType, String amount, CurrencyCode amountCurrency, String memo)

Issue a refund to the PayPal account holder associated with a transaction.

Parameters
transactionId Unique identifier of a transaction. Character length and limitations: 17 single-byte alphanumeric characters.
invoiceId Your own invoice or tracking number. Character length and limitations: 127 single-byte alphanumeric characters
refundType Type of refund you are making: () Full - default () Partial
amount Refund amount. Amount is required if RefundType is Partial. NOTE: If RefundType is not specified, do not set the Amount.
amountCurrency The currency in which amount is expressed. If it is null, then the defaultCurrency is used.
memo Custom memo about the refund. Character length and limitations: 255 single-byte alphanumeric characters.
Returns
  • RefundTransactionResponseType with information about the refunded amount (transaction fee redunded, gross, net and total refunded amount)

public void setDefaultCurrency (CurrencyCode defaultCurrency)

Parameters
defaultCurrency

public void setFacade (PaypalFacade facade)

Parameters
facade

public void setPassword (String password)

Parameters
password

public void setSignature (String signature)

Parameters
signature

public void setSubject (String subject)

Parameters
subject

public void setUsername (String username)

Parameters
username

Protected Methods

protected CurrencyCode coalesceCurrencyToDefaultCurrency (CurrencyCode currencyCode)

Parameters
currencyCode

protected BasicAmountType getAmount (String value, CurrencyCode currency)

Builds a BasicAmountType to use in operations.

Parameters
value The amount
currency The currency received as a paremeter. could be null if the default currency is specified.
Returns
  • BasicAmountType with the given value and currency.

protected CompleteCodeType getCompleteCode (Boolean complete)

Parameters
complete

protected CurrencyCodeType getCurrency (CurrencyCode actualParameter)

Returns the currency to use in operations

Parameters
actualParameter The currency parameter passed to the operation.
Returns
  • if a currency is specified, returns the parameter. otherwise returns the default currency.