> For the complete documentation index, see [llms.txt](https://docs.rafflex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rafflex.io/getting-started/payment-gateway/test-and-live-card-payments.md).

# Test and Live Card Payments

How test mode works for card payments, how to place a safe test order, and how to switch your site over to live payments with confidence.

Your site can take card payments in one of two modes:

* **Test mode.** Checkout works exactly as normal, but no real money is taken. This is perfect for trying everything out before you launch.
* **Live mode.** Real card payments are taken and paid into your Cashflows merchant account.

Every new site starts in **test mode**. You switch to live mode yourself when you are ready, using the **Cashflows Live Payments** toggle.

This page builds on [Payment Gateway](https://docs.rafflex.io/getting-started/payment-gateway.md), which covers applying to Cashflows and finding your details.

***

### Where the Switch Lives

1. In the **admin panel**, find the **Content** group in the left-hand menu and click **Settings**.
2. Click **Payments** in the settings menu.
3. Scroll to the **Cashflows Configuration** section.
4. Find the **Cashflows Live Payments** toggle.

The toggle is **off** by default. Underneath it you will see the reminder: *"Enable this only when ready for live payments. Test mode is safer for development"*.

| Cashflows Live Payments | What happens                                                                                          |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| **Off** (test mode)     | Card payments go to the Cashflows test system. No real money is taken from the card.                  |
| **On** (live mode)      | Card payments are real. Money is taken from the customer's card and paid into your Cashflows account. |

{% hint style="warning" %}
The **Cashflows Config ID** and **Cashflows API Key** must match the mode you are in. Test details only work in test mode, and live details only work in live mode. If they do not match, customers will see an error when they try to pay.
{% endhint %}

***

### What Customers See in Test Mode

While **Cashflows Live Payments** is off, a yellow warning box appears on your checkout page, just above the payment options. It says:

> **Card Payment Testing ENABLED. Real Money not taken.**

This is your quickest way to tell which mode your site is in. If you can see this box, you are in test mode. If it has gone, you are live.

{% hint style="danger" %}
**Never launch with this banner showing.** Customers who see it may think your site is not genuine, and any card orders placed in test mode will not have taken a real payment. Always switch to live before you open your site to the public.
{% endhint %}

A few things to know about test mode:

* It only affects **card** payments. Orders paid fully with **Wallet** use the customer's site credit, so their balance really does go down.
* If you have **Enable Wallet Top Up** switched on in **Settings**, then **Checkout**, card top ups on the customer's wallet page also follow test or live mode.
* Test card orders still create real orders, tickets and confirmation emails on your site. That is why you should only test on a competition customers cannot see, and tidy up afterwards.
* Orders placed while **Cashflows Live Payments** is off do not count towards your Rafflex per order fee.

***

### Place a Safe Test Order

The safest way to test is on a competition that is **not active**. Customers cannot see or enter an inactive competition, but you can still open it and buy tickets while you are logged in with your admin account.

{% stepper %}
{% step %}

#### Create a test competition

1. In the **admin panel**, click **Competitions** in the left-hand menu.
2. Click **New Competition**.
3. Give it a clear name, such as **TEST DO NOT ENTER**, and a low ticket price.
4. Set an end date in the future. You cannot buy tickets for a competition that has ended.
5. Leave the **Active** toggle **off**.
6. Save the competition.

For a full guide to the competition form, see [Create a Competition](https://docs.rafflex.io/create-your-first-raffle/create-a-competition.md).
{% endstep %}

{% step %}

#### Open it on your site

Stay logged in with your admin account. On the competition's edit page, click **Preview** at the top. This opens the competition on your website, even though it is not active.
{% endstep %}

{% step %}

#### Buy a ticket

Add a ticket to your basket and go to the checkout. Check you can see the yellow **Card Payment Testing ENABLED** box if you are in test mode.

Choose **Cards, Apple & Google Pay**, tick **I am over 18 & agree to the terms and conditions**, and click **Pay**. You will be taken to the Cashflows payment page.
{% endstep %}

{% step %}

#### Complete the payment

In test mode, use the test card details supplied by Cashflows. If you do not have them, ask your Cashflows contact.

Once payment goes through, you will be brought back to your site and shown your order confirmation.
{% endstep %}

{% step %}

#### Check the results

* Check the order appears in the admin panel under **Orders** (in the **Competitions** group of the left-hand menu), with your tickets.
* Check the order confirmation email arrives in your inbox. If it does not, see [Email Setup](https://docs.rafflex.io/additional-settings/email-setup.md).
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
Your order must meet your site's **Minimum Cart Value**, which you can find in **Settings**, then **Checkout**. If your test ticket is cheaper than this, add more tickets to your basket. See [Order & Cart Settings](https://docs.rafflex.io/additional-settings/settings/order-and-cart-settings.md).
{% endhint %}

***

### Switch to Live Payments

When Cashflows has approved your account and your site is ready, follow these steps.

{% stepper %}
{% step %}

#### Get your live details from Cashflows

Log in to your Cashflows merchant dashboard and go to **Cashflows GO**, then **Configurations**, then **API Data**. Copy your live **Configuration ID** and **API Key**.
{% endstep %}

{% step %}

#### Enter them in Rafflex

1. In the **admin panel**, click **Settings**, then **Payments**.
2. In the **Cashflows Configuration** section, replace the **Cashflows Config ID** with your live Configuration ID.
3. Replace the **Cashflows API Key** with your live API Key.

Take care to paste each one in full, with no spaces before or after.
{% endstep %}

{% step %}

#### Turn on live payments

Switch on **Cashflows Live Payments**, then click **Save Settings**. You will see a green **Payment settings saved successfully** message.
{% endstep %}

{% step %}

#### Place one real, low value order

Repeat the safe test order above on your inactive test competition, this time paying with your own real card. Check that:

* the yellow testing banner has gone from the checkout
* the payment goes through and you see your order confirmation
* the order shows in **Orders**, and the confirmation email arrives
* the payment appears in your Cashflows dashboard
  {% endstep %}

{% step %}

#### Cancel the test order

Open the order in **Orders** and click **Cancel Order**. Read the confirmation box carefully before you confirm:

* Untick the box that adds the order total to the customer's site credit, unless you want that credit on your own account.
* Cancelling in Rafflex does **not** send money back to your card. Refund the payment yourself inside your Cashflows dashboard.

The full explanation of the cancel options is in [Cancelling and Refunding Orders](https://docs.rafflex.io/managing-your-site/orders/cancelling-and-refunding-orders.md).
{% endstep %}

{% step %}

#### Tidy up

Delete your test competition, or make sure it stays inactive, so it never appears on your site. See [Managing Your Competitions](https://docs.rafflex.io/create-your-first-raffle/managing-competitions.md) for how to delete one. Then work through the [Launch Checklist](https://docs.rafflex.io/getting-started/checklist.md).
{% endstep %}
{% endstepper %}

{% hint style="success" %}
That is it. Your site is now taking real payments.
{% endhint %}

***

### Going Back to Test Mode

You can switch **Cashflows Live Payments** off again at any time, for example if you want to test a change. Remember:

* While it is off, the testing banner shows on your checkout and **no real money is taken**, even from real customers.
* Your live Cashflows details are meant for live mode, so card payments may fail until you switch back.

For these reasons, do not switch back to test mode on a site that is already open to customers. If you need to test something on a live site, contact Rafflex support first.

New sites come with Cashflows test details already filled in, and test mode only works with those test details. If you replaced them with your own details before you were ready and now want to try test payments again (including the test payment page where you can pick a successful or failed payment), contact Rafflex support and ask them to put the test details back.

***

### Cashflows Webhook-Only Mode

You will also see a toggle called **Cashflows Webhook-Only Mode** in the **Cashflows Configuration** section. It is **off** by default, and you should leave it off unless Rafflex support advises you to turn it on.

When it is on, customers who have just paid are shown a short **Processing Your Payment** page while their payment is confirmed. It asks them to wait on the page, and they are moved on to their order confirmation automatically once the payment is confirmed.

***

### Payment Gateways and What Customers See

The **Payment Gateways** tick boxes in the **Card Provider** section decide which payment options appear at checkout. Here is how each one looks to your customers:

| Tick box in your admin panel  | What customers see at checkout                 | When it appears                                                                    |
| ----------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------- |
| **Cards, Apple & Google Pay** | **Cards, Apple & Google Pay**, with card logos | Whenever the order costs something                                                 |
| **Wallet**                    | **Wallet**, with their balance                 | When a signed-in customer's site credit covers the whole order                     |
| **Partial Wallet + Card**     | **Wallet + Card**, with their balance          | When a signed-in customer has some site credit, but not enough for the whole order |

When a customer chooses **Wallet + Card**, a note appears explaining how much is being paid with site credit and how much will be paid by card. They then pay the remainder on the Cashflows payment page as normal.

{% hint style="info" %}
Only the card part of an order follows test or live mode. A **Wallet** order is paid entirely from site credit, so no card is involved. With **Wallet + Card**, the site credit is used straight away and the card part follows test or live mode in the same way as a normal card payment.
{% endhint %}
