I'm messing around with Omnipay and I received this message:
Fatal error: Uncaught Error: Class 'Omnipay\Omnipay' not found
The directory listing:
- composer.json
- composer.lock
- test.php
- vendor
test.php
<?php
use Omnipay\Omnipay;
$gateway = Omnipay::create('Stripe');
$gateway->setApiKey('abc123');
$formData = array('number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123');
$response = $gateway->purchase(array('amount' => '10.00', 'currency' => 'USD', 'card' => $formData))->send();
if ($response->isRedirect())
{
// redirect to offsite payment gateway
$response->redirect();
}
elseif ($response->isSuccessful())
{
// payment was successful: update database
print_r($response);
}
else
{
// payment failed: display message to customer
echo $response->getMessage();
}
?>
I don't code PHP in this fashion and the website directions are vague at this point. It looks like an excellent way to save time but...I don't code this way. What am I missing?