Class ExternalTabbyProvider
java.lang.Object
com.broadleafcommerce.tabby.provider.external.AbstractExternalProvider
com.broadleafcommerce.tabby.provider.external.ExternalTabbyProvider
- All Implemented Interfaces:
TabbyProvider
-
Constructor Summary
ConstructorsConstructorDescriptionExternalTabbyProvider
(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 Summary
Modifier and TypeMethodDescriptioncapturePayment
(@NonNull String paymentId, @NonNull TabbyCapturePaymentRequest request, String applicationId, String tenantId) Initiates a full or partial capture of Tabby payment.closePayment
(@NonNull String paymentId, String applicationId, String tenantId) Closes the Tabby payment & Reverse-Authorizes any non-captured amounts.createCheckoutSession
(@NonNull TabbyCheckoutSession createCheckoutSessionRequest, String applicationId, String tenantId) Creates a Checkout session.executePreScoring
(@NonNull TabbyCheckoutSession createCheckoutSessionRequest, String applicationId, String tenantId) Executes a Tabby Pre-Scoring request to determine if Tabby can be used for the cart.protected org.springframework.web.util.UriComponentsBuilder
protected TabbyConfigurationProperties
protected ExternalTabbyProviderProperties
protected com.broadleafcommerce.common.extension.TypeFactory
refundPayment
(@NonNull String paymentId, @NonNull TabbyRefundPaymentRequest request, String applicationId, String tenantId) Initiates a full or partial refund of Tabby payment.retrievePayment
(@NonNull String paymentId, String applicationId, String tenantId) Get the Tabby payment by ID.protected Consumer<org.springframework.http.HttpHeaders>
setBearerAuthPublicKeyHeader
(String applicationId, String tenantId) protected Consumer<org.springframework.http.HttpHeaders>
setBearerAuthSecretKeyHeader
(String applicationId, String tenantId) Methods inherited from class com.broadleafcommerce.tabby.provider.external.AbstractExternalProvider
executeRequest, getHeaders, getObjectMapper, getWebClient, orderToParamValue, pageableToParams, uriVars
-
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 interfaceTabbyProvider
- Parameters:
createCheckoutSessionRequest
- the request bodyapplicationId
- the application idtenantId
- 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 interfaceTabbyProvider
- Parameters:
createCheckoutSessionRequest
- the request bodyapplicationId
- the application idtenantId
- 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 interfaceTabbyProvider
- Parameters:
paymentId
- id of the payment to capturerequest
- the request to capture paymentapplicationId
- the application idtenantId
- 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 interfaceTabbyProvider
- Parameters:
paymentId
- id of the payment to refundrequest
- the request to refund paymentapplicationId
- the application idtenantId
- 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 interfaceTabbyProvider
- Parameters:
paymentId
- id of the payment to closeapplicationId
- the application idtenantId
- 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 interfaceTabbyProvider
- Parameters:
paymentId
- id of the payment to reverseapplicationId
- the application idtenantId
- the tenant id- Returns:
- the response from Tabby API
-
setBearerAuthSecretKeyHeader
-
setBearerAuthPublicKeyHeader
-
getApiUrlBuilder
protected org.springframework.web.util.UriComponentsBuilder getApiUrlBuilder() -
getProviderProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getConfigProperties
-