I just made an api
with Laravel, and front with ReactJS, but I'm wondering how can I use payment getway in this project, I want to use this getway
What I tried:
$zarinpal = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX');
$zarinpal->isZarinGate(); // active zarinGate mode
$results = $zarinpal->request(
"example.com/testVerify.php",
1000,
'testing',
'me@example.com',
'09000000000',
);
if (isset($results['Authority'])) {
file_put_contents('Authority', $results['Authority']);
$zarinpal->redirect();
}
It successfully get $results['Authority'])
but it won't redirect to getway, clearly because I am using laravel as api, right? so how can I do this while I using api?
It give me this error:
Access to XMLHttpRequest at 'http://localhost:8000/api/deposit/agent' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
POST http://localhost:8000/api/deposit/agent net::ERR_FAILED
But I don't have CORS issue on api request, it just give me this error on this action