Class AccountPaymentManagementEndpoint

java.lang.Object
com.broadleafcommerce.paymenttransaction.web.endpoint.AccountPaymentManagementEndpoint

@FrameworkRestController @FrameworkMapping("/account-payments") @DataRouteByKey("paymentTransaction") public class AccountPaymentManagementEndpoint extends Object
Author:
Chris Kittrell (ckittrell), Sunny Yu
  • Field Details

  • Constructor Details

  • Method Details

    • createPayment

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="ACCOUNT_PAYMENT_MANAGEMENT") public PaymentSummary createPayment(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody CreatePaymentRequest createPaymentRequest, CustomerRef customerRef)
    • readAllPaymentsForOwner

      @FrameworkGetMapping(params={"ownerType","ownerId"}) @Policy(permissionRoots="ACCOUNT_PAYMENT_MANAGEMENT") public org.springframework.data.domain.Page<PaymentSummary> readAllPaymentsForOwner(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam String ownerType, @RequestParam String ownerId, CustomerRef customerRef, @PageableDefault(size=50) org.springframework.data.domain.Pageable page)
    • updatePayment

      @FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="ACCOUNT_PAYMENT_MANAGEMENT") public org.springframework.http.ResponseEntity<PaymentSummary> updatePayment(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String paymentId, @RequestBody UpdatePaymentRequest req, Integer paymentVersion, CustomerRef customerRef)
    • archivePayment

      @FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="ACCOUNT_PAYMENT_MANAGEMENT") public void archivePayment(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String paymentId, Integer paymentVersion, CustomerRef customerRef)
    • validateSavedPaymentMethodIfNecessary

      protected void validateSavedPaymentMethodIfNecessary(@NonNull @NonNull CreatePaymentRequest req, @NonNull @NonNull CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates the saved payment method ownership for the given CreatePaymentRequest and CustomerRef if the saved payment method id is specified.
      Parameters:
      req - the CreatePaymentRequest to validate
      customerRef - the CustomerRef that is attempting to create the payment
      contextInfo - context information related to multitenancy
    • validateSavedPaymentMethodIfNecessary

      protected void validateSavedPaymentMethodIfNecessary(@NonNull @NonNull UpdatePaymentRequest req, @NonNull @NonNull CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates the saved payment method ownership for the given UpdatePaymentRequest and CustomerRef if the saved payment method id is specified.
      Parameters:
      req - the UpdatePaymentRequest to validate
      customerRef - the CustomerRef that is attempting to update the payment
      contextInfo - context information related to multitenancy
    • validateAccountPaymentReadAllRequest

      protected org.springframework.data.domain.Page<Payment> validateAccountPaymentReadAllRequest(@NonNull @NonNull org.springframework.data.domain.Page<Payment> payments, @NonNull @NonNull CustomerRef customerRef, @NonNull @NonNull org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • validatePaymentAccess

      protected boolean validatePaymentAccess(@NonNull @NonNull Payment payment, @NonNull @NonNull CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates the given CustomerRef's access to the given Payment.
      Parameters:
      payment - the Payment being accessed
      customerRef - the CustomerRef representing the user attempting to access the payment
      contextInfo - Context information around sandbox and multitenant state
      Returns:
      true if payment can be accessed by the given CustomerRef, otherwise false
    • getPaymentManagementService

      protected PaymentManagementService<Payment> getPaymentManagementService()
    • getPaymentService

      protected PaymentService<Payment> getPaymentService()
    • getPaymentSummaryService

      protected PaymentSummaryService getPaymentSummaryService()
    • getPaymentVersionValidationService

      protected PaymentVersionValidationService getPaymentVersionValidationService()
    • getPaymentAccessValidationService

      protected PaymentAccessValidationService getPaymentAccessValidationService()
    • getSavedPaymentMethodAccessValidationService

      protected SavedPaymentMethodAccessValidationService getSavedPaymentMethodAccessValidationService()