Class ExternalCallPayPalCheckoutServiceImpl
java.lang.Object
org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
org.broadleafcommerce.payment.service.gateway.ExternalCallPayPalCheckoutServiceImpl
- All Implemented Interfaces:
org.broadleafcommerce.common.payment.service.FailureCountExposable,org.broadleafcommerce.common.vendor.service.monitor.ServiceStatusDetectable<PayPalRequest>,ExternalCallPayPalCheckoutService
@Service("blExternalCallPayPalCheckoutService")
public class ExternalCallPayPalCheckoutServiceImpl
extends org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
implements ExternalCallPayPalCheckoutService
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsFields inherited from class org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall
failureCount, isUp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(PayPalRequest paymentRequest) Makes a request to PayPalcommunicateWithVendor(PayPalRequest paymentRequest) com.paypal.base.rest.APIContextconstructAPIContext(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) com.paypal.api.payments.AmountgetPayPalAmountFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) com.paypal.api.payments.ItemListgetPayPalItemListFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO, boolean shouldPopulateShipping) com.paypal.api.payments.ShippingAddressgetPayPalShippingAddress(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) voidsetCommonDetailsResponse(com.paypal.api.payments.Payment response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO) Converts a PayPal payment into a PaymentResponseDTOvoidsetCommonDetailsResponse(AgreementToken response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO, org.broadleafcommerce.common.money.Money amount, String orderId, boolean checkoutComplete) Methods inherited from class org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall
clearStatus, getServiceStatus, incrementFailure, process
-
Field Details
-
configuration
-
-
Constructor Details
-
ExternalCallPayPalCheckoutServiceImpl
public ExternalCallPayPalCheckoutServiceImpl()
-
-
Method Details
-
getConfiguration
- Specified by:
getConfigurationin interfaceExternalCallPayPalCheckoutService
-
setCommonDetailsResponse
public void setCommonDetailsResponse(AgreementToken response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO, org.broadleafcommerce.common.money.Money amount, String orderId, boolean checkoutComplete) - Specified by:
setCommonDetailsResponsein interfaceExternalCallPayPalCheckoutService
-
setCommonDetailsResponse
public void setCommonDetailsResponse(com.paypal.api.payments.Payment response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO) Description copied from interface:ExternalCallPayPalCheckoutServiceConverts a PayPal payment into a PaymentResponseDTO- Specified by:
setCommonDetailsResponsein interfaceExternalCallPayPalCheckoutService- Parameters:
response- A PayPal payment that should be used to be converted into a PaymentResponseDTOresponseDTO- The response dto that should be used to copy information from the PayPal payment
-
getPayPalShippingAddress
public com.paypal.api.payments.ShippingAddress getPayPalShippingAddress(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) - Specified by:
getPayPalShippingAddressin interfaceExternalCallPayPalCheckoutService
-
getPayPalItemListFromOrder
public com.paypal.api.payments.ItemList getPayPalItemListFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO, boolean shouldPopulateShipping) - Specified by:
getPayPalItemListFromOrderin interfaceExternalCallPayPalCheckoutService
-
getPayPalAmountFromOrder
public com.paypal.api.payments.Amount getPayPalAmountFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) - Specified by:
getPayPalAmountFromOrderin interfaceExternalCallPayPalCheckoutService
-
getServiceName
- Specified by:
getServiceNamein interfaceorg.broadleafcommerce.common.vendor.service.monitor.ServiceStatusDetectable<PayPalRequest>
-
call
public PayPalResponse call(PayPalRequest paymentRequest) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException Description copied from interface:ExternalCallPayPalCheckoutServiceMakes a request to PayPal- Specified by:
callin interfaceExternalCallPayPalCheckoutService- Parameters:
paymentRequest- The payment request that should be executed. The operation that is executed is depedent on which implementation ofPayPalRequestis sent- Returns:
- the respective PayPalResponse that corresponds to the given PayPalRequest
- Throws:
org.broadleafcommerce.common.vendor.service.exception.PaymentException
-
communicateWithVendor
- Specified by:
communicateWithVendorin classorg.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse> - Throws:
Exception
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThresholdin interfaceorg.broadleafcommerce.common.payment.service.FailureCountExposable- Specified by:
getFailureReportingThresholdin classorg.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
-
constructAPIContext
public com.paypal.base.rest.APIContext constructAPIContext(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) - Specified by:
constructAPIContextin interfaceExternalCallPayPalCheckoutService
-