Skip to content

Onboarding Playground

Christian Dangl edited this page Nov 3, 2022 · 2 revisions

Hi,

This page is all about getting started with a locally running Shopware instance and playing around with Mollie. This is a perfect thing if you don't have a Shopware 6 yet, or if you just want to test a few things locally.

Please keep in mind, while it's usually up to you how to run Shopware 6, we use the Docker images from dockware.io in this article. These help you to easily run any Shopware 6 version locally using Docker.

1. Mollie Account

First you need your own Mollie Account.

Go to Mollie to create your account.

This should not take a lot of time and you should already be able to test the plugin, while your account is being verified.

2. Install Docker (only first time)

We start by downloading and installing Docker on your system. This allows you to easily start local web servers (Containers) based on Docker templates (Images).

Such a container will then serve our local Shopware, based on the dockware.io Docker images.

Download and Install Docker: https://www.docker.com/products/docker-desktop

Please also make sure that it's started

3. Prepare local Domain (only first time)

Mollie doesn't allow that payments are made from "http://localhost". So instead of localhost we need to use a different domain. This only needs to be done once!

Let's just create an entry, so that our computer thinks, http://testing.mollie.shop is existing on our local system. Or in other words, whenever you open that web URL, it will just open your local computer and see if a web application is found.

Open your terminal and just enter this command. It will open your file explorer with the directory /etc.

open /etc

There is a file called hosts. Just copy/paste it onto your Desktop. Then open the file with any text editor.

Now add this line to the bottom and save the file

127.0.0.1 testing.mollie.shop

Copy and replace the file from the Desktop to the original directory.

That's it. From now on you can use http://testing.mollie.shop, which just looks for a web application on your local system.

4. Start Shopware

Now that Docker is started, and our domain is recognized, we can finally start Shopware.

Please open your Terminal and enter the following commands. Also keep in mind, you can use any Shopware version after the ":". The available dockware images can be found at: https://dockware.io/images

The first time, the image is downloaded, which might take a bit, but then its usually started in 5 seconds.

docker run --rm --name shopware -p 80:80 -p 443:443 -p 3306:3306 -d dockware/dev:6.4.16.1

With this command, you should see if the container is running.

docker ps

Now let's just switch our Shopware Sales Channel domain to our new one. You could also do this in the Admin at http://localhost, but this works faster :)

docker exec shopware bash -c 'php bin/console sales-channel:update:domain testing.mollie.shop'

That's it, you can now open your shop at http://testing.mollie.shop.

If you want to remove your Docker container again (maybe before starting a new one), just run this:

docker rm -f shopware

4. Download and Install Plugin

Now just download any plugin version that you want to test. We would recommend using the downloads of the ZIP files from Github.

Github URL: Stable Releases

Upload the plugin in the Administration as described and install + activate it.

5. Configure API Keys

It's time to configure your plugin to make it work in your shop.

The plugin will create new payment methods that can be used like any other payment methods.

Please keep in mind, that you can only use Mollie payment methods in Shopware, that are unlocked and enabled in your Mollie Dashboard too!

Now configure your LIVE or TEST API keys in the plugin configuration along with a correct "test mode" or "live mode" that you need in this shop.

6. Configure Payment Methods

In Shopware 6, you have to activate payment methods in the general settings, and also assign them to your Sales Channels. Once you do this, you should be able to see your Mollie Payment methods in your shop.

7. Start Testing

Mollie provides a simple Sandbox mode to start testing. Open the plugin configuration and enable the "Test Mode" for your Sales Channel.

If you now start a payment in your shop, you should already see the sandbox page, where you can easily decide what should happen in your test scenario.

8. Advanced

Receiving Status Updates from Mollie (optional)

Mollie notifies your shop about payment status updates. This means Mollie needs to be able to communicate with your Shopware 6 shop.

While not all processes need webhooks, some do need them (Shipping orders and more.).

If you want to use webhooks locally, please read this: Using Webhooks locally

Access Database

With dockware you can just use any MySQL client and connect using the 3306 port. Credentials can be found at: https://docs.dockware.io/use-dockware/default-credentials

In addition to this, you can also just open /adminer.php web page to access the database.

See more here: https://docs.dockware.io/features/adminer

Clone this wiki locally