Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -v https://api.sandbox.paypal.com/v1/oauth2/token
- -H "Accept: application/json"
- -H "Accept-Language: en_US"
- -u "client_id:secret"
- -d "grant_type=client_credentials"
- $headers = array(
- 'Accept' => 'application/json',
- 'Accept-Language'=> 'en_US',
- 'Authorization' => $client_id . ':' . $secret
- );
- $remote_post = wp_safe_remote_post( 'https://api.sandbox.paypal.com/v1/oauth2/token', array(
- 'httpversion' => '1.1',
- 'sslverify' => true,
- 'timeout' => 60,
- 'headers' => $headers,
- 'body' => json_encode( array( 'grant_type' => 'client_credentials' ) ),
- ) );
- $body = wp_remote_retrieve_body( $remote_post );
- echo '<pre>' . print_r( $body, true ) . '</pre>';
Add Comment
Please, Sign In to add comment