Skip to content
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

Unable to open resource #5

Open
payalddesai opened this issue Aug 27, 2019 · 10 comments
Open

Unable to open resource #5

payalddesai opened this issue Aug 27, 2019 · 10 comments

Comments

@payalddesai
Copy link

Hi Afzal,

I am trying to integrate a knet payment gateway with your package "izal/knet-payment-php". But i am getting an error "ZipArchive::extractTo(): Invalid or uninitialized Zip object".
i searched a lot for this error but not able to resolve this. and file path is correct.

Please help me with this.

@payalddesai payalddesai changed the title Unable to open resource in php Unable to open resource Aug 27, 2019
@iZaL
Copy link
Owner

iZaL commented Aug 27, 2019

please share some code

@iZaL
Copy link
Owner

iZaL commented Aug 27, 2019

please check whether the resourcePath folder's permission. the folder must be writable ..

@payalddesai
Copy link
Author

payalddesai commented Aug 28, 2019

try {
         $responseURL = 'http://localhost/payment/response';
     $successURL = 'http://localhost/payment/success';
     $errorURL = 'http://localhost/payment/error';
     $knetAlias = 'motor';
     $resourcePath = public_path('/'); //Response file in public folder of laravel
     $amount = 150;
     $trackID = str_random(6);

	$knetGateway = new IZaL\Knet\KnetBilling([
		'alias' => $knetAlias,
		'resourcePath' => $resourcePath,
	]);

	$knetGateway->setResponseURL($successURL);
	$knetGateway->setErrorURL($errorURL);
	$knetGateway->setAmt($amount);
	$knetGateway->setTrackId($trackID);

	$knetGateway->requestPayment();
	$paymentURL = $knetGateway->getPaymentURL();
	// helper function to redirect
	return $this->successResponse($paymentURL);

} catch (\Exception $e) {
	// to debug error message
	dd(var_dump($e->getMessage()));

	return redirect('payment/error');
}

@payalddesai
Copy link
Author

payalddesai commented Aug 28, 2019

please check whether the resourcePath folder's permission. the folder must be writable ..

Folder having full permission.

@iZaL
Copy link
Owner

iZaL commented Aug 29, 2019

ok. could you please share me your test resource.cgn file and alias ?

@iZaL iZaL mentioned this issue Aug 29, 2019
@payalddesai
Copy link
Author

ok. could you please share me your test resource.cgn file and alias ?

Sent you mail with resource file please check.

@Abdelsadek
Copy link

I have the same problem

1 similar comment
@sanu-basak
Copy link

I have the same problem

@alshugairi
Copy link

I have the same problem

@elsayedabdelnaby
Copy link

i have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants