Class DefaultPassthroughTestingTransactionService
- java.lang.Object
 - 
- com.broadleafcommerce.paymentgateway.service.passthrough.DefaultPassthroughTestingTransactionService
 
 
- 
- All Implemented Interfaces:
 PassthroughTransactionService,PaymentGatewayTransactionService,PaymentGatewayTypeAware
public class DefaultPassthroughTestingTransactionService extends Object implements PassthroughTransactionService
Passthrough Transaction Service intended to be used for Testing Purposes. Allows for testing of specific response and error scenarios by passing in different payment requests with known test values. - Card Holder: Bill Broadleaf - Test Card Number: 4000000000000028 (Soft Decline - address_line1_check_failed) - Test Card Number: 4000000000000101 (Soft Decline - cvc_check_failed) - Test Card Number: 4000000000009995 (Hard Decline - insufficient_funds) - Test Card Number: 4000000000009979 (Hard Decline - lost_stolen_card) 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultPassthroughTestingTransactionService() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentResponseauthorize(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.AUTHORIZEtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.PaymentResponseauthorizeAndCapture(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.AUTHORIZE_AND_CAPTUREtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.PaymentResponsecapture(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.CAPTUREtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.PaymentResponsedetachedCredit(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.DETACHED_CREDITtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.StringgetGatewayType()Each payment module should have a unique implementation ofPaymentGatewayTypewith only a single type.protected StringgetPaymentToken(PaymentRequest paymentRequest)protected PaymentResponsehandleAVSoftDecline(PaymentRequest paymentRequest, TransactionType transactionType)protected PaymentResponsehandleCVSoftDecline(PaymentRequest paymentRequest, TransactionType transactionType)protected PaymentResponsehandleInsufficientFundsHardDecline(PaymentRequest paymentRequest, TransactionType transactionType)protected PaymentResponsehandleLostStolenHardDecline(PaymentRequest paymentRequest, TransactionType transactionType)protected booleanpaymentTokenMatches(String base64Token, String maskedCardNumber)PaymentResponserefund(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.REFUNDtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.PaymentResponsereverseAuthorize(PaymentRequest paymentRequest)Responsible for executing aDefaultTransactionTypes.REVERSE_AUTHtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
identifyParentTransactionReferenceIfExists, identifyTransactionTypeFromTransactionResults 
 - 
 
 - 
 
- 
- 
Method Detail
- 
authorize
public PaymentResponse authorize(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.AUTHORIZEtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 authorizein interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the authorization transaction
 - Throws:
 PaymentException
 
- 
capture
public PaymentResponse capture(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.CAPTUREtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 capturein interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the capture transaction
 - Throws:
 PaymentException
 
- 
authorizeAndCapture
public PaymentResponse authorizeAndCapture(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.AUTHORIZE_AND_CAPTUREtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 authorizeAndCapturein interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the authorization & capture transaction
 - Throws:
 PaymentException
 
- 
reverseAuthorize
public PaymentResponse reverseAuthorize(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.REVERSE_AUTHtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 reverseAuthorizein interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the reverse authorization transaction
 - Throws:
 PaymentException
 
- 
refund
public PaymentResponse refund(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.REFUNDtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 refundin interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the refund transaction
 - Throws:
 PaymentException
 
- 
detachedCredit
public PaymentResponse detachedCredit(PaymentRequest paymentRequest) throws PaymentException
Description copied from interface:PaymentGatewayTransactionServiceResponsible for executing aDefaultTransactionTypes.DETACHED_CREDITtransaction against the payment gateway, based on the providedPaymentRequest, & returning the transaction's results in the form of aPaymentResponse.- Specified by:
 detachedCreditin interfacePaymentGatewayTransactionService- Parameters:
 paymentRequest- The request payload that must be converted into the gateway's expected payload- Returns:
 - The results of the void transaction
 - Throws:
 PaymentException
 
- 
getGatewayType
public String getGatewayType()
Description copied from interface:PaymentGatewayTypeAwareEach payment module should have a unique implementation ofPaymentGatewayTypewith only a single type. For instance, the Braintree module would have a 'BraintreePaymentGatewayType' implementation which defines its gateway type key.- Specified by:
 getGatewayTypein interfacePaymentGatewayTypeAware- Returns:
 - The 
PaymentGatewayTyperelated to implementing resource 
 
- 
handleAVSoftDecline
protected PaymentResponse handleAVSoftDecline(PaymentRequest paymentRequest, TransactionType transactionType)
 
- 
handleCVSoftDecline
protected PaymentResponse handleCVSoftDecline(PaymentRequest paymentRequest, TransactionType transactionType)
 
- 
handleInsufficientFundsHardDecline
protected PaymentResponse handleInsufficientFundsHardDecline(PaymentRequest paymentRequest, TransactionType transactionType)
 
- 
handleLostStolenHardDecline
protected PaymentResponse handleLostStolenHardDecline(PaymentRequest paymentRequest, TransactionType transactionType)
 
- 
getPaymentToken
protected String getPaymentToken(PaymentRequest paymentRequest)
 
 - 
 
 -