Skip to content

Dev Subscriptions

Christian Dangl edited this page Jun 7, 2023 · 2 revisions

Testing Subscriptions locally

It's possible to test renewing of subscriptions locally. Please start by setting up NGROK with our Dev Guide for local webhooks. This is necessary to "confirm" created subscriptions after a checkout. Otherwise they are not active.

Afterwards you can easily renew a subscription by calling a local URL (Subscription Webhok). We would recommend our Swagger test project in the plugin repository. There is a webhook to renew a subscription.

You can simply call it, all you need is the correct data and a configuration in your .env.

What data?

The webhook requires the local subscription ID of Shopware. You can either find it in the administration (subscription overview) or in the database.

The second parameter is a transaction ID of Mollie. Just use any tr_xyz ID that exists in your Mollie Dashboard (maybe with a status that you want to try).

To make it work, we need a second configuration...

.ENV Dev Mode

If you would send the request from above, the webhook will very likely respond with the error that the transaction does not belong to this subscription. This is for security reasons. To unlock a simple usage of all transaction IDs, please add this to your .env file.

MOLLIE_DEV_MODE=1

Repeat the request and it should all work now. Your subscription is renewed, and a new order should exist in Shopware.

Clone this wiki locally