Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kudratullah/b06510a32d89c80e1d5041d97924d677 to your computer and use it in GitHub Desktop.
Save Kudratullah/b06510a32d89c80e1d5041d97924d677 to your computer and use it in GitHub Desktop.
Envato purchase verification using `wp_remote_get`
<?php
$token = '***********';
$code = '*************';
$response = wp_remote_get(
'https://api.envato.com/v3/market/buyer/purchase?code=' . $code,
[
'headers' => [
'Authorization' => 'Bearer ' . $token,
'Content-type' => 'application/json; charset=utf-8',
],
]
);
$body = wp_remote_retrieve_body( $response );
// echo '<pre>';
// print_r( $body );
// echo '</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment