PayPal login integration refresh_token

28 views Asked by At

I am trying to integrate login with paypal via this arcticle.  At 3th point I am not reciving refresh_token for next steps .  I have attached screenshots from example and my response . 

UPDATE: There is my code of transfering code to tokens :

    $code           = $request->code;   
    $tokenEndpoint  = 'https://api-m.sandbox.paypal.com/v1/oauth2/token';
    $credentials    = base64_encode("$this->clientId:$this->clientSecret");
    $base_token     = $credentials;

    $curl = curl_init();

    $data = array(
        CURLOPT_URL => $tokenEndpoint,
        CURLOPT_RETURNTRANSFER  => true,
        CURLOPT_CUSTOMREQUEST   => "POST",
        CURLOPT_SSL_VERIFYPEER  => false,
        CURLOPT_POSTFIELDS      => http_build_query(array(
            'grant_type'=>'client_credentials',
            'code'      =>$code
        )),
        CURLOPT_HTTPHEADER      => array(
            "Content-Type: application/x-www-form-urlencoded",
            "Authorization: Basic " .$credentials
        ),
        CURLOPT_USERPWD         => $base_token
    );

    curl_setopt_array($curl, $data);

    $res                = curl_exec($curl);

Response of that :


{
  "scope": "https://uri.paypal.com/services/payments/futurepayments https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/paypalhere openid https://uri.paypal.com/services/payments/payment/authcapture https://uri.paypal.com/services/disputes/read-seller https://uri.paypal.com/services/payments/refund https://uri.paypal.com/services/identity/activities https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/.* https://uri.paypal.com/services/reporting/search/read https://uri.paypal.com/payments/payouts https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks https://api.paypal.com/v1/payments/refund https://api.paypal.com/v1/payments/sale/.*/refund",
  "access_token": "A21AALEE-Rfj5AIF3EmefvLt1bGI55d3M-BVZhdf2hQIpnaOm2FxAZouY1UgBVxHpG6zIEAC5VAyh2ElLsbBQYfP1d4_m8lMA",
  "token_type": "Bearer",
  "app_id": "APP-80W284485P519543T",
  "expires_in": 32400,
  "nonce": "2024-03-26T07:18:40ZgJJoBuh8Q1ThoUZL2_UsSqy7APjUfTdhwzVo4i2oLQc"
}

Images bellow are just screens of jsons .

Example from their documentation

My response from that request

I have tried each route from their login documentations , tried to connect with them via support but useless. Does someone had problem like this and how to solve it?

0

There are 0 answers