Forked from obiPlabon/envato-purchase-verification.php
Created
December 14, 2020 20:52
-
-
Save Kudratullah/b06510a32d89c80e1d5041d97924d677 to your computer and use it in GitHub Desktop.
Envato purchase verification using `wp_remote_get`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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