I have a request.
But the answer is:
400 - Oauth error invalid_request / Oauth error invalid_request: The authorization code was not found or was already used
I didnt found, how can I generate $ _GET ['code'] I think when I create $_GET['code'], it will run straight. I think problem is $_GET['code']
My code is this:
$ client_id = 'xx'; $ client_secret = 'xxx'; $url = "https://" . $shop . "/admin/oauth/access_token"; $ post_data = array ('client_id' => $ client_id, 'client_secret' => $ client_secret, 'code' => $ _GET ['code']); $ post_json = json_encode ($ post_data); $ curl = curl_init (); curl_setopt_array ($ curl, array ( CURLOPT_URL => $ url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $ post_json, CURLOPT_HTTPHEADER => array ( "cache-control: no-cache", "content-type: application / json" ) ));
As I understand it's:
1. Call "oauth/authorize?client_id=API_KEY&redirect_uri=REDIRECT_URL&scope=SCOPES
2. The redirect url should then get the $_GET['code']
3. Call "oauth/access_token" as in your code.
Have you created a collection on your online store and experienced an issue with adding yo...By Ollie Aug 24, 2022
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...By Ollie Jul 28, 2022