com.xerox.amazonws.fps
Class FlexiblePaymentsService

java.lang.Object
  extended by com.xerox.amazonws.common.AWSConnection
      extended by com.xerox.amazonws.common.AWSQueryConnection
          extended by com.xerox.amazonws.fps.FlexiblePaymentsService

public class FlexiblePaymentsService
extends AWSQueryConnection

This class provides an interface with the Amazon FPS service.

Author:
J. Bernard, Elastic Grid, LLC., jerome.bernard@elastic-grid.com

Field Summary
 
Fields inherited from class com.xerox.amazonws.common.AWSConnection
headers
 
Constructor Summary
FlexiblePaymentsService(String awsAccessId, String awsSecretKey)
          Initializes the FPS service with your AWS login information.
FlexiblePaymentsService(String awsAccessId, String awsSecretKey, boolean isSecure, String callerToken, String recipientToken, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          Initializes the FPS service with your AWS login information.
FlexiblePaymentsService(String awsAccessId, String awsSecretKey, boolean isSecure, String callerToken, String recipientToken, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy, String server, int port, String uiPipeline)
          Initializes the FPS service with your AWS login information.
FlexiblePaymentsService(String awsAccessId, String awsSecretKey, boolean isSecure, String callerToken, String recipientToken, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy, String server, String uiPipeline)
          Initializes the FPS service with your AWS login information.
FlexiblePaymentsService(String awsAccessId, String awsSecretKey, String callerToken, String recipientToken, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          Initializes the FPS service with your AWS login information.
 
Method Summary
 String acquireEditToken(String callerReference, String tokenID, PaymentMethod paymentMethod, String returnURL)
          Generate a signed URL for the CBUI pipeline.
 String acquireMultiUseToken(String callerReference, Amount globalLimit, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireMultiUseToken(String callerReference, List<String> recipientTokens, AmountType amountType, Amount globalLimit, List<UsageLimit> usageLimits, Boolean isRecipientCobranding, Boolean collectShippingAddress, Address address, Date validityStart, Date validityExpiry, PaymentMethod paymentMethod, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquirePostPaidToken(String callerReferenceSender, String callerReferenceSettlement, Amount creditLimit, Amount globalAmountLimit, PaymentMethod paymentMethod, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquirePostPaidToken(String callerReferenceSender, String callerReferenceSettlement, Amount creditLimit, Amount globalAmountLimit, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquirePostPaidToken(String callerReferenceSender, String callerReferenceSettlement, Date validityStart, Date validityExpiry, Amount creditLimit, Amount globalAmountLimit, List<UsageLimit> usageLimits, Boolean collectShippingAddress, Address address, PaymentMethod paymentMethod, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquirePrepaidToken(String callerReferenceSender, String callerReferenceFunding, Amount amount, PaymentMethod paymentMethod, Date validityStart, Date validityExpiry, Boolean collectShippingAddress, Address address, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquirePrepaidToken(String callerReferenceSender, String callerReferenceFunding, Amount amount, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireRecipientToken(String callerReference, Boolean recipientPaysFee, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireRecipientToken(String callerReference, Date validityStart, Date validityExpiry, PaymentMethod paymentMethod, Boolean recipientPaysFee, String callerReferenceRefund, Long maxVariableFee, Long maxFixedFee, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireRecurringToken(String callerReference, Amount amount, int recurringInterval, RecurringGranularity recurringGranularity, Date validityStart, Date validityExpiry, PaymentMethod paymentMethod, String recipientToken, Boolean isRecipientCobranding, Boolean collectShippingAddress, Address address, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireRecurringToken(String callerReference, Amount amount, int recurringInterval, RecurringGranularity recurringGranularity, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireSingleUseToken(String callerReference, Amount amount, boolean reserve, PaymentMethod paymentMethod, String recipientToken, Boolean isRecipientCobranding, Boolean collectShippingAddress, Address address, Amount itemTotal, Amount shipping, Amount handling, Boolean giftWrapping, Amount discount, Amount tax, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireSingleUseToken(String callerReference, Amount amount, PaymentMethod paymentMethod, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 String acquireSingleUseToken(String callerReference, Amount amount, String returnURL, String reason)
          Generate a signed URL for the CBUI pipeline.
 void cancelToken(String tokenID)
          Cancel any token that you installed on your own account.
 void cancelToken(String tokenID, String reason)
          Cancel any token that you installed on your own account.
 void discardResults(String... transactionIDs)
          Discard the results that are fetched using the getResults() operation.
 MultiUseInstrument extractMultiUseTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the multi use token from the CBUI pipeline return.
 PostPaidInstrument extractPostPaidTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the post paid token from the CBUI pipeline return.
 PrepaidInstrument extractPrepaidTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the recurring token from the CBUI pipeline return.
 RecipientInstrument extractRecipientTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the recurring token from the CBUI pipeline return.
 RecurringInstrument extractRecurringTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the recurring token from the CBUI pipeline return.
 SingleUseInstrument extractSingleUseTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
          Extract the single use token from the CBUI pipeline return.
 Transaction fundPrepaid(String senderTokenID, String prepaidInstrumentID, double fundingAmount, String callerReference)
          Transfer money from the sender's payment instrument specified in the funding token to the recipient's account balance.
 Transaction fundPrepaid(String senderTokenID, String callerTokenID, String prepaidInstrumentID, double fundingAmount, Date transactionDate, String senderReference, String recipientReference, String callerReference, ChargeFeeTo chargeFeeTo, String senderDescription, String recipientDescription, String callerDescription, String metadata, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          Transfer money from the sender's payment instrument specified in the funding token to the recipient's account balance.
 String generateUIPipelineURL(String pipelineName, String returnURL, Map<String,String> params)
          Generate a signed URL for the CBUI pipeline.
 AccountActivity getAccountActivity(Date startDate)
           
 AccountActivity getAccountActivity(Date startDate, Date endDate)
           
 AccountActivity getAccountActivity(FPSOperation filter, PaymentMethod paymentMethod, int maxBatchSize, Date startDate, Date endDate, TransactionalRoleFilter role, Transaction.Status transactionStatus)
          Retrieve transactions from an account for a given time period.
 AccountBalance getAccountBalance()
          Get the current balance on your account.
 List<DebtBalance> getAllCreditInstrumentBalances()
          Retrieve all credit instruments associated with an account.
 List<DebtBalance> getAllCreditInstrumentBalances(Instrument.Status instrumentStatus)
          Retrieve all credit instruments associated with an account.
 List<String> getAllCreditInstruments()
          Retrieve all credit instruments associated with an account.
 List<String> getAllCreditInstruments(Instrument.Status instrumentStatus)
          Retrieve all credit instruments associated with an account.
 List<String> getAllPrepaidInstruments()
          Retrieve all the prepaid instruments associated with your account
 List<String> getAllPrepaidInstruments(Instrument.Status instrumentStatus)
          Retrieve all the prepaid instruments associated with your account
 List<Token> getAllTokens()
          Fetch all the tokens installed on your (caller) account.
 DebtBalance getDebtBalance(String creditInstrumentId)
          Retrieve the balance of a credit instrument.
 DebtBalance getOutstandingDebtBalance()
          Retrieve balances of all credit instruments owned by the sender.
 PaymentInstructionDetail getPaymentInstruction(String tokenID)
          Retrieve the details of a payment instruction.
 PrepaidBalance getPrepaidBalance(String prepaidInstrumentId)
          Retrieve the balance of a prepaid instrument.
 List<TransactionResult> getResults()
          This operation is used to poll for transaction results that are returned asynchronously.
 List<TransactionResult> getResults(FPSOperationFilter operation, Integer maxResultsCount)
          This operation is used to poll for transaction results that are returned asynchronously.
 Token getTokenByCaller(String callerReference)
          Fetch the details of a particular token.
 Token getTokenByID(String tokenID)
          Fetch the details of a particular token.
 List<Token> getTokens(String tokenFriendlyName, Token.Status tokenStatus, String callerReference)
          Fetch the tokens installed on your (caller) account, based on the filtering parameters.
 List<Token> getTokensByCallerReference(String callerReference)
          Fetch the tokens installed on your (caller) account, filtered by caller reference.
 List<Token> getTokensByFriendlyName(String tokenFriendlyName)
          Fetch the tokens installed on your (caller) account, filtered by friendly name.
 List<Token> getTokensByStatus(Token.Status tokenStatus)
          Fetch the tokens installed on your (caller) account, filtered by status.
 List<TokenUsageLimit> getTokenUsage(String tokenID)
          Fetch the details and usage of a multi-use token.
 OutstandingPrepaidLiability getTotalPrepaidLiability()
          Returns the total liability held by the recipient corresponding to all the prepaid instruments.
 TransactionDetail getTransaction(String transactionID)
          Fetch details of a transaction referred by the transactionId.
 String installPaymentInstruction(String paymentInstruction, String tokenFriendlyName, String callerReference, TokenType type, String comment)
          Install tokens (payment instructions) on your own accounts.
 String installPaymentInstruction(String paymentInstruction, String callerReference, TokenType type)
          Install tokens (payment instructions) on your own accounts.
 String installUnrestrictedCallerPaymentInstruction(String callerReference)
          Install unrestricted caller token on your own accounts.
 String installUnrestrictedRecipientPaymentInstruction(String callerReference)
          Install unrestricted recipient token on your own accounts.
 boolean isSignatureValid(javax.servlet.http.HttpServletRequest request)
           
protected
<T> T
makeRequestInt(org.apache.http.client.methods.HttpRequestBase method, String action, Map<String,String> params, Class<T> respType)
           
 Transaction pay(String senderToken, Amount amount, String callerReference)
          Initiate a transaction to move funds from the sender to the recipient.
 Transaction pay(String senderToken, Amount amount, String callerReference, DescriptorPolicy descriptorPolicy)
          Initiate a transaction to move funds from the sender to the recipient.
 Transaction pay(String recipientToken, String senderToken, String callerToken, Amount amount, Date transactionDate, ChargeFeeTo chargeFeeTo, String callerReference, String senderReference, String recipientReference, String senderDescription, String recipientDescription, String callerDescription, String metadata, double marketplaceFixedFee, int marketplaceVariableFee, DescriptorPolicy descriptorPolicy)
          Initiate a transaction to move funds from the sender to the recipient.
 Transaction pay(String recipientToken, String senderToken, String callerToken, Amount amount, Date transactionDate, ChargeFeeTo chargeFeeTo, String callerReference, String senderReference, String recipientReference, String senderDescription, String recipientDescription, String callerDescription, String metadata, double marketplaceFixedFee, int marketplaceVariableFee, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          Initiate a transaction to move funds from the sender to the recipient.
 Transaction refund(String senderToken, String transactionID, String callerReference)
          Refund a successfully completed payment transaction.
 Transaction refund(String callerToken, String senderToken, String transactionID, Amount refundAmount, ChargeFeeTo chargeFeeTo, Date transactionDate, String callerReference, String senderReference, String recipientReference, String senderDescription, String recipientDescription, String callerDescription, String metadata, MarketplaceRefundPolicy policy)
          Refund a successfully completed payment transaction.
 Transaction reserve(String senderToken, Amount amount, String callerReference)
          This operation is part of the Reserve and Settle operations that allow payment transactions when the authorization and settlement have a time difference.
 Transaction reserve(String recipientToken, String senderToken, String callerToken, Amount amount, Date transactionDate, ChargeFeeTo chargeFeeTo, String callerReference, String senderReference, String recipientReference, String senderDescription, String recipientDescription, String callerDescription, String metadata, double marketplaceFixedFee, int marketplaceVariableFee, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          This operation is part of the Reserve and Settle operations that allow payment transactions when the authorization and settlement have a time difference.
 Transaction retryTransaction(String transactionID)
          Submits a transaction for processing.
 Transaction settle(String reserveTransactionID, Amount amount)
          Settles fully or partially the amount that is reserved using the reserve(java.lang.String, com.xerox.amazonws.fps.Amount, java.lang.String) operation
 Transaction settle(String reserveTransactionID, Amount amount, Date transactionDate)
          Settles fully or partially the amount that is reserved using the reserve(java.lang.String, com.xerox.amazonws.fps.Amount, java.lang.String) operation
 Transaction settleDebt(String settlementToken, String creditInstrument, Amount amount, String callerReference)
          The SettleDebt operation takes the settlement amount, credit instrument, and the settlement token among other parameters.
 Transaction settleDebt(String settlementToken, String callerToken, String creditInstrument, Amount amount, Date transactionDate, String senderReference, String recipientReference, String callerReference, ChargeFeeTo chargeFeeTo, String senderDescription, String recipientDescription, String callerDescription, String metadata, DescriptorPolicy descriptorPolicy, TemporaryDeclinePolicy tempDeclinePolicy)
          The SettleDebt operation takes the settlement amount, credit instrument, and the settlement token among other parameters.
 void subscribeForCallerNotification(NotificationEventType operationType, URL webService)
          Allows callers to subscribe to events that are given out using the web service notification mechanism.
 void unsubscribeForCallerNotification(NotificationEventType operationType)
          Allows callers to unsubscribe to events that are previously subscribed by the calling applications.
 Transaction writeOffDebt(String creditInstrument, double adjustmentAmount, String callerReference)
          Write off the debt accumulated by the recipient on any credit instrument
 Transaction writeOffDebt(String callerToken, String creditInstrument, double adjustmentAmount, Date transactionDate, String callerReference, String recipientReference, String senderReference, String senderDescription, String recipientDescription, String callerDescription, String metadata)
          Write off the debt accumulated by the recipient on any credit instrument
 
Methods inherited from class com.xerox.amazonws.common.AWSQueryConnection
close, close, getConnectionManagerTimeout, getConnectionTimeout, getHeaders, getHttpClient, getMaxConnections, getMaxRetries, getServerTimeZone, getSoTimeout, getString, httpDate, makeRequest, setConnectionManagerTimeout, setConnectionTimeout, setHttpClient, setMaxConnections, setMaxRetries, setProxyValues, setProxyValues, setProxyValues, setServerTimeZone, setSoTimeout, useSystemProxy
 
Methods inherited from class com.xerox.amazonws.common.AWSConnection
encode, encode, getAlgorithm, getAwsAccessKeyId, getPort, getResourcePrefix, getSecretAccessKey, getServer, getSignatureVersion, getUrl, isSecure, makeURL, setResourcePrefix, setServer, setSignatureVersion, urlencode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlexiblePaymentsService

public FlexiblePaymentsService(String awsAccessId,
                               String awsSecretKey)
Initializes the FPS service with your AWS login information.

Parameters:
awsAccessId - the your user key into AWS
awsSecretKey - the secret string used to generate signatures for authentication.

FlexiblePaymentsService

public FlexiblePaymentsService(String awsAccessId,
                               String awsSecretKey,
                               String callerToken,
                               String recipientToken,
                               DescriptorPolicy descriptorPolicy,
                               TemporaryDeclinePolicy tempDeclinePolicy)
Initializes the FPS service with your AWS login information.

Parameters:
awsAccessId - the your user key into AWS
awsSecretKey - the secret string used to generate signatures for authentication.
callerToken - the default caller token to be used when not explicitely specified
recipientToken - the default recipient token to be used when not explicitely specified
descriptorPolicy - the descriptor policy to use as descriptive string on credit card statements
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)

FlexiblePaymentsService

public FlexiblePaymentsService(String awsAccessId,
                               String awsSecretKey,
                               boolean isSecure,
                               String callerToken,
                               String recipientToken,
                               DescriptorPolicy descriptorPolicy,
                               TemporaryDeclinePolicy tempDeclinePolicy)
Initializes the FPS service with your AWS login information.

Parameters:
awsAccessId - the your user key into AWS
awsSecretKey - the secret string used to generate signatures for authentication.
isSecure - true if the data should be encrypted on the wire on the way to or from FPS.
callerToken - the default caller token to be used when not explicitely specified
recipientToken - the default recipient token to be used when not explicitely specified
descriptorPolicy - the descriptor policy to use as descriptive string on credit card statements
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)

FlexiblePaymentsService

public FlexiblePaymentsService(String awsAccessId,
                               String awsSecretKey,
                               boolean isSecure,
                               String callerToken,
                               String recipientToken,
                               DescriptorPolicy descriptorPolicy,
                               TemporaryDeclinePolicy tempDeclinePolicy,
                               String server,
                               String uiPipeline)
Initializes the FPS service with your AWS login information.

Parameters:
awsAccessId - The your user key into AWS
awsSecretKey - The secret string used to generate signatures for authentication.
isSecure - True if the data should be encrypted on the wire on the way to or from FPS.
callerToken - the default caller token to be used when not explicitely specified
recipientToken - the default recipient token to be used when not explicitely specified
descriptorPolicy - the descriptor policy to use as descriptive string on credit card statements
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
server - Which host to connect to. Usually, this will be fps.amazonaws.com. You can also use fps.sandbox.amazonaws.com instead if you want to test your code within the Sandbox environment
uiPipeline - the URL of the UI pipeline

FlexiblePaymentsService

public FlexiblePaymentsService(String awsAccessId,
                               String awsSecretKey,
                               boolean isSecure,
                               String callerToken,
                               String recipientToken,
                               DescriptorPolicy descriptorPolicy,
                               TemporaryDeclinePolicy tempDeclinePolicy,
                               String server,
                               int port,
                               String uiPipeline)
Initializes the FPS service with your AWS login information.

Parameters:
awsAccessId - the your user key into AWS
awsSecretKey - the secret string used to generate signatures for authentication.
isSecure - true if the data should be encrypted on the wire on the way to or from FPS.
callerToken - the default caller token to be used when not explicitely specified
recipientToken - the default recipient token to be used when not explicitely specified
descriptorPolicy - the descriptor policy to use as descriptive string on credit card statements
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
server - which host to connect to. Usually, this will be fps.amazonaws.com. You can also use fps.sandbox.amazonaws.com instead if you want to test your code within the Sandbox environment
port - which port to use
uiPipeline - the URL of the UI pipeline
Method Detail

cancelToken

public void cancelToken(String tokenID)
                 throws FPSException
Cancel any token that you installed on your own account.

Parameters:
tokenID - the token to be cancelled
Throws:
FPSException - wraps checked exceptions

cancelToken

public void cancelToken(String tokenID,
                        String reason)
                 throws FPSException
Cancel any token that you installed on your own account.

Parameters:
tokenID - the token to be cancelled
reason - reason for cancelling the token -- max 64 characters
Throws:
FPSException - wraps checked exceptions

discardResults

public void discardResults(String... transactionIDs)
                    throws FPSException
Discard the results that are fetched using the getResults() operation.

Parameters:
transactionIDs - the list of transaction to be discarded
Throws:
FPSException - wraps checked exceptions

fundPrepaid

public Transaction fundPrepaid(String senderTokenID,
                               String prepaidInstrumentID,
                               double fundingAmount,
                               String callerReference)
                        throws FPSException
Transfer money from the sender's payment instrument specified in the funding token to the recipient's account balance. This operation creates a prepaid balance on the sender' prepaid instrument. Note: there is no support for NewSenderTokenUsage yet.

Parameters:
senderTokenID - the token identifying the funding payment instructions
prepaidInstrumentID - the prepaid instrument ID returned by the prepaid instrument installation pipeline
fundingAmount - amount to fund the prepaid instrument
callerReference - a unique reference that you specify in your system to identify a transaction
Returns:
the completed transaction
Throws:
FPSException - wraps checked exceptions

fundPrepaid

public Transaction fundPrepaid(String senderTokenID,
                               String callerTokenID,
                               String prepaidInstrumentID,
                               double fundingAmount,
                               Date transactionDate,
                               String senderReference,
                               String recipientReference,
                               String callerReference,
                               ChargeFeeTo chargeFeeTo,
                               String senderDescription,
                               String recipientDescription,
                               String callerDescription,
                               String metadata,
                               DescriptorPolicy descriptorPolicy,
                               TemporaryDeclinePolicy tempDeclinePolicy)
                        throws FPSException
Transfer money from the sender's payment instrument specified in the funding token to the recipient's account balance. This operation creates a prepaid balance on the sender' prepaid instrument. Note: there is no support for NewSenderTokenUsage yet.

Parameters:
senderTokenID - the token identifying the funding payment instructions
callerTokenID - the caller's token ID
prepaidInstrumentID - the prepaid instrument ID returned by the prepaid instrument installation pipeline
fundingAmount - amount to fund the prepaid instrument
transactionDate - the date specified by the caller and stored with the transaction
senderReference - any reference that the caller might use to identify the sender in the transaction
recipientReference - any reference that the caller might use to identify the recipient in the transaction
callerReference - a unique reference that you specify in your system to identify a transaction
chargeFeeTo - the participant paying the fee for the transaction
senderDescription - 128-byte field to store transaction description
recipientDescription - 128-byte field to store transaction description
callerDescription - 128-byte field to store transaction description
metadata - a 2KB free-form field used to store transaction data
descriptorPolicy - the soft descriptor type and the customer service number to pass to the payment processor
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
Returns:
the completed transaction
Throws:
FPSException - wraps checked exceptions

getAccountActivity

public AccountActivity getAccountActivity(Date startDate)
                                   throws FPSException
Throws:
FPSException

getAccountActivity

public AccountActivity getAccountActivity(Date startDate,
                                          Date endDate)
                                   throws FPSException
Throws:
FPSException

getAccountActivity

public AccountActivity getAccountActivity(FPSOperation filter,
                                          PaymentMethod paymentMethod,
                                          int maxBatchSize,
                                          Date startDate,
                                          Date endDate,
                                          TransactionalRoleFilter role,
                                          Transaction.Status transactionStatus)
                                   throws FPSException
Retrieve transactions from an account for a given time period.

Parameters:
filter - operation type filter -- use null if this filter shouldn't be used
paymentMethod - payment method filter -- use null if this filter shouldn't be used
maxBatchSize - maximum number of transactions to be returned
AccountActivity is Iterable over each page of the paginated results from the underneath FPS operation.
startDate - will filter transactions beginning from that date
endDate - will filter transactions ending up to that date
role - role filter -- use null if this filter shouldn't be used
transactionStatus - transaction status filter -- use null if this filter shouldn't be used
Returns:
the account activity matching the filters
Throws:
FPSException - wraps checked exceptions

getAllPrepaidInstruments

public List<String> getAllPrepaidInstruments()
                                      throws FPSException
Retrieve all the prepaid instruments associated with your account

Returns:
the list of prepaid instruments
Throws:
FPSException - wraps checked exceptions

getAllPrepaidInstruments

public List<String> getAllPrepaidInstruments(Instrument.Status instrumentStatus)
                                      throws FPSException
Retrieve all the prepaid instruments associated with your account

Parameters:
instrumentStatus - filter instruments by status
Returns:
the list of prepaid instruments
Throws:
FPSException - wraps checked exceptions

getAllCreditInstruments

public List<String> getAllCreditInstruments()
                                     throws FPSException
Retrieve all credit instruments associated with an account.

Returns:
the list of credit instruments IDs associated with the account
Throws:
FPSException - wraps checked exceptions

getAllCreditInstrumentBalances

public List<DebtBalance> getAllCreditInstrumentBalances()
                                                 throws FPSException
Retrieve all credit instruments associated with an account.

Returns:
the list of credit instruments balances associated with the account
Throws:
FPSException - wraps checked exceptions

getAllCreditInstruments

public List<String> getAllCreditInstruments(Instrument.Status instrumentStatus)
                                     throws FPSException
Retrieve all credit instruments associated with an account.

Parameters:
instrumentStatus - filter instruments by status
Returns:
the list of credit instruments IDs associated with the account
Throws:
FPSException - wraps checked exceptions

getAllCreditInstrumentBalances

public List<DebtBalance> getAllCreditInstrumentBalances(Instrument.Status instrumentStatus)
                                                 throws FPSException
Retrieve all credit instruments associated with an account.

Parameters:
instrumentStatus - filter instruments by status
Returns:
the list of credit instruments balances associated with the account
Throws:
FPSException - wraps checked exceptions

getDebtBalance

public DebtBalance getDebtBalance(String creditInstrumentId)
                           throws FPSException
Retrieve the balance of a credit instrument. Note: only on the instruments for which you are the sender or the recipient can be queried

Parameters:
creditInstrumentId - the credit instrument Id for which debt balance is queried
Returns:
the balance
Throws:
FPSException - wraps checked exceptions

getOutstandingDebtBalance

public DebtBalance getOutstandingDebtBalance()
                                      throws FPSException
Retrieve balances of all credit instruments owned by the sender. Note: only on the instruments for which you are the sender or the recipient can be queried

Returns:
the aggregated balance
Throws:
FPSException - wraps checked exceptions

getPaymentInstruction

public PaymentInstructionDetail getPaymentInstruction(String tokenID)
                                               throws FPSException
Retrieve the details of a payment instruction.

Parameters:
tokenID - token for which the payment instruction is to be retrieved
Returns:
a 64-character alphanumeric string that represents the installed payment instruction
Throws:
FPSException - wraps checked exceptions

getPrepaidBalance

public PrepaidBalance getPrepaidBalance(String prepaidInstrumentId)
                                 throws FPSException
Retrieve the balance of a prepaid instrument. Note: only on the instruments for which you are the sender or the recipient can be queried

Parameters:
prepaidInstrumentId - prepaid instrument for which the balance is queried
Returns:
the balance
Throws:
FPSException - wraps checked exceptions

getResults

public List<TransactionResult> getResults()
                                   throws FPSException
This operation is used to poll for transaction results that are returned asynchronously.

Throws:
FPSException - wraps checked exceptions

getResults

public List<TransactionResult> getResults(FPSOperationFilter operation,
                                          Integer maxResultsCount)
                                   throws FPSException
This operation is used to poll for transaction results that are returned asynchronously.

Parameters:
operation - Used to filter results based on the operation type (e.g. Pay, Refund, Settle, SettleDebt, WriteOffDebt, FundPrepaid)
maxResultsCount - Used to specify the maximum results that can be retrieved. The minimum value is 1 and the maximum value is 25. By default the maximum or the available results are returned.
Returns:
the list of transactions
Throws:
FPSException - wraps checked exceptions

getAllTokens

public List<Token> getAllTokens()
                         throws FPSException
Fetch all the tokens installed on your (caller) account.

Returns:
the list of tokens
Throws:
FPSException - wraps checked exceptions

getTokensByFriendlyName

public List<Token> getTokensByFriendlyName(String tokenFriendlyName)
                                    throws FPSException
Fetch the tokens installed on your (caller) account, filtered by friendly name.

Parameters:
tokenFriendlyName - filter by friendly name
Returns:
the list of tokens
Throws:
FPSException - wraps checked exceptions

getTokensByStatus

public List<Token> getTokensByStatus(Token.Status tokenStatus)
                              throws FPSException
Fetch the tokens installed on your (caller) account, filtered by status.

Parameters:
tokenStatus - filter by token status
Returns:
the list of tokens
Throws:
FPSException - wraps checked exceptions

getTokensByCallerReference

public List<Token> getTokensByCallerReference(String callerReference)
                                       throws FPSException
Fetch the tokens installed on your (caller) account, filtered by caller reference.

Parameters:
callerReference - filter by caller reference
Returns:
the list of tokens
Throws:
FPSException - wraps checked exceptions

getTokens

public List<Token> getTokens(String tokenFriendlyName,
                             Token.Status tokenStatus,
                             String callerReference)
                      throws FPSException
Fetch the tokens installed on your (caller) account, based on the filtering parameters. A null parameter means to NOT filter on that parameter.

Parameters:
tokenFriendlyName - filter by friendly name
tokenStatus - filter by token status
callerReference - filter by caller reference
Returns:
the list of tokens
Throws:
FPSException - wraps checked exceptions

getTokenByID

public Token getTokenByID(String tokenID)
                   throws FPSException
Fetch the details of a particular token.

Parameters:
tokenID - the token Id of the specific token installed on the callers account
Returns:
the token
Throws:
FPSException - wraps checked exceptions

getTokenByCaller

public Token getTokenByCaller(String callerReference)
                       throws FPSException
Fetch the details of a particular token.

Parameters:
callerReference - the caller reference that was passed at the time of the token installation
Returns:
the token
Throws:
FPSException - wraps checked exceptions

getTokenUsage

public List<TokenUsageLimit> getTokenUsage(String tokenID)
                                    throws FPSException
Fetch the details and usage of a multi-use token. Note: the usage limit is returned only for the multi-use token and not for the single-use token

Parameters:
tokenID - the token for which the usage is queried
Returns:
the list of available usage limits on the token
Throws:
FPSException - wraps checked exceptions

getTotalPrepaidLiability

public OutstandingPrepaidLiability getTotalPrepaidLiability()
                                                     throws FPSException
Returns the total liability held by the recipient corresponding to all the prepaid instruments.

Returns:
the total liability
Throws:
FPSException - wraps checked exceptions

getTransaction

public TransactionDetail getTransaction(String transactionID)
                                 throws FPSException
Fetch details of a transaction referred by the transactionId.

Parameters:
transactionID - a transaction Id for the query
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

installUnrestrictedCallerPaymentInstruction

public String installUnrestrictedCallerPaymentInstruction(String callerReference)
                                                   throws FPSException
Install unrestricted caller token on your own accounts.

Parameters:
callerReference - a unique reference to the payment instructions. This is used to recover or retrieve tokens that are lost or not received after the payment instruction is installed
Returns:
a 64-character alphanumeric string that represents the installed payment instruction
Throws:
FPSException - wraps checked exceptions

installUnrestrictedRecipientPaymentInstruction

public String installUnrestrictedRecipientPaymentInstruction(String callerReference)
                                                      throws FPSException
Install unrestricted recipient token on your own accounts.

Parameters:
callerReference - a unique reference to the payment instructions. This is used to recover or retrieve tokens that are lost or not received after the payment instruction is installed
Returns:
a 64-character alphanumeric string that represents the installed payment instruction
Throws:
FPSException - wraps checked exceptions

installPaymentInstruction

public String installPaymentInstruction(String paymentInstruction,
                                        String callerReference,
                                        TokenType type)
                                 throws FPSException
Install tokens (payment instructions) on your own accounts.

Parameters:
paymentInstruction - set of rules in the GateKeeper language format to be installed on the caller's account
callerReference - a unique reference to the payment instructions. This is used to recover or retrieve tokens that are lost or not received after the payment instruction is installed
type - the type of token
Returns:
a 64-character alphanumeric string that represents the installed payment instruction
Throws:
FPSException - wraps checked exceptions

installPaymentInstruction

public String installPaymentInstruction(String paymentInstruction,
                                        String tokenFriendlyName,
                                        String callerReference,
                                        TokenType type,
                                        String comment)
                                 throws FPSException
Install tokens (payment instructions) on your own accounts.

Parameters:
paymentInstruction - set of rules in the GateKeeper language format to be installed on the caller's account
tokenFriendlyName - a human-friendly, readable name for the payment instruction
callerReference - a unique reference to the payment instructions. This is used to recover or retrieve tokens that are lost or not received after the payment instruction is installed
type - the type of token
comment - the reason for making the payment
Returns:
a 64-character alphanumeric string that represents the installed payment instruction
Throws:
FPSException - wraps checked exceptions

pay

public Transaction pay(String senderToken,
                       Amount amount,
                       String callerReference)
                throws FPSException
Initiate a transaction to move funds from the sender to the recipient.

Parameters:
senderToken - sender token
amount - amount to be charged to the sender
callerReference - a unique reference that you specify in your system to identify a transaction
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

pay

public Transaction pay(String senderToken,
                       Amount amount,
                       String callerReference,
                       DescriptorPolicy descriptorPolicy)
                throws FPSException
Initiate a transaction to move funds from the sender to the recipient.

Parameters:
senderToken - sender token
amount - amount to be charged to the sender
callerReference - a unique reference that you specify in your system to identify a transaction
descriptorPolicy - the soft descriptor type and the customer service number to pass to the payment processor
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

pay

public Transaction pay(String recipientToken,
                       String senderToken,
                       String callerToken,
                       Amount amount,
                       Date transactionDate,
                       ChargeFeeTo chargeFeeTo,
                       String callerReference,
                       String senderReference,
                       String recipientReference,
                       String senderDescription,
                       String recipientDescription,
                       String callerDescription,
                       String metadata,
                       double marketplaceFixedFee,
                       int marketplaceVariableFee,
                       DescriptorPolicy descriptorPolicy)
                throws FPSException
Initiate a transaction to move funds from the sender to the recipient.

Parameters:
recipientToken - recipient token
senderToken - sender token
callerToken - caller token
amount - amount to be charged to the sender
transactionDate - the date specified by the caller and stored with the transaction
chargeFeeTo - the participant paying the fee for the transaction
callerReference - a unique reference that you specify in your system to identify a transaction
senderReference - any reference that the caller might use to identify the sender in the transaction
recipientReference - any reference that the caller might use to identify the recipient in the transaction
senderDescription - 128-byte field to store transaction description
recipientDescription - 128-byte field to store transaction description
callerDescription - 128-byte field to store transaction description
metadata - a 2KB free-form field used to store transaction data
marketplaceFixedFee - the fee charged by the marketplace developer as a fixed amount of the transaction
marketplaceVariableFee - the fee charged by the marketplace developer as a variable amount of the transaction
descriptorPolicy - the soft descriptor type and the customer service number to pass to the payment processor
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

pay

public Transaction pay(String recipientToken,
                       String senderToken,
                       String callerToken,
                       Amount amount,
                       Date transactionDate,
                       ChargeFeeTo chargeFeeTo,
                       String callerReference,
                       String senderReference,
                       String recipientReference,
                       String senderDescription,
                       String recipientDescription,
                       String callerDescription,
                       String metadata,
                       double marketplaceFixedFee,
                       int marketplaceVariableFee,
                       DescriptorPolicy descriptorPolicy,
                       TemporaryDeclinePolicy tempDeclinePolicy)
                throws FPSException
Initiate a transaction to move funds from the sender to the recipient.

Parameters:
recipientToken - recipient token
senderToken - sender token
callerToken - caller token
amount - amount to be charged to the sender
transactionDate - the date specified by the caller and stored with the transaction
chargeFeeTo - the participant paying the fee for the transaction
callerReference - a unique reference that you specify in your system to identify a transaction
senderReference - any reference that the caller might use to identify the sender in the transaction
recipientReference - any reference that the caller might use to identify the recipient in the transaction
senderDescription - 128-byte field to store transaction description
recipientDescription - 128-byte field to store transaction description
callerDescription - 128-byte field to store transaction description
metadata - a 2KB free-form field used to store transaction data
marketplaceFixedFee - the fee charged by the marketplace developer as a fixed amount of the transaction
marketplaceVariableFee - the fee charged by the marketplace developer as a variable amount of the transaction
descriptorPolicy - the soft descriptor type and the customer service number to pass to the payment processor
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

refund

public Transaction refund(String senderToken,
                          String transactionID,
                          String callerReference)
                   throws FPSException
Refund a successfully completed payment transaction.

Parameters:
senderToken - token of the original recipient who is now the sender in the refund
transactionID - the transaction that is to be refunded
callerReference - a unique reference that identifies this refund
Returns:
the refund transaction
Throws:
FPSException - FPSException wraps checked exceptions

refund

public Transaction refund(String callerToken,
                          String senderToken,
                          String transactionID,
                          Amount refundAmount,
                          ChargeFeeTo chargeFeeTo,
                          Date transactionDate,
                          String callerReference,
                          String senderReference,
                          String recipientReference,
                          String senderDescription,
                          String recipientDescription,
                          String callerDescription,
                          String metadata,
                          MarketplaceRefundPolicy policy)
                   throws FPSException
Refund a successfully completed payment transaction.

Parameters:
callerToken - the caller token
senderToken - token of the original recipient who is now the sender in the refund
transactionID - the transaction that is to be refunded<
refundAmount - the amount to be refunded
If this value is not specified, then the remaining funds from the original transaction is refunded.
chargeFeeTo - the participant who pays the fee
Currently Amazon FPS does not charge any fee for the refund and this has no impact on the transaction
transactionDate - the date of the transaction from the caller
callerReference - a unique reference that identifies this refund
senderReference - the reference created by the recipient of original transaction for this refund transaction
recipientReference - the reference created by the Sender (of the original transaction) for this refund transaction
senderDescription - a 128-byte field to store transaction description
recipientDescription - a 128-byte field to store transaction description
callerDescription - a 128-byte field to store transaction description
metadata - a 2KB free form field used to store transaction data
policy - the refund choice: refund the master transaction, the marketplace fee, or both
Returns:
the refund transaction
Throws:
FPSException - FPSException wraps checked exceptions

reserve

public Transaction reserve(String senderToken,
                           Amount amount,
                           String callerReference)
                    throws FPSException
This operation is part of the Reserve and Settle operations that allow payment transactions when the authorization and settlement have a time difference. The transaction is not complete until the Settle operation is executed successfully. A reserve authorization is only valid for 7 days. Currently, you can't cancel a reserve.

Parameters:
senderToken - sender token
amount - amount to be reserved on the sender account/credit card
callerReference - a unique reference that you specify in your system to identify a transaction
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

reserve

public Transaction reserve(String recipientToken,
                           String senderToken,
                           String callerToken,
                           Amount amount,
                           Date transactionDate,
                           ChargeFeeTo chargeFeeTo,
                           String callerReference,
                           String senderReference,
                           String recipientReference,
                           String senderDescription,
                           String recipientDescription,
                           String callerDescription,
                           String metadata,
                           double marketplaceFixedFee,
                           int marketplaceVariableFee,
                           DescriptorPolicy descriptorPolicy,
                           TemporaryDeclinePolicy tempDeclinePolicy)
                    throws FPSException
This operation is part of the Reserve and Settle operations that allow payment transactions when the authorization and settlement have a time difference. The transaction is not complete until the Settle operation is executed successfully. A reserve authorization is only valid for 7 days. Currently, you can't cancel a reserve.

Parameters:
recipientToken - recipient token
senderToken - sender token
callerToken - caller token
amount - amount to be reserved on the sender account/credit card
transactionDate - the date specified by the caller and stored with the transaction
chargeFeeTo - the participant paying the fee for the transaction
callerReference - a unique reference that you specify in your system to identify a transaction
senderReference - any reference that the caller might use to identify the sender in the transaction
recipientReference - any reference that the caller might use to identify the recipient in the transaction
senderDescription - 128-byte field to store transaction description
recipientDescription - 128-byte field to store transaction description
callerDescription - 128-byte field to store transaction description
metadata - a 2KB free-form field used to store transaction data
marketplaceFixedFee - the fee charged by the marketplace developer as a fixed amount of the transaction
marketplaceVariableFee - the fee charged by the marketplace developer as a variable amount of the transaction
descriptorPolicy - the soft descriptor type and the customer service number to pass to the payment processor
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

retryTransaction

public Transaction retryTransaction(String transactionID)
                             throws FPSException
Submits a transaction for processing. If a transaction was temporarily declined, the transaction can be processed again using the original transaction ID.

Parameters:
transactionID - the transaction to retry
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

settle

public Transaction settle(String reserveTransactionID,
                          Amount amount)
                   throws FPSException
Settles fully or partially the amount that is reserved using the reserve(java.lang.String, com.xerox.amazonws.fps.Amount, java.lang.String) operation

Parameters:
reserveTransactionID - the transaction ID of the reserve transaction that has to be settled
amount - amount to be settled
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

settle

public Transaction settle(String reserveTransactionID,
                          Amount amount,
                          Date transactionDate)
                   throws FPSException
Settles fully or partially the amount that is reserved using the reserve(java.lang.String, com.xerox.amazonws.fps.Amount, java.lang.String) operation

Parameters:
reserveTransactionID - the transaction ID of the reserve transaction that has to be settled
amount - amount to be settled
transactionDate - the date of the transaction
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

settleDebt

public Transaction settleDebt(String settlementToken,
                              String creditInstrument,
                              Amount amount,
                              String callerReference)
                       throws FPSException
The SettleDebt operation takes the settlement amount, credit instrument, and the settlement token among other parameters. Using this operation you can:

Parameters:
settlementToken - the token ID of the settlement token
creditInstrument - the credit instrument Id returned by the co-branded UI pipeline
amount - the amount for the settlement
callerReference - a unique reference that you specify in your system to identify a transaction
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

settleDebt

public Transaction settleDebt(String settlementToken,
                              String callerToken,
                              String creditInstrument,
                              Amount amount,
                              Date transactionDate,
                              String senderReference,
                              String recipientReference,
                              String callerReference,
                              ChargeFeeTo chargeFeeTo,
                              String senderDescription,
                              String recipientDescription,
                              String callerDescription,
                              String metadata,
                              DescriptorPolicy descriptorPolicy,
                              TemporaryDeclinePolicy tempDeclinePolicy)
                       throws FPSException
The SettleDebt operation takes the settlement amount, credit instrument, and the settlement token among other parameters. Using this operation you can:

Parameters:
settlementToken - the token ID of the settlement token
callerToken - the callers token
creditInstrument - the credit instrument Id returned by the co-branded UI pipeline
amount - the amount for the settlement
transactionDate - the date of the callers transaction
senderReference - the unique value that will be used as a reference for the sender in this transaction
recipientReference - the unique value that will be used as a reference for the recipient in this transaction
callerReference - a unique reference that you specify in your system to identify a transaction
chargeFeeTo - the participant paying the fee for the transaction
senderDescription - a 128-byte field to store transaction description
recipientDescription - a 128-byte field to store transaction description
callerDescription - a 128-byte field to store transaction description
metadata - a 2KB free form field used to store transaction data
descriptorPolicy - the descriptor policy to use as descriptive string on credit card statements
tempDeclinePolicy - the temporary decline policy and the retry time out (in minutes)
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

subscribeForCallerNotification

public void subscribeForCallerNotification(NotificationEventType operationType,
                                           URL webService)
                                    throws FPSException
Allows callers to subscribe to events that are given out using the web service notification mechanism. This operation is used for subscribing to the notifications provided to callers through web services. Amazon FPS supports two events, Transaction results and token deletion that you can subscribe.

Parameters:
operationType - specify the event types for which the notifications are required
webService - the URL to your web service
Throws:
FPSException - wraps checked exceptions

unsubscribeForCallerNotification

public void unsubscribeForCallerNotification(NotificationEventType operationType)
                                      throws FPSException
Allows callers to unsubscribe to events that are previously subscribed by the calling applications.

Parameters:
operationType - specify the event types for which the notifications are required
Throws:
FPSException - wraps checked exceptions

writeOffDebt

public Transaction writeOffDebt(String creditInstrument,
                                double adjustmentAmount,
                                String callerReference)
                         throws FPSException
Write off the debt accumulated by the recipient on any credit instrument

Parameters:
creditInstrument - the credit instrument Id returned by the co-branded UI pipeline
adjustmentAmount - the amount for the settlement
if the adjustmentAmount is not a positive value, a IllegalArgumentException is thrown
callerReference - a unique reference that you specify in your system to identify a transaction
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

writeOffDebt

public Transaction writeOffDebt(String callerToken,
                                String creditInstrument,
                                double adjustmentAmount,
                                Date transactionDate,
                                String callerReference,
                                String recipientReference,
                                String senderReference,
                                String senderDescription,
                                String recipientDescription,
                                String callerDescription,
                                String metadata)
                         throws FPSException
Write off the debt accumulated by the recipient on any credit instrument

Parameters:
callerToken - the callers token
creditInstrument - the credit instrument Id returned by the co-branded UI pipeline
adjustmentAmount - the amount for the settlement
if the adjustmentAmount is not a positive value, a IllegalArgumentException is thrown
transactionDate - the date of the callers transaction
senderReference - the unique value that will be used as a reference for the sender in this transaction
recipientReference - the unique value that will be used as a reference for the recipient in this transaction
callerReference - a unique reference that you specify in your system to identify a transaction
senderDescription - a 128-byte field to store transaction description
recipientDescription - a 128-byte field to store transaction description
callerDescription - a 128-byte field to store transaction description
metadata - a 2KB free form field used to store transaction data
Returns:
the transaction
Throws:
FPSException - wraps checked exceptions

getAccountBalance

public AccountBalance getAccountBalance()
                                 throws FPSException
Get the current balance on your account.

Returns:
the balance
Throws:
FPSException - wraps checked exceptions

acquireSingleUseToken

public String acquireSingleUseToken(String callerReference,
                                    Amount amount,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireSingleUseToken

public String acquireSingleUseToken(String callerReference,
                                    Amount amount,
                                    PaymentMethod paymentMethod,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireSingleUseToken

public String acquireSingleUseToken(String callerReference,
                                    Amount amount,
                                    boolean reserve,
                                    PaymentMethod paymentMethod,
                                    String recipientToken,
                                    Boolean isRecipientCobranding,
                                    Boolean collectShippingAddress,
                                    Address address,
                                    Amount itemTotal,
                                    Amount shipping,
                                    Amount handling,
                                    Boolean giftWrapping,
                                    Amount discount,
                                    Amount tax,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireMultiUseToken

public String acquireMultiUseToken(String callerReference,
                                   Amount globalLimit,
                                   String returnURL,
                                   String reason)
                            throws MalformedURLException,
                                   FPSException
Generate a signed URL for the CBUI pipeline.

Throws:
MalformedURLException
FPSException

acquireMultiUseToken

public String acquireMultiUseToken(String callerReference,
                                   List<String> recipientTokens,
                                   AmountType amountType,
                                   Amount globalLimit,
                                   List<UsageLimit> usageLimits,
                                   Boolean isRecipientCobranding,
                                   Boolean collectShippingAddress,
                                   Address address,
                                   Date validityStart,
                                   Date validityExpiry,
                                   PaymentMethod paymentMethod,
                                   String returnURL,
                                   String reason)
                            throws FPSException,
                                   MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireRecurringToken

public String acquireRecurringToken(String callerReference,
                                    Amount amount,
                                    int recurringInterval,
                                    RecurringGranularity recurringGranularity,
                                    String returnURL,
                                    String reason)
                             throws MalformedURLException,
                                    FPSException
Generate a signed URL for the CBUI pipeline.

Throws:
MalformedURLException
FPSException

acquireRecurringToken

public String acquireRecurringToken(String callerReference,
                                    Amount amount,
                                    int recurringInterval,
                                    RecurringGranularity recurringGranularity,
                                    Date validityStart,
                                    Date validityExpiry,
                                    PaymentMethod paymentMethod,
                                    String recipientToken,
                                    Boolean isRecipientCobranding,
                                    Boolean collectShippingAddress,
                                    Address address,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireRecipientToken

public String acquireRecipientToken(String callerReference,
                                    Boolean recipientPaysFee,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireRecipientToken

public String acquireRecipientToken(String callerReference,
                                    Date validityStart,
                                    Date validityExpiry,
                                    PaymentMethod paymentMethod,
                                    Boolean recipientPaysFee,
                                    String callerReferenceRefund,
                                    Long maxVariableFee,
                                    Long maxFixedFee,
                                    String returnURL,
                                    String reason)
                             throws FPSException,
                                    MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquirePrepaidToken

public String acquirePrepaidToken(String callerReferenceSender,
                                  String callerReferenceFunding,
                                  Amount amount,
                                  String returnURL,
                                  String reason)
                           throws FPSException,
                                  MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquirePrepaidToken

public String acquirePrepaidToken(String callerReferenceSender,
                                  String callerReferenceFunding,
                                  Amount amount,
                                  PaymentMethod paymentMethod,
                                  Date validityStart,
                                  Date validityExpiry,
                                  Boolean collectShippingAddress,
                                  Address address,
                                  String returnURL,
                                  String reason)
                           throws FPSException,
                                  MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquirePostPaidToken

public String acquirePostPaidToken(String callerReferenceSender,
                                   String callerReferenceSettlement,
                                   Amount creditLimit,
                                   Amount globalAmountLimit,
                                   String returnURL,
                                   String reason)
                            throws FPSException,
                                   MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquirePostPaidToken

public String acquirePostPaidToken(String callerReferenceSender,
                                   String callerReferenceSettlement,
                                   Amount creditLimit,
                                   Amount globalAmountLimit,
                                   PaymentMethod paymentMethod,
                                   String returnURL,
                                   String reason)
                            throws FPSException,
                                   MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquirePostPaidToken

public String acquirePostPaidToken(String callerReferenceSender,
                                   String callerReferenceSettlement,
                                   Date validityStart,
                                   Date validityExpiry,
                                   Amount creditLimit,
                                   Amount globalAmountLimit,
                                   List<UsageLimit> usageLimits,
                                   Boolean collectShippingAddress,
                                   Address address,
                                   PaymentMethod paymentMethod,
                                   String returnURL,
                                   String reason)
                            throws FPSException,
                                   MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

acquireEditToken

public String acquireEditToken(String callerReference,
                               String tokenID,
                               PaymentMethod paymentMethod,
                               String returnURL)
                        throws FPSException,
                               MalformedURLException
Generate a signed URL for the CBUI pipeline.

Throws:
FPSException
MalformedURLException

generateUIPipelineURL

public String generateUIPipelineURL(String pipelineName,
                                    String returnURL,
                                    Map<String,String> params)
                             throws MalformedURLException
Generate a signed URL for the CBUI pipeline.

Parameters:
pipelineName - the name of the pipeline
returnURL - the URL where the user should be redirected at the end of the pipeline
params - all CBUI parameters
Returns:
the signed URL
Throws:
MalformedURLException

extractSingleUseTokenFromCBUI

public SingleUseInstrument extractSingleUseTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                                  throws MalformedURLException,
                                                         FPSException
Extract the single use token from the CBUI pipeline return.

Throws:
MalformedURLException
FPSException

extractMultiUseTokenFromCBUI

public MultiUseInstrument extractMultiUseTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                                throws MalformedURLException,
                                                       FPSException
Extract the multi use token from the CBUI pipeline return.

Throws:
MalformedURLException
FPSException

extractRecurringTokenFromCBUI

public RecurringInstrument extractRecurringTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                                  throws MalformedURLException,
                                                         FPSException
Extract the recurring token from the CBUI pipeline return.

Throws:
MalformedURLException
FPSException

extractRecipientTokenFromCBUI

public RecipientInstrument extractRecipientTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                                  throws MalformedURLException,
                                                         FPSException
Extract the recurring token from the CBUI pipeline return.

Throws:
MalformedURLException
FPSException

extractPrepaidTokenFromCBUI

public PrepaidInstrument extractPrepaidTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                              throws MalformedURLException,
                                                     FPSException
Extract the recurring token from the CBUI pipeline return.

Throws:
MalformedURLException
FPSException

extractPostPaidTokenFromCBUI

public PostPaidInstrument extractPostPaidTokenFromCBUI(javax.servlet.http.HttpServletRequest request)
                                                throws MalformedURLException,
                                                       FPSException
Extract the post paid token from the CBUI pipeline return.

Parameters:
request - the HTTP request
Returns:
the post paid token ID
Throws:
MalformedURLException
FPSException

isSignatureValid

public boolean isSignatureValid(javax.servlet.http.HttpServletRequest request)
                         throws MalformedURLException
Throws:
MalformedURLException

makeRequestInt

protected <T> T makeRequestInt(org.apache.http.client.methods.HttpRequestBase method,
                               String action,
                               Map<String,String> params,
                               Class<T> respType)
                    throws FPSException
Throws:
FPSException