Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. // basic information needed for requests
  3. $soapTokenUri = 'http://encantemais.souhibrido.com.br/soap/default?wsdl&services=integrationAdminTokenServiceV1';
  4. $soapResourceUri = 'http://encantemais.souhibrido.com.br/soap/default?wsdl&services=salesOrderRepositoryV1';
  5. $username = 'hibrido';
  6. $password = 'h1br1d0';
  7. $options = [
  8.     'soap_version' => SOAP_1_2,
  9.     'trace' => 1,
  10.     'connection_timeout' => 120,
  11. ];
  12. // create client and get token response using username and password
  13. $cli = new SoapClient($soapTokenUri, $options);
  14. $response = $cli->integrationAdminTokenServiceV1CreateAdminAccessToken([
  15.     'username' => $username,
  16.     'password' => $password
  17. ]);
  18. $token = $response->result;
  19. // create bearer token Authorization header
  20. $options['stream_context'] = stream_context_create([
  21.     'http' => [
  22.         'header' => sprintf('Authorization: Bearer %s', $token)
  23.     ]
  24. ]);
  25. // create client and get cms block response
  26. $cli = new SoapClient($soapResourceUri, $options);
  27. $response = $cli->salesOrderRepositoryV1Get(array('id' => '00000040' ));
  28.  
  29. $block = $response->result;
  30. var_dump($block->payment->additionalInformation);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement