Guest User

Untitled

a guest
Jun 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. curl -v https://api.sandbox.paypal.com/v1/oauth2/token
  2. -H "Accept: application/json"
  3. -H "Accept-Language: en_US"
  4. -u "client_id:secret"
  5. -d "grant_type=client_credentials"
  6.  
  7. $headers = array(
  8. 'Accept' => 'application/json',
  9. 'Accept-Language'=> 'en_US',
  10. 'Authorization' => $client_id . ':' . $secret
  11. );
  12. $remote_post = wp_safe_remote_post( 'https://api.sandbox.paypal.com/v1/oauth2/token', array(
  13. 'httpversion' => '1.1',
  14. 'sslverify' => true,
  15. 'timeout' => 60,
  16. 'headers' => $headers,
  17. 'body' => json_encode( array( 'grant_type' => 'client_credentials' ) ),
  18. ) );
  19. $body = wp_remote_retrieve_body( $remote_post );
  20.  
  21. echo '<pre>' . print_r( $body, true ) . '</pre>';
Add Comment
Please, Sign In to add comment