getenv(‘GC_ACCESS_TOKEN’),
// ‘environment’ => \GoCardlessPro\Environment::LIVE
]);

$redirectFlow = $client->redirectFlows()->create([
“params” => [
// This will be shown on the payment pages
“description” => “Annual Maintenance and Monitoring Charge”,
// Not the access token
“session_token” => “dummy_session_token”,
“success_redirect_url” => “https://alarmguard.co.uk/direct-debit-setup-success/”,
// Optionally, prefill customer details on the payment page
“prefilled_customer” => [
“given_name” => “Tim”,
“family_name” => “Rogers”,
“email” => “tim@gocardless.com”,
“address_line1” => “338-346 Goswell Road”,
“city” => “London”,
“postal_code” => “EC1V 7LQ”
]
]
]);

// Hold on to this ID – you’ll need it when you
// “confirm” the redirect flow later
print(“ID: ” . $redirectFlow->id . “
“);

print(“URL: ” . $redirectFlow->redirect_url);