Which URL has to be put in the AUTH callback URL, while making the app for Bigcommerce api?
When I click on my draft app its showing nothing.
I am using this url right now:
https://we-apps.com/disstem/public/bigcommerce/auth
https://we-apps.com/disstem/public/bigcommerce : its the path of my file.
Note: I am using laravel framework
My controller file
public function bigcommerce()
{
$user_id = Auth::id();
$header = array(
"Content-Type" => "application/x-www-form-urlencoded",
);
$client_id = 'xxxx';
$client_secret = 'xxxxx';
$redirect_uri = 'https://w- ap.com/dis/public/bigcommerce';
$postfields = array(
"client_id" => $client_id,
"client_secret" => $client_secret,
"redirect_uri" => $redirect_uri,
"grant_type" => "authorization_code",
"code" =>$_GET['code'],
"scope" => $_GET['scope'],
"context" => $_GET['context'],
);
$postfields = http_build_query($postfields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://login.bigcommerce.com/oauth2/token');
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt( $ch, CURLOPT_VERBOSE, 0 );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$response = curl_exec( $ch );
$result = json_decode($response);
print_r($response);
my route file
Route::get('/bigcommerce', 'IntegrationController@bigcommerce')->name('bigcommerce')->middleware('auth');
my laravel url to run this code is :
https://w- ap.com/dis/public/bigcommerce
bigcommerce My APP callback url i have given is : same as my laravel url
https://w- ap.com/dis/public/bigcommerce
but its giving the error of 'code' is undefined. . but when i click on install button of the app in bigcommerce its giving me back code,context and scope on and showing it on the bigcommerce but when i run my laravel code its giving me error.