Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1.         $client = new Client(); //GuzzleHttp\Client
  2.         $api_url = config('lunaz.api_url');
  3.         $app_code = config('lunaz.app_code');
  4.         $merchant_code = config('lunaz.merchant_code');
  5.         $app_key = config('lunaz.app_key');
  6.         $signature = hash('sha256', $merchant_code.hash('sha256', $app_key));
  7.         $params = [
  8.             'offline' => false,
  9.             'code' => $app_code,
  10.             'signature' => $signature
  11.         ];
  12.  
  13.         $result = $client->post($api_url.'trans/channel', [
  14.             'headers' => [
  15.                 'Content-Type' => 'x-www-form-urlencoded',
  16.                 'Accept'=> 'application/json'
  17.             ],
  18.             'form_params' => $params
  19.         ]);
  20.  
  21.         $response = json_decode($result->getBody());
  22.  
  23.         return response()->json($response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement