Created
May 28, 2013 15:03
-
-
Save timrogers/5663410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
GoCardless::$environment = 'sandbox'; // Whilst you're testing... | |
$account_details = array( | |
'app_id' => 'app id', | |
'app_secret' => 'app secret', | |
'merchant_id' => 'merchant id', | |
'access_token' => 'access token' | |
); | |
GoCardless::set_account_details($account_details); | |
$bill_details = array( | |
'amount' => $_POST['amount'], // You might want to do some filtering on this first to check it's the right format | |
'name' => "Donation to My Charity" | |
); | |
// Generate the url | |
$bill_url = GoCardless::new_bill_url($bill_details); | |
// Redirect to the URL that was generated | |
die(header("Location: " . $bill_url)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment