You can use the Mollie API to process payments in apps intended for, for instance, phones and tablets using iOS or Android.

Creating a payment

When the client wants to make a payment, you first have to establish a connection with your own server - for instance the server of the website that is linked to the app. The server has the API key, which it uses to connect with the Mollie API to create a payment.

Just to be clear: you cannot store the API key in your app's source code. After all, the app is installed on the client's device. So this is not a safe place for the Mollie API key.

After creating the payment, your server will receive from Mollie a paymentUrl. The server sends this URL back to the app, which in turn redirects the user to the browser of the device to initiate the payment with Mollie.

Redirecting the user to your app after payment

You can use a so-called URI-scheme to reopen the app after payment has been completed. See the following article on how to set up your own URI scheme: How do I redirect the user to my app after a payment?

Submitting the payment status

When the payment status changes - for instance after a successful payment - Mollie will call your server (the so-called 'webhook' you set up when you created the payment). From the webhook, you can then process the order. At this point, you can use a push notification to inform your app about the change in the payment status. Your app can then show your client that the payment has been processed, or act on it by initiating a follow-up process (for instance releasing credits or reserving a specific product).

Was this article helpful?