src/PaypalUtil.php
/**
   * This function makes a call to the invoice  paupal endpoint
   */
This function makes a call to the invoice  paupal endpoint
This function makes a call to the invoice paupal endpoint
public function generate_invoice(string $url, string $token)
  {
    $curl = curl_init();
    $api_url = $url;
    curl_setopt_array($curl, array(
      CURLOPT_URL => $api_url,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_POSTFIELDS => "grant_type=client_credentials",
      CURLOPT_HTTPHEADER => array(
        "authorization: Bearer " . $token,
        "cache-control: no-cache",
        "content-type: application/x-www-form-urlencoded",
      ),
    ));
    $response = curl_exec($curl);
    $err = curl_error($curl);
    curl_close($curl);
    return $response;
  }
public function generate_invoice ( string $ url , string $ token ) { $ curl = curl_init ( ) ; $ api_url = $ url ; curl_setopt_array ( $ curl , array ( CURLOPT_URL => $ api_url , CURLOPT_RETURNTRANSFER => true , CURLOPT_ENCODING => " " , CURLOPT_MAXREDIRS => 10 , CURLOPT_TIMEOUT => 30 , CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 , CURLOPT_CUSTOMREQUEST => " POST " , CURLOPT_POSTFIELDS => " grant_type=client_credentials " , CURLOPT_HTTPHEADER => array ( " authorization: Bearer  " . $ token , " cache-control: no-cache " , " content-type: application/x-www-form-urlencoded " , ) , ) ) ; $ response = curl_exec ( $ curl ) ; $ err = curl_error ( $ curl ) ; curl_close ( $ curl ) ; return $ response ; }
This function makes a call to the invoice  paupal endpoint
This function makes a call to the invoice paupal endpoint