customers->page(null, 1)[0]; /* * The subscription ID, starting with sub_ */ $subscriptionId = isset($_GET['subscription_id']) ? $_GET['subscription_id'] : ''; /* * Customer Subscription deletion parameters. * * See: https://www.mollie.com/nl/docs/reference/subscriptions/delete */ $canceledSubscription = $customer->cancelSubscription($subscriptionId); /* * The subscription status should now be canceled */ echo "

The subscription status is now: '" . htmlspecialchars($canceledSubscription->status) . "'.

\n"; } catch (\Mollie\Api\Exceptions\ApiException $e) { echo "API call failed: " . htmlspecialchars($e->getMessage()); }