PHP code example of robustastudio / payfort-start-php
1. Go to this page and download the library: Download robustastudio/payfort-start-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
robustastudio / payfort-start-php example snippets
try {
// Use Start's bindings...
} catch(Start_Error_Banking $e) {
// Since it's a decline, Start_Error_Banking will be caught
print('Status is:' . $e->getHttpStatus() . "\n");
print('Code is:' . $e->getErrorCode() . "\n");
print('Message is:' . $e->getMessage() . "\n");
} catch (Start_Error_Request $e) {
// Invalid parameters were supplied to Start's API
} catch (Start_Error_Authentication $e) {
// There's a problem with that API key you provided
} catch (Start_Error $e) {
// Display a very generic error to the user, and maybe send
// yourself an email
} catch (Exception $e) {
// Something else happened, completely unrelated to Start
}