Created
October 5, 2012 16:35
-
-
Save craigchristenson/3840873 to your computer and use it in GitHub Desktop.
2Checkout API PHP
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 | |
| $ch = curl_init("https://www.2checkout.com/api/sales/detail_sale?sale_id=1234567890"); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json")); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_USERAGENT, "2Checkout PHP/0.1.0"); | |
| curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
| curl_setopt($ch, CURLOPT_USERPWD, "apiusername:apipassowrd"); | |
| $json_resp = curl_exec($ch); | |
| curl_close($ch); | |
| //decode to an associative array | |
| $array_resp = json_decode($json_resp, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment