Class ExternalTabbyProvider

java.lang.Object
com.broadleafcommerce.tabby.provider.external.AbstractExternalProvider
com.broadleafcommerce.tabby.provider.external.ExternalTabbyProvider
All Implemented Interfaces:
TabbyProvider

public class ExternalTabbyProvider extends AbstractExternalProvider implements TabbyProvider
  • Constructor Details

    • ExternalTabbyProvider

      public ExternalTabbyProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ExternalTabbyProviderProperties providerProperties, TabbyConfigurationProperties configProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • executePreScoring

      public Map<String,Object> executePreScoring(@NonNull @NonNull TabbyCheckoutSession createCheckoutSessionRequest, @Nullable String applicationId, @Nullable String tenantId)
      Description copied from interface: TabbyProvider
      Executes a Tabby Pre-Scoring request to determine if Tabby can be used for the cart.
      Specified by:
      executePreScoring in interface TabbyProvider
      Parameters:
      createCheckoutSessionRequest - the request body
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the created checkout session
    • createCheckoutSession

      public TabbyCheckoutSession createCheckoutSession(@NonNull @NonNull TabbyCheckoutSession createCheckoutSessionRequest, @Nullable String applicationId, @Nullable String tenantId)
      Description copied from interface: TabbyProvider
      Creates a Checkout session. Used for Session and Payment Creation.
      Specified by:
      createCheckoutSession in interface TabbyProvider
      Parameters:
      createCheckoutSessionRequest - the request body
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the created checkout session
    • capturePayment

      public TabbyPayment capturePayment(@NonNull @NonNull String paymentId, @NonNull @NonNull TabbyCapturePaymentRequest request, @Nullable String applicationId, @Nullable String tenantId)
      Description copied from interface: TabbyProvider
      Initiates a full or partial capture of Tabby payment. When the full amount is captured, the payment will be automatically closed by Tabby. If only a part of payment captured, the payment will remain in Tabby's Authorized state until the rest of the amount is captured or closed.
      Specified by:
      capturePayment in interface TabbyProvider
      Parameters:
      paymentId - id of the payment to capture
      request - the request to capture payment
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the Tabby payment
    • refundPayment

      public TabbyPayment refundPayment(@NonNull @NonNull String paymentId, @NonNull @NonNull TabbyRefundPaymentRequest request, String applicationId, String tenantId)
      Description copied from interface: TabbyProvider
      Initiates a full or partial refund of Tabby payment. You can only refund a payment that has been captured and closed. By default, Tabby processes refunds instantly. Optionally, "Delayed Refunds" can be enabled, causing there is a 24 hours gap between the moment when Refund API is called and when it was actually performed. During this time the refund can be cancelled via Tabby's deletePaymentRefund API. Also during this time, another refund for the same payment id cannot be initiated until the first one is either processed or cancelled.
      Specified by:
      refundPayment in interface TabbyProvider
      Parameters:
      paymentId - id of the payment to refund
      request - the request to refund payment
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the Tabby payment
    • closePayment

      public TabbyPayment closePayment(@NonNull @NonNull String paymentId, @Nullable String applicationId, @Nullable String tenantId)
      Description copied from interface: TabbyProvider
      Closes the Tabby payment & Reverse-Authorizes any non-captured amounts. Closed is the final status of a Tabby payment. Tabby payments are automatically closed if it is fully captured. If an order is fully cancelled, please close the payment without capturing it - the customer will be refunded for all paid amount. If only a part of the order is delivered, please capture this part and close the payment – it will mean that another part of the order is not going to be delivered to the customer.
      Specified by:
      closePayment in interface TabbyProvider
      Parameters:
      paymentId - id of the payment to close
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the Tabby payment
    • retrievePayment

      public TabbyPayment retrievePayment(@NonNull @NonNull String paymentId, @Nullable String applicationId, @Nullable String tenantId)
      Description copied from interface: TabbyProvider
      Get the Tabby payment by ID.
      Specified by:
      retrievePayment in interface TabbyProvider
      Parameters:
      paymentId - id of the payment to reverse
      applicationId - the application id
      tenantId - the tenant id
      Returns:
      the response from Tabby API
    • setBearerAuthSecretKeyHeader

      protected Consumer<org.springframework.http.HttpHeaders> setBearerAuthSecretKeyHeader(@Nullable String applicationId, @Nullable String tenantId)
    • setBearerAuthPublicKeyHeader

      protected Consumer<org.springframework.http.HttpHeaders> setBearerAuthPublicKeyHeader(@Nullable String applicationId, @Nullable String tenantId)
    • getApiUrlBuilder

      protected org.springframework.web.util.UriComponentsBuilder getApiUrlBuilder()
    • getProviderProperties

      protected ExternalTabbyProviderProperties getProviderProperties()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getConfigProperties

      protected TabbyConfigurationProperties getConfigProperties()