$options = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => false, CURLOPT_ENCODING => "", CURLOPT_USERAGENT => "sitemile", CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 120, CURLOPT_TIMEOUT => 120, CURLOPT_MAXREDIRS => 10, CURLOPT_POSTFIELDS => $posts, CURLOPT_HTTPHEADER => array("X-PAYPAL-SECURITY-USERID: " . $api_user, "X-PAYPAL-SECURITY-PASSWORD: "******"X-PAYPAL-SECURITY-SIGNATURE: " . $signature, "X-PAYPAL-APPLICATION-ID: " . $apiid, "X-PAYPAL-DEVICE-IPADDRESS: " . $_SERVER['REMOTE_ADDR'], "X-PAYPAL-REQUEST-DATA-FORMAT: NV", "X-PAYPAL-RESPONSE-DATA-FORMAT: XML"));
    $ch = curl_init($url);
    curl_setopt_array($ch, $options);
    $content = curl_exec($ch);
    $err = curl_errno($ch);
    $errmsg = curl_error($ch);
    $header = curl_getinfo($ch);
    curl_close($ch);
    $header['errno'] = $err;
    $header['errmsg'] = $errmsg;
    $header['content'] = $content;
    return $header;
}
$cont = get_web_page($link, $params, $api_user, $api_pass, $signature, $apiid);
$co = $cont['content'];
$arr = my_xml2array($co);
//echo '<pre>';
//print_r( $arr );
//echo '<pre>';
//exit;
$ap = $arr[0][1]['value'];
if (empty($ap)) {
    echo "ERROR<br/>";
    echo '<pre>';
    print_r($arr);
    echo '<pre>';
    exit;
}
update_post_meta($pid, 'adaptive_key', $ap);
if ($enasdbx == "yes") {
    header("Location: https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=" . $ap);
Ejemplo n.º 2
0
 $xml = file_get_contents($importerfil_full);
 /* Cleanup */
 $xml = str_replace('Trans.- dato', 'Transdato', $xml);
 $xml = str_replace('Ant. solgt', 'Antsolgt', $xml);
 $xml = str_replace('Innkjøps- beløp', 'Innkjøpsbelop', $xml);
 $xml = str_replace('Oms. etter rab.', 'Omsetterrab', $xml);
 $xml = str_replace('Oms. u/ mva', 'Omsumva', $xml);
 $xml = str_replace('mva beløp', 'mvabelop', $xml);
 $xml = str_replace('Kamp. salg', 'Kampsalg', $xml);
 $xml = str_replace('Kreditt salg', 'Kredittsalg', $xml);
 $xml = str_replace('Brutto fortj. kr.', 'Bruttofortjkr', $xml);
 $xml = str_replace('Bruttooms. fortj. %', 'Bruttoomsfortjprosent', $xml);
 $xml = str_replace('Bud. bto. fortj. %', 'Budbtofortjprosent', $xml);
 $xml = str_replace('Uke nr.', 'Ukenr', $xml);
 $xml = str_replace('Lev. nr.', 'Levnr', $xml);
 $arr = my_xml2array($xml);
 //print_r(get_value_by_path($arr, 'Report'));
 /*print_r($arr); exit(); /**/
 // Test
 if (isset($_GET['xml'])) {
     header("content-type: text/xml");
     echo $xml;
     exit;
 }
 /*
 	$varer_som_tasmed = array(
 		'3002',
 		'200000002961',
 		'200000000486',
 		'200000002664',
 		'200000002756',