Interface TabbyProvider
- All Known Implementing Classes:
ExternalTabbyProvider
public interface TabbyProvider
-
Method Summary
Modifier and TypeMethodDescriptioncapturePayment
(String paymentId, TabbyCapturePaymentRequest request, String applicationId, String tenantId) Initiates a full or partial capture of Tabby payment.closePayment
(String paymentId, String applicationId, String tenantId) Closes the Tabby payment & Reverse-Authorizes any non-captured amounts.createCheckoutSession
(TabbyCheckoutSession createCheckoutSessionRequest, String applicationId, String tenantId) Creates a Checkout session.executePreScoring
(TabbyCheckoutSession createCheckoutSessionRequest, String applicationId, String tenantId) Executes a Tabby Pre-Scoring request to determine if Tabby can be used for the cart.refundPayment
(String paymentId, TabbyRefundPaymentRequest request, String applicationId, String tenantId) Initiates a full or partial refund of Tabby payment.retrievePayment
(String paymentId, String applicationId, String tenantId) Get the Tabby payment by ID.
-
Method Details
-
executePreScoring
Map<String,Object> executePreScoring(TabbyCheckoutSession createCheckoutSessionRequest, @Nullable String applicationId, @Nullable String tenantId) Executes a Tabby Pre-Scoring request to determine if Tabby can be used for the cart.- Parameters:
createCheckoutSessionRequest
- the request bodyapplicationId
- the application idtenantId
- the tenant id- Returns:
- the created checkout session
- Throws:
TabbyPreScoringApiException
- if the request failed
-
createCheckoutSession
TabbyCheckoutSession createCheckoutSession(TabbyCheckoutSession createCheckoutSessionRequest, @Nullable String applicationId, @Nullable String tenantId) Creates a Checkout session. Used for Session and Payment Creation.- Parameters:
createCheckoutSessionRequest
- the request bodyapplicationId
- the application idtenantId
- the tenant id- Returns:
- the created checkout session
- Throws:
ProviderApiException
- if the request failed
-
capturePayment
TabbyPayment capturePayment(String paymentId, TabbyCapturePaymentRequest request, @Nullable String applicationId, @Nullable String tenantId) 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.- Parameters:
paymentId
- id of the payment to capturerequest
- the request to capture paymentapplicationId
- the application idtenantId
- the tenant id- Returns:
- the Tabby payment
- Throws:
ProviderApiException
- if the request failed
-
refundPayment
TabbyPayment refundPayment(String paymentId, TabbyRefundPaymentRequest request, @Nullable String applicationId, @Nullable String tenantId) 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.- Parameters:
paymentId
- id of the payment to refundrequest
- the request to refund paymentapplicationId
- the application idtenantId
- the tenant id- Returns:
- the Tabby payment
- Throws:
ProviderApiException
- if the request failed
-
closePayment
TabbyPayment closePayment(String paymentId, @Nullable String applicationId, @Nullable String tenantId) 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.- Parameters:
paymentId
- id of the payment to closeapplicationId
- the application idtenantId
- the tenant id- Returns:
- the Tabby payment
- Throws:
ProviderApiException
- if the request failed
-
retrievePayment
TabbyPayment retrievePayment(String paymentId, @Nullable String applicationId, @Nullable String tenantId) Get the Tabby payment by ID.- Parameters:
paymentId
- id of the payment to reverseapplicationId
- the application idtenantId
- the tenant id- Returns:
- the response from Tabby API
- Throws:
ProviderApiException
- if the request failed
-