Advertisement
Guest User

curl lvlup api

a guest
Apr 15th, 2020
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. $lvlupPost = json_encode([
  2.                     'amount' => $request->tokens,
  3.                     'redirectUrl' => 'https://sklep.xxxxx.tech/platnosc/'.$numer,
  4.                     'webhookUrl' => 'https://sklep.xxxxxx.tech/platnosc/'.$numer.'/notify'
  5.                 ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  6.                 $ch = curl_init();
  7.                 curl_setopt($ch, CURLOPT_URL, 'https://api.lvlup.pro/v4/wallet/up');
  8.                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9.                 curl_setopt($ch, CURLOPT_POST, 1);
  10.                 curl_setopt($ch, CURLOPT_POSTFIELDS, $lvlupPost);
  11.                 $headers = array();
  12.                 $headers[] = 'Accept: application/json';
  13.                 $headers[] = 'Content-Type: application/json';
  14.                 $headers[] = 'Authorization: '.env('LVLUP_SECRET_API');
  15.                 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  16.  
  17.                 $result = curl_exec($ch);
  18.                 curl_close($ch);
  19.  
  20.                 dd($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement