Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Parse error in WHMCS Gateway Module
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Parse error in WHMCS Gateway Module

zafouharzafouhar Veteran
edited December 2012 in General

I have downloaded this BitPay WHMCS Gateway Module, i then installed it on my WHMCS however now when i browse to /admin/configgateways.php i get the following error:

Parse error: syntax error, unexpected T_STRING in /home/public_html/modules/gateways/bitpay.php on line 1

I have contacted the developers of this module however even though they responded from yesterday that they would look into this they have not yet checked this so i thought to also ask here.

I have also searched this in Google and i have tried various suggestions however nothing is working.

«1

Comments

  • @zafouhar said: Parse error: syntax error, unexpected T_STRING in /home/public_html/modules/gateways/bitpay.php on line 1

    >

    Check what is on line 1 ?

  • What version of PHP are you using?

  • Well line 1 doesn't have a lot, it only has <?php

  • I am not having issues with it. But are you using php 5.4?

  • Here is the full bitpay.php file coding:

    <?php function bitpay_config() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"Bit-pay"), 'apiKey' => array('FriendlyName' => 'API Key from your bitpay.com account.', 'Type' => 'text'), 'transactionSpeed' => array('FriendlyName' => 'Transaction Speed', 'Type' => 'dropdown', 'Options' => 'low,medium,high'), ); return $configarray; } function bitpay_link($params) { # Invoice Variables $invoiceid = $params['invoiceid']; # Client Variables $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phonenumber']; # System Variables $systemurl = $params['systemurl']; $post = array( 'invoiceId' => $invoiceid, 'systemURL' => $systemurl, 'buyerName' => "$firstname $lastname", 'buyerAddress1' => $address1, 'buyerAddress2' => $address2, 'buyerCity' => $city, 'buyerState' => $state, 'buyerZip' => $postcode, 'buyerEmail' => $email, 'buyerPhone' => $phone, ); $form = ''; foreach($post as $key => $value) $form.= ''; $form.=''; $form.=''; return $form; } ?>

  • What does phpinfo(); give you?

  • I am using PHP v5.3.19 @mnpeep @24khost

  • Mine is working and we are running php 5.3 so not sure what issue your having.

  • That's definately very weird @24khost

    Are you using the latest version of WHMCS?

  • Also are you using v2 of the BitPay Module? @24khost

  • yes latest version. if you have want to send me and ftp login and a temp admin account I can take a look for you.

  • I have sent you a pm @24khost

  • PatrickPatrick Member
    edited December 2012

    I also attempted to use WHMCS BitPay module (from there site > github) on PHP v5.3.19 & 5.4.9 and got the same error and payment gateway page was blank, I asked the developer and he wasn't able to reproduce this. I do have a dev license so I'll see if it works on a fresh install.

  • @24khost has just fixed this for me by just uploading the BitPay files he has so maybe the files on the BitPay website have some issue. @Patrick

  • PatrickPatrick Member
    edited December 2012

    @zafouhar said: @24khost has just fixed this for me by just uploading the BitPay files he has so maybe the files on the BitPay website have some issue. @Patrick

    Ah ok, any chance @24khost can send me the files

    Thanks

  • And since i was in contact with Stephen from BitPay i also just sent them an email so they can check in more depth on this.

  • not sure what is wrong.

  • Uhm there is an extra comma at the end of every array on the last array element.

    wtf is this..

    $form = '';

    foreach($post as $key => $value)
        $form.= '';
    
    $form.='';
    $form.='';
    
    return $form;
    
  • @zafouhar said: $form = ''; foreach($post as $key => $value) $form.= ''; $form.=''; $form.='';

    Is it just me or something is missing from that code?

  • @joepie91 Quickly, destroy this code and strip it for us all to understand.

  • @vedran said: @zafouhar said: $form = ''; foreach($post as $key => $value) $form.= ''; $form.=''; $form.='';

    Is it just me or something is missing from that code?

    it's not just you.... that's why i said 'wtf is this'

  • this is thier code. I am looking for a different one as we speak as I never actually looked at the code.

  • @Corey said: it's not just you.... that's why i said 'wtf is this'

    Actually, it looks like Vanilla stripped html from there. By the looks of it, the issue might be with Mac line endings.

  • CoreyCorey Member
    edited December 2012

    @vedran said: Actually, it looks like Vanilla stripped html from there. By the looks of it, the issue might be with Mac line endings.

    Ohhhhhh....

    Ok well that sounds plausible.. I would suggest opening the file in an editor that will show you all characters and remove any funny whitespace characters.

    There is still an extra comma on the last array element of all the arrays though :)... I thought that threw errors.

  • 24khost24khost Member
    edited December 2012

    edited.

  • So the file is actually all one line? that is why there is a syntax error on line one... can someone please remove the comma on the last element of the arrays and see if it works for them.

  • ahhh there is the problem you guy's can't see all the code.

  • vanilla forum doesn't like it.

Sign In or Register to comment.