Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // basic information needed for requests
- $soapTokenUri = 'http://encantemais.souhibrido.com.br/soap/default?wsdl&services=integrationAdminTokenServiceV1';
- $soapResourceUri = 'http://encantemais.souhibrido.com.br/soap/default?wsdl&services=salesOrderRepositoryV1';
- $username = 'hibrido';
- $password = 'h1br1d0';
- $options = [
- 'soap_version' => SOAP_1_2,
- 'trace' => 1,
- 'connection_timeout' => 120,
- ];
- // create client and get token response using username and password
- $cli = new SoapClient($soapTokenUri, $options);
- $response = $cli->integrationAdminTokenServiceV1CreateAdminAccessToken([
- 'username' => $username,
- 'password' => $password
- ]);
- $token = $response->result;
- // create bearer token Authorization header
- $options['stream_context'] = stream_context_create([
- 'http' => [
- 'header' => sprintf('Authorization: Bearer %s', $token)
- ]
- ]);
- // create client and get cms block response
- $cli = new SoapClient($soapResourceUri, $options);
- $response = $cli->salesOrderRepositoryV1Get(array('id' => '00000040' ));
- $block = $response->result;
- var_dump($block->payment->additionalInformation);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement