Created
April 25, 2014 13:38
-
-
Save r043v/11289875 to your computer and use it in GitHub Desktop.
ekomi api
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 | |
// ¢2014 noferi mickaël, under creative common by-nc-sa 3.0 | |
define('ekomiNumber','*****'); | |
define('ekomiInterface','*****'); | |
define('ekomiInterfacePass','***********************'); | |
define('ekomiUrl','http://api.ekomi.de/v2/'); | |
function buildUrl($url,$get){ return $url.'?'.http_build_query($get); } | |
function ekomiBuildUrl($method,$get){ return ekomiUrl.$method.'?'.http_build_query($get); } | |
$ekomiGetParams = array( | |
'auth' => ekomiInterface.'|'.ekomiInterfacePass, | |
'version' => 'cust-1.0.0' | |
); | |
$getParams = $ekomiGetParams + array( 'order_id' => 'zz420' ); | |
$url = ekomiBuildUrl('putOrder',$getParams); | |
$nfo = unserialize( file_get_contents($url) ); | |
if($nfo === false) die('error'); | |
print '<pre>'; | |
print_r( $getParams ); | |
print_r( $nfo ); | |
print '</pre>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment