-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class not found : ApplicationConfiguration #8
Comments
The recommended way for using the SDK is through composer. Do you use it that way? |
Please don't provide sensitive data (such as credit details, emails, codes, secrets, etc.) |
sir, these are the fake card details used for sandbox testing.. |
This is my index file: require_once 'sumup/SumUp.php';
try {
$sumup = new \SumUp\SumUp ([
'app_id' => 'Xxxxxxxxxxxxxxxxxxxxxx',
'app_secret' => 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy',
'grant_type' => 'client_credentials'
]);
$accessToken = $sumup->getAccessToken();
$value = $accessToken->getValue();
$checkoutService = $sumup->getCheckoutService();
$checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail);
$checkoutId = $checkoutResponse->getBody()->id;
// pass the $chekoutId to the front-end to be processed
} catch (\SumUp\Exceptions\SumUpAuthenticationException $e) {
echo 'Authentication error: ' . $e->getMessage();
} catch (\SumUp\Exceptions\SumUpResponseException $e) {
echo 'Response error: ' . $e->getMessage();
} catch(\SumUp\Exceptions\SumUpSDKException $e) {
echo 'SumUp SDK error: ' . $e->getMessage();
}
$headers = array(
sprintf('Authorization: Bearer %s', $accessToken),
'Content-Type' => 'application/json'
);
$data = '{
"payment_type": "card",
"card": {
"name": "'.$card_name.'",
"number": "'.$card_number.'",
"expiry_month": "'.$expiry_month.'",
"expiry_year": "'.$expiry_year.'",
"cvv": "'.$cvv.'"
}
}';
$url="https://api.sumup.com/v0.1/checkouts/".$checkoutId;
$packet_json = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $packet_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($ch);
$output = json_decode($output, true);
if (!$output)
{
return false;
}
|
The recommended way of using the SDK is by composer.
|
Thank you sir! that helped!! :) |
How did you fix this issue? I have the same problem. How can I call the classes? |
I've created an index file from where i'am using SumUp class of SumUp.php file from sumup folder, And i'am getting the following error from SumUp.php file:
Fatal error: Uncaught Error: Class 'SumUp\Application\ApplicationConfiguration' not found in /mnt/stor1-wc1-dfw1/388632/www.xyz.com/web/content/wilson/sumup/sumup/SumUp.php:54 Stack trace: #0 /mnt/stor1-wc1-dfw1/388632/www.xyz.com/web/content/wilson/sumup/index.php(23): SumUp\SumUp->__construct(Array) #1 {main} thrown in /mnt/stor1-wc1-dfw1/388632/www.xyz.com/web/content/wilson/sumup/sumup/SumUp.php on line 54
The text was updated successfully, but these errors were encountered: