• Resolved ggarmento

    (@ggarmento)


    Getting the code and errors below when I go to check out page

    \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 != "" )
    
    ...and more

    and php error

    Fatal error: Class 'scabn_paypal' not found in D:\MY WEBS\wp-sitename\wp-content\plugins\simple-cart-buy-now\classes\backend.php on line 201

    any clues? Seems to work okay on live site.

    http://wordpress.org/extend/plugins/simple-cart-buy-now/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bluey80

    (@bluey80)

    To clarify, it works fine on your live site, but on your dev site, you get the scabn_paypal not found error? Can you tell me what is different between the two sites? Web server, php version, WP version, multi-site WP vs single site, etc?

    Thread Starter ggarmento

    (@ggarmento)

    I waited to reply so I could test the issue on a new install. and the same issue duplicated itself. The SCABN plugin seems to be working on the live site, but creating the error below on the localhost site.

    WAMPServer:2.2, Apache Version:2.2.21, PHP Version:5.3.8, MySQL Version:5.5.16, WordPress:3.5.1 (single site), Responsive Theme:1.9.1 [not a child](first installed duplicated error and then updated to 1.9.3 and error still present). SCABN is only plugin.

    The error below seems to remove the WordPress Admin bar and widget sidebar on the Checkout page only.

    Checkout
    \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"; } $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; } } ?>
    ( ! ) Fatal error: Class 'scabn_paypal' not found in D:\MY WEBS\wp-communicate-by-design\wp-content\plugins\simple-cart-buy-now\classes\backend.php on line 201
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0004	366192	{main}( )	..\index.php:0
    2	0.0007	369944	require( 'D:\MY WEBS\wp-communicate-by-design\wp-blog-header.php' )	..\index.php:17
    3	0.4276	20676920	require_once( 'D:\MY WEBS\wp-communicate-by-design\wp-includes\template-loader.php' )	..\wp-blog-header.php:16
    4	0.4313	20711176	include( 'D:\MY WEBS\wp-communicate-by-design\wp-content\themes\responsive\sidebar-content-page.php' )	..\template-loader.php:47
    5	0.5412	20814152	the_content( )	..\sidebar-content-page.php:55
    6	0.5413	20814336	apply_filters( )	..\post-template.php:166
    7	0.5423	20815256	call_user_func_array ( )	..\plugin.php:173
    8	0.5424	20815272	do_shortcode( )	..\plugin.php:173
    9	0.5424	20815800	preg_replace_callback ( )	..\shortcodes.php:151
    10	0.5424	20816816	do_shortcode_tag( )	..\shortcodes.php:151
    11	0.5425	20816896	call_user_func ( )	..\shortcodes.php:236
    12	0.5425	20816920	scabn_Backend->shortcodes( )	..\shortcodes.php:236
    13	0.5425	20816920	scabn_Backend->checkout_page( )	..\backend.php:170
    Plugin Author bluey80

    (@bluey80)

    I’m still not clear on what is different between the (working) live site and your non-working local site.

    Thread Starter ggarmento

    (@ggarmento)

    Live working site: Apache Version:2.2.22, PHP Version 5.3.21, MySQL version: host interface reports 5.0 – but phpinfo reports Client API version 5.5.19, WordPress:3.5.1 (single site), Responsive Theme:1.9.1; and lots of plugins.

    Thread Starter ggarmento

    (@ggarmento)

    more info, live site appears to run APC-Alternative PHP Cache : apc Version 3.1.13

    Plugin Author bluey80

    (@bluey80)

    Ok, I’ve since had a few other people have this problem. The issue is classes/paypal.php start with

    <?

    instead of

    <?php

    Both work on many server configurations, but not all. I’ve fixed this in svn, but until I push a new version, just edit classes/paypal.php (and google.php) and have it begin with <?php

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘on localhost getting error.’ is closed to new replies.