> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tabby.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Credentials

* Full testing is required for all Custom API and SFCC Integrations, and is optional for Magento and OpenCart Integrations.
* Other integrations do not require testing and can be launched with the Live Keys.

<Note>
  Ensure that you've added snippets on the **Product**, **Cart** and **Checkout** pages.
</Note>

## 1. Payment Success

**Testing Steps:**

1. Add an item to your shopping cart and proceed to checkout.
2. Fill in all the required fields at checkout, and use the following email and phone numbers:

```
Positive flow:
UAE: otp.success@tabby.ai, phone: +971500000001
KSA: otp.success@tabby.ai, phone: +966500000001
Kuwait: otp.success@tabby.ai, phone: +96590000001
```

3. Choose Tabby as the payment method and click "Place order."
4. Complete the payment using <code className="text-blue-600 dark:text-blue-300">OTP:8888</code> on Tabby HPP and redirect to the store's success page.
5. Verify that the capture of the successful payment occurred - check for status <code className="text-blue-600 dark:text-blue-300">CAPTURED</code> on the Merchant Dashboard or Payment status <code className="text-blue-600 dark:text-blue-300">AUTHORIZED</code> and <code className="text-blue-600 dark:text-blue-300">CLOSED</code> via Retrieve Payment API.

**Expected Results:**

1. Store checkout opens.
2. Tabby payment method is available on the checkout page (background pre-scoring passed successfully).
3. Tabby Hosted Payment Page opens.
4. The success Tabby screen appears and redirects to the <code className="text-blue-600 dark:text-blue-300">Success URL</code>; the store's 'Thank you' page appears.
5. Order is captured:
   * Payment Status is <code className="text-blue-600 dark:text-blue-300">CLOSED</code>;
   * captured amount is present in the <code className="text-blue-600 dark:text-blue-300">"captures":\[]</code> array of objects.

## 2. Background Pre-scoring Reject

**Testing Steps:**

1. Add an item to your shopping cart and proceed to checkout.
2. Fill in all the required fields at checkout, and use the following email and phone numbers:

```
Background Pre-scoring reject flow:
UAE: otp.success@tabby.ai, phone: +971500000002
KSA: otp.success@tabby.ai, phone: +966500000002
Kuwait: otp.success@tabby.ai, phone: +96590000002
```

3. Attempt to choose Tabby as the payment method.

**Expected Results:**

1. Store checkout opens.
2. Tabby payment method is hidden or marked as unavailable with the message:
   * English: Sorry, Tabby is unable to approve this purchase, please use an alternative payment method for your order.
   * Arabic: نأسف، تابي غير قادرة على الموافقة على هذه العملية. الرجاء استخدام طريقة دفع أخرى.
3. Tabby is hidden from the payment methods list or marked as unavailable.

## 3. Payment Cancellation

**Testing Steps:**

1. Add an item to your shopping cart and proceed to checkout.
2. Fill in all the required fields at checkout, and use the following email and phone numbers:

```
Positive flow:
UAE: otp.success@tabby.ai, phone: +971500000001
KSA: otp.success@tabby.ai, phone: +966500000001
Kuwait: otp.success@tabby.ai, phone: +96590000001
```

3. Choose Tabby as the payment method and click "Place order."
4. Click on the 'Back to Store' button (Desktop) or the left corner cross button (Mobile), and confirm cancellation.

**Expected Results:**

1. Store checkout opens.
2. Tabby payment method is available on the checkout page (background pre-scoring passed successfully).
3. Tabby Hosted Payment Page opens.
4. Redirect to the <code className="text-blue-600 dark:text-blue-300">Cancel URL</code> - store checkout or cart page. Verify that the cart is not emptied, and a text message with a cancellation reason is shown:
   * English: You aborted the payment. Please retry or choose another payment method.
   * Arabic: لقد ألغيت الدفعة. فضلاً حاول مجددًا أو اختر طريقة دفع أخرى.

## 4. Payment Failure

**Testing Steps:**

1. Add an item to your shopping cart and proceed to checkout.
2. Fill in all the required fields at checkout, and use the following email and phone numbers:

```
Negative flow:
UAE: otp.rejected@tabby.ai, phone: +971500000001
KSA: otp.rejected@tabby.ai, phone: +966500000001
Kuwait: otp.rejected@tabby.ai, phone: +96590000001
```

3. Choose Tabby as the payment method and click "Place order."
4. Finish the payment using <code className="text-blue-600 dark:text-blue-300">OTP:8888</code> in Tabby HPP.
5. Confirm returning to the store by clicking the 'Back to store' button.
6. Verify the payment status via Retrieve Payment API.

**Expected Results:**

1. Store checkout opens.
2. Tabby payment method is available on the checkout page (background pre-scoring passed successfully).
3. Tabby Hosted Payment Page opens.
4. The rejection screen with the message 'We can’t approve this purchase' appears.
5. Redirect to the <code className="text-blue-600 dark:text-blue-300">Failure URL</code> - store checkout or cart page. Verify that the cart is not emptied, and a text message with a failure reason is shown:
   * English: Sorry, Tabby is unable to approve this purchase, please use an alternative payment method for your order.
   * Arabic: نأسف، تابي غير قادرة على الموافقة على هذه العملية. الرجاء استخدام طريقة دفع أخرى.
6. Tabby payment method is still available for selection among payment methods on Checkout.
7. No order appears in the Merchant Dashboard (unsuccessful orders are not displayed in the Dashboard), Payment Status <code className="text-blue-600 dark:text-blue-300">REJECTED</code>.

## 5. Corner Case

**Testing Steps:**

1. Add an item to your shopping cart and proceed to checkout.
2. Fill in all the required fields at checkout, and use the following email and phone numbers:

```
Negative flow:
UAE: otp.success@tabby.ai, phone: +971500000001
KSA: otp.success@tabby.ai, phone: +966500000001
Kuwait: otp.success@tabby.ai, phone: +96590000001
```

3. Choose Tabby as the payment method and click "Place order."
4. Finish the payment using <code className="text-blue-600 dark:text-blue-300">OTP:8888</code> in Tabby HPP.
5. Once you see the Success Tabby screen (with the tick), **close the browser tab before the redirection.**
6. Verify that the **capture** of the successful payment occurred - check **order status <code className="text-blue-600 dark:text-blue-300">CAPTURED</code> on the Merchant Dashboard** or Payment status via Retrieve Payment API is <code className="text-blue-600 dark:text-blue-300">CLOSED</code>. Ensure the order is marked **successful** on your side.

**Expected Results:**

1. Store checkout opens.
2. Tabby payment method is available on the checkout page (background pre-scoring passed successfully).
3. Tabby Hosted Payment Page opens.
4. There is no redirection to the Success page as the browser tab is closed before redirection.
5. Payment Status changes to <code className="text-blue-600 dark:text-blue-300">AUTHORIZED</code>, then after capture is triggered, it changes to <code className="text-blue-600 dark:text-blue-300">CLOSED</code> with a captured amount in the <code className="text-blue-600 dark:text-blue-300">"captures":\[]</code> array of objects, triggered by the Webhook notifications or Cron Job.<br />
   Retrieve payment status returned status <code className="text-blue-600 dark:text-blue-300">AUTHORIZED</code> **before capture** and <code className="text-blue-600 dark:text-blue-300">CLOSED</code> **after capture**.

<Note>
  If you encounter any non-captured payments (with <code className="text-blue-600 dark:text-blue-300">AUTHORIZED</code> status on Payments API or <code className="text-blue-600 dark:text-blue-300">NEW</code> status on Merchant Dashboard), you can initiate a **Manual Capture** or **Cancel** on the Merchant Dashboard, or **Capture** or **Close** Payment API Request.
</Note>

## 6. Payment Refund via API

If you are not using the Tabby dashboard.

**Testing Steps:**

1. Choose an order on your OMS and perform a refund.
2. Check the order on the Tabby Merchant Dashboard and Payment status via Retrieve request.

**Expected Results:**

1. The refund is reflected on the OMS without any API errors.
2. The order has Refunded/Partially Refunded status in the Tabby Merchant Dashboard, and the Payment status is <code className="text-blue-600 dark:text-blue-300">CLOSED</code> with the refunded amount in the <code className="text-blue-600 dark:text-blue-300">refunds":\[]</code> array of objects.

## 7. Tabby Checkout Focus Change (Mobile Apps)

**Precondition:** Tabby Checkout is opened using positive flow credentials at the OTP step.

**Testing Steps:**

1. At the OTP step on Tabby Checkout opened in the Webview/In-App browser, minimize the app by navigating to the home screen.
2. Wait a few seconds and then return to the app.

**Expected Results:**

1. The app correctly recovers the Tabby checkout screen at the same step. No crashes or hangs of the app after the return.
2. No App or Webview issues appear.
