Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter wesleyblack12

    (@wesleyblack12)

    this is what outputs…

    \n"; } else { $ppo="
    \n"; } //If no Paypal email, skip everything, don't make a button. if ( $paypal_email != "" ) { $ppoptions=array(); $ppoptions[]=array("business",$paypal_email); $ppoptions[]=array("cmd","_cart"); $ppoptions[]=array("currency_code",$currency); $ppoptions[]=array("lc","US"); $ppoptions[]=array("bn","PP-BuyNowBF"); $ppoptions[]=array("upload","1"); if ( $paypal_pdt_token != "" ) $ppoptions[]=array("return",$cart_url); if ( $paypal_cancel_url != "" ) $ppoptions[]=array("cancel_return",$paypal_cancel_url); $ppoptions[]=array("weight_unit","lbs"); $count=0; foreach($items as $item) { $count++; $ppoptions[]=array("quantity_". (string)$count, $item['qty']); if ( $item['options'] ) { $ppoptions[]=array("item_name_". (string)$count,$item['name']." (".apply_filters('scabn_display_item_options',$item['options']).")"); } else { $ppoptions[]=array("item_name_". (string)$count,$item['name']); } $ppoptions[]=array("amount_". (string)$count, $item['price']); $ppoptions[]=array("weight_". (string)$count, $item['weight']); } if ( ( $options['paypal_paypal_cert_file'] != "" ) & ( $options['paypal_key_file'] != "" ) & ( $options['paypal_my_cert_file'] != "" ) & ( $options['openssl_command'] != "" ) & ( $options['paypal_cert_id'] !="" ) ) { $ppoptions[]=array("cert_id",$paypal_cert_id); $ppencrypt=""; foreach($ppoptions as $value) { $ppencrypt .= $value[0] . "=" . $value[1] . "\n"; } $openssl_cmd = "($OPENSSL smime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE " . "-outform der -nodetach -binary <<_EOF_\n$ppencrypt\n_EOF_\n) | " . "$OPENSSL smime -encrypt -des3 -binary -outform pem $PAYPAL_CERT_FILE 2>&1"; exec($openssl_cmd, $output, $error); if ($error) { echo "ERROR: encryption failed: $error
    " . implode($output) ; } else { $ppo .= "\n"; $ppo .= "\n"; } } else { //echo "No Encryption"; foreach($ppoptions as $value) { $ppo .= "\n"; } } $ppo .= "
    "; return $ppo; } } function receipt($tx_token) { //This request came from paypal as their receipt page //We must send confirmation to them to get info: $scabn_options = get_option('scabn_options'); // read the post from PayPal system and add 'cmd'	 //generate cmd / tx variables to push to Paypal to authorize //data dump $auth_token = $scabn_options['paypal_pdt_token']; $req = 'cmd=_notify-synch'; $req .= "&tx=$tx_token&at=$auth_token"; // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; //Connect to Paypal via http or https depending on settings. if ($scabn_options['paypal_connection'] == 'https' ) { $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);	 } else { $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);	 } if (!$fp) { echo "Error Sending data to Paypal -- (order probably completed)
    ";	 echo "Errstr:" . $errstr."
    Errno: ". $errno. "
    "; return False; } else { fputs ($fp, $header . $req); // read the body data $res = ''; $headerdone = false; while (!feof($fp)) { $line = fgets ($fp, 1024); if (strcmp($line, "\r\n") == 0) { // read the header $headerdone = true; } else if ($headerdone) { // header has been read. now read the contents $res .= $line; } } fclose ($fp); $output=""; // parse the data $lines = explode("\n", $res); $keyarray = array(); if (strcmp ($lines[0], "SUCCESS") == 0) { for ($i=1; $i"; $output .= "_gaq.push(function() { var pageTracker = _gat._getTrackerByName('myTracker');"; $output .= "pageTracker._addTrans('" . $keyarray['txn_id'] ."','','" . $keyarray['payment_gross'] . "','" . $keyarray['tax'] . "','" . $keyarray['mc_shipping'] . "','" . $keyarray['address_city'] . "','" . $keyarray['address_state']. "','". $keyarray['address_country_code']. "');"; $count=$keyarray['num_cart_items']; for ( $i = 1; $i <= $count; $i++ ) { $item="item_name" . $i; $qty="quantity" . $i; $cost="mc_gross_" . $i; $totalprice=($keyarray[$cost]-$keyarray[$ship]); $price=$totalprice/$keyarray[$qty]; $output .= "pageTracker._addItem('" . $keyarray['txn_id'] . "','" . $keyarray[$item] . "','" . $keyarray[$item] . "','','" . $price . "','" . $keyarray[$qty] . "');"; } $output.="pageTracker._trackTrans();"; $output.= "});"; } //print_r($keyarray); $output .= apply_filters('scabn_display_paypal_receipt',$keyarray); //echo $output; } else if (strcmp ($lines[0], "FAIL") == 0) { $output .= "
    PAYPAL FAILED TO RECOGNIZE ORDER -- MAYBE ORDER TOO OLD OR DOES NOT EXIST.
    
    "; } else { $output .= "Unknown error from Paypal's response. (order probably completed)"; $output .= "
    Details:
    "; print_r($lines); } } //$output .= apply_filters('scabn_display_paypal_receipt','asdf'); return $output; } } ?> "; foreach($shipoptions as $soption) { $gc .= "\n\t"; $gc .= "\n\t".$soption['price']. ""; $gc .= "\n\t"; $gc .= "\n\t\t"; if (array_key_exists('regions', $soption )) { $gc .= "\n\t\t\t"; foreach($soption['regions'] as $region) { $gc .= "\n\t\t\t\t".$region.""; } $gc .= "\n\t\t\t"; } else { $gc .= "\n\t\t\t"; } $gc .= "\n\t\t"; $gc .= "\n\t\t";	 if (array_key_exists('notregions', $soption )) { $gc .= "\n\t\t\t"; foreach($soption['notregions'] as $region) {	 $gc .= "\n\t\t\t\t".$region.""; } $gc .= "\n\t\t\t"; } $gc .= "\n\t\t"; $gc .= "\n\t"; $gc .= "\n\t"; }	 $gc .= "\n\n"; return $gc;	 } function make_button($shipoptions,$items) { $options=get_option('scabn_options'); $gc_merchantid = $options['gc_merchantid']; $gc_merchantkey=$options['gc_merchantkey']; //If no merchant ID, don't bother or create new button. if ( $gc_merchantid != "" ) { $gc=" "; $gc .= "\n\t"; foreach($items as $item) { $gc .= "\n\t\t"; if ( $item['options'] ) { $gc .= "\n\t\t\t".$item['name']." (".apply_filters('scabn_display_item_options',$item['options']).")"; } else { $gc .= "\n\t\t\t".$item['name'].""; } $gc .= "\n\t\t\t".$item['name'].""; $gc .= "\n\t\t\t".$item['price'].""; $gc .= "\n\t\t\t".$item['qty'].""; $gc .= "\n\t\t"; } $gc .= "\n\t"; $gc .= apply_filters('scabn_google_shipping_XML',$shipoptions);	 //End Google Cart $gc .= "\n"; $b64=base64_encode($gc); $gout=""; if ( $options['analytics_id'] != '' ) { $gout.= "
    "; } else { $gout.= ""; } $gout .= ""; $gout .= ""; if ( $gc_merchantkey != "" ) { $gcsig = base64_encode(scabn_google::CalcHmacSha1($gc,"$gc_merchantkey"));	 $gout .= ""; } $gout .= "
    ";	 return $gout; } } function CalcHmacSha1($data,$key) { $blocksize = 64; $hashfunc = 'sha1'; if (strlen($key) > $blocksize) { $key = pack('H*', $hashfunc($key)); } $key = str_pad($key, $blocksize, chr(0x00)); $ipad = str_repeat(chr(0x36), $blocksize); $opad = str_repeat(chr(0x5c), $blocksize); $hmac = pack( 'H*', $hashfunc( ($key^$opad).pack( 'H*', $hashfunc( ($key^$ipad).$data ) ) ) );	 return $hmac; } } ?>

    Plugin Author bluey80

    (@bluey80)

    I think that is an apache/nginx/your web server configuration issue as it seems the web server is not processing php on that page. Either that or maybe an earlier error (look in your php / web server logs) and it just dumps the file it was processing to the web server when it gets the error?

    Is the code you posted really the beginning of the content on the checkout page? It seems like it should dump the hole page or something and nop open with

    \n"; } else { $pp=

    Thread Starter wesleyblack12

    (@wesleyblack12)

    Hi, thanks for the reply. I’ll get the full source…

    Now that I look at it… I think my web server prefers <?php rather than <? in order to process php.

    Could this be the issue?

    [Excessive code moderated. Please use a pastebin]

    Thread Starter wesleyblack12

    (@wesleyblack12)

    Indeed it was. I noticed in most of your class .php files, you opened with <?php, however 2 of them open with <? only.

    Adding the php fixed my issue.

    Thanks for your help!!

    Plugin Author bluey80

    (@bluey80)

    Ahh… thanks I’ll fix that.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘multi-site support?’ is closed to new replies.