Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter arepsv

    (@arepsv)

    #SOLVED

    {“success”:true,”data”:{“id”:”9″,”orderId”:null,”productId”:”1777″,”licenseKey”:”ECHOES-SILENCE-PATIENCE-AND-GRACE”,”expiresAt”:null,”validFor”:”365″,”source”:”3″,”status”:”3″,”timesActivated”:null,”timesActivatedMax”:”1″,”createdAt”:”2020-03-26 13:05:18″,”createdBy”:”1″,”updatedAt”:null,”updatedBy”:null}}

    I want to ask,
    response [‘status’] = 1,2,3 etc, what does that represent?
    2 = license active ..?
    please explain..

    Thread Starter arepsv

    (@arepsv)

    I want my clients to be able to make their own license key on the index.php

    I tried to make a new license key.
    but failed, the browser only displays http error 500
    if I try to get the license key, then the $ response is successful

    index.php (sub.domain.com)
    LMFWC ( instaled in my wordpress site domain.com )

    <?php
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://domain.com/wp-json/lmfwc/v2/licenses?consumer_key=ck_e85b2e88e5f5d597e6203687663b5dc331b24bdf&consumer_secret=cs_e85df435670679aa3d6a5aa1d8db7fc35a186e91",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 0,
      CURLOPT_FOLLOWLOCATION => false,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_POSTFIELDS =>"{
    	"product_id": "1777",
    	"license_key": "ECHOES-SILENCE-PATIENCE-AND-GRACE",
    	"valid_for": "365",
    	"status": "active",
    	"times_activated_max": 1
    }",
      CURLOPT_HTTPHEADER => array(
        "Content-Type: application/json"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    ?>
    Thread Starter arepsv

    (@arepsv)

    Thank you @drazenbebic

Viewing 3 replies - 1 through 3 (of 3 total)