Once you have created a payment, you should redirect your customer to the URL in the $payment['_links']['checkout']['href']
This will return the customerId
and mandateId
in the response.
function($customer, array $payment_data)
{
$customer = \is_array($customer) ? $this->mollie->customers->create($customer)->id : $customer;
$payment_data = array_merge($payment_data, ['sequenceType' => 'first']);
try {
return $this->createPayment($payment_data, $customer);
}
catch (\Exception $e) {
throw new \Exception($e->getMessage());
}
}