News:

Support the VirtueMart project and become a member

Main Menu

Hacking authorize.net for linkpoint payments.

Started by mintee, March 21, 2005, 18:58:04 PM

Previous topic - Next topic

mintee

Hey everyone,

I'm stuck trying to write a payment module for Linkpoint.net (aka yourpay.com).  I've downloaded their API and written a simple form that uses the Public Key and cURL to push an XML string for authorizing.  Everything worked, and I'm happy with them.

Now for my next trick, I need to make it work for our favorite CMS, MAMBO+phpShop.  I've looked at the ps_authorize.php and thought it looked pretty similar to what I need, so I copied it, and created a new payment option in phpShop.  I changed my $host and $port appropriately, and I set $path = ''; because I don't need a path.

My main problem now is, I would like to see the cURL string in action, but I can't seem to echo it to the page.  phpShop is rather complex in the way it works, and I can't seem to figure out exactully what it's doing.  I don't even know if it's actaully sending the information to the proper host or not.  If I enter a fake card number, it successfully comes back saying that it's not valid, but without understanding more, I don't want to put in a real card number for testing.  (Godforbid me send you, Soeren, some money.. j/k ;) 

I know this might be a little vague, but honestly, I'm a little lost here and would like the guidance of a superior.

Thanks in advance.

BTW, what's the main differnce in capture_payment() and process_payment()

mintee

Also, what's the difference in
"Credit Card"
     and
"Use Payment Processor"

?

mintee

Ok, I've gotten phpShop to send the info to linkpoint successfully. 

Now my question is...  What exactully are the response codes that authorize.net uses at the very end of the process_order() function? I'm assuming these get place back in the mambo-phpShop database.  So I would like to know exactully what $response[3] would look like.

        // Approved - Success!
        if ($response[0] == '1') {
           $d["order_payment_log"] = $PHPSHOP_LANG->_PHPSHOP_PAYMENT_TRANSACTION_SUCCESS.": ";
           $d["order_payment_log"] .= $response[3];
           // Catch Transaction ID
           $d["order_payment_trans_id"] = $response[6];

           $q = "UPDATE #__pshop_order_payment SET ";
           $q .="order_payment_log='".$d["order_payment_log"]."',";
           $q .="order_payment_trans_id='".$d["order_payment_trans_id"]."' ";
           $q .="WHERE order_id='".$db->f("order_id")."' ";
           $db->query( $q );

           return True;
        }
        // Payment Declined
        elseif ($response[0] == '2') {
           $d["error"] = $response[3];
           $d["order_payment_log"] = $response[3];
           // Catch Transaction ID
           $d["order_payment_trans_id"] = $response[6];
           return False;
        }
        // Transaction Error
        elseif ($response[0] == '3') {
           $d["error"] = $response[3];
           $d["order_payment_log"] = $response[3];
           // Catch Transaction ID
           $d["order_payment_trans_id"] = $response[6];
           return False;
        }


*I'm just talking to myself at this point.

Soeren

Hello,

you're talking, but we are listening.
The Response Codes can be read from the documentation of the authorize.net gateway. If you haven't got one yet, just feel free to contact me via email.

ciao, Soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

mintee


Ah, good.  I thought everyone just ingored my posts.  Anyway, I'll have my progress posted soon, so everyone can help secure the module in case I've missed anything.

But it is working ;)

Soeren: I'll be sending you the code first if you don't mind.  Just take a glance at it.


mintee

Yay, the site is back up...  it seems to have been down the most of the day, anyway, as promised, here's the ps_linkpoint.php code with installation instructions in the header.  You can PM me or post questions to this forum.  njoi.



<?php
/*
* @version $Id: ps_linkpoint.php,v 1.0 2005/03/30
* @package Mambo_4.5.x
* @subpackage mambo-phpShop
* @copyright (C) 2005 James McMillan
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*
* The ps_linkpoint class, containing the payment processing code
* for transactions with linkpoint.net or yourpay.com
* contains code for Recurring billing an/or PreAuth Options

* Installation:  You must have the linkpoint/yourpay.com API  file (lphp.php) in the 
* current working directory, or your php includes directory.
* you also should have your public key file provided by linkpoint/yourpay.com secured 
* in a directory outside of the webroot, but readable by the webserver daemon owner (ie; nobody)

* In the administrator console of mambo-phpShop -> Payment Method List -> Creditcard LP -> Configuration
* you can insert your store number, and public key location.

* Any questions, email jimmy@freshstation.org
*/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class 
ps_linkpoint {

    var 
$payment_code "LP";
    var 
$classname "ps_linkpoint";

    
/**
* Most of this top configuration code was stripped and hacked from the authorize.net payment class
    * Show all configuration parameters for this payment method
    * @returns boolean False when the Payment method has no configration
    */
    
function show_configuration() {

      global 
$PHPSHOP_LANG$sess;
      
$payment_method_id mosGetParam$_REQUEST'payment_method_id'null );
      
/** Read current Configuration ***/
      
require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");
    
?>

      <table>
        <tr>
            <td><strong><?php echo "Linkpoint Store ID" ?></strong></td>
            <td>
                <input type="text" name="LP_LOGIN" class="inputbox" value="<? echo LP_LOGIN ?>" />
            </td>
            <td><?php echo "This is your Link Point Store Name" ?>
            </td>
        </tr>
        <tr>
            <td><strong><?php echo "Location Of Public Keyfile" ?></strong></td>
            <td>
                <input type="text" name="LP_KEYFILE" class="inputbox" value="<? echo LP_KEYFILE ?>" />
            </td>
            <td><?php echo "This is the full path of your LinkPoint Keyfile.  Example: /etc/linkpoint/mykey.pem" ?>
            </td>
        </tr>
        <tr>
            <td><strong><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_CVV2 ?></strong></td>
            <td>
                <select name="LP_CHECK_CARD_CODE" class="inputbox">
                <option <?php if (LP_CHECK_CARD_CODE == 'YES') echo "selected=\"selected\""?> value="YES">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_YES ?></option>
                <option <?php if (LP_CHECK_CARD_CODE == 'NO') echo "selected=\"selected\""?> value="NO">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_NO ?></option>
                </select>
            </td>
            <td><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_CVV2_TOOLTIP ?></td>
        </tr>
        <tr>
            <td><strong><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_AN_RECURRING ?></strong></td>
            <td>
                <select name="LP_RECURRING" class="inputbox">
                <option <?php if (LP_RECURRING == 'YES') echo "selected=\"selected\""?> value="YES">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_YES ?></option>
                <option <?php if (LP_RECURRING == 'NO') echo "selected=\"selected\""?> value="NO">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_NO ?></option>
                </select>
            </td>
            <td><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_AN_RECURRING_TOOLTIP ?>
            </td>
        </tr>
        <tr>
            <td><strong><?php echo "Pre Auth for Recurring Billing?" ?></strong></td>
            <td>
                <select name="LP_PREAUTH" class="inputbox">
                <option <?php if (LP_PREAUTH == 'YES') echo "selected=\"selected\""?> value="YES">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_YES ?></option>
                <option <?php if (LP_PREAUTH == 'NO') echo "selected=\"selected\""?> value="NO">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_NO ?></option>
                </select>
            </td>
            <td><?php echo "Select yes, is billing is not processed immediately.  (ie; Free Trials)" ?>
            </td>
        </tr>

      </table>
   <?php
      
// return false if there's no configuration
      
return true;
   }

    function 
has_configuration() {
      
// return false if there's no configuration
      
return true;
   }

  
/**
    * Returns the "is_writeable" status of the configuration file
    * @param void
    * @returns boolean True when the configuration file is writeable, false when not
    */
   
function configfile_writeable() {
      return 
is_writeableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }

  
/**
    * Returns the "is_readable" status of the configuration file
    * @param void
    * @returns boolean True when the configuration file is writeable, false when not
    */
   
function configfile_readable() {
      return 
is_readableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }
  
/**
    * Writes the configuration file for this payment method
    * @param array An array of objects
    * @returns boolean True when writing was successful
    */
   
function write_configuration( &$d ) {

      
$my_config_array = array("LP_TEST_REQUEST" => $d['LP_TEST_REQUEST'],
                              
"LP_LOGIN" => $d['LP_LOGIN'],
                              
"LP_TYPE" => $d['LP_TYPE'],
                              
"LP_KEYFILE" => $d['LP_KEYFILE'],
                              
"LP_CHECK_CARD_CODE" => $d['LP_CHECK_CARD_CODE'],
                              
"LP_RECURRING" => $d['LP_RECURRING'],
  "LP_PREAUTH" => $d['LP_PREAUTH']
                            );
      
$config "<?php\n";
      
$config .= "defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); \n\n";
      foreach( 
$my_config_array as $key => $value ) {
        
$config .= "define ('$key', '$value');\n";
      }

      
$config .= "?>
";

      if ($fp = fopen(CLASSPATH ."payment/".$this->classname.".cfg.php", "w")) {
          fputs($fp, $config, strlen($config));
          fclose ($fp);
          return true;
     }
     else
        return false;
   }

  /**************************************************************************
  ** name: process_payment()
  ** created by: James McMillan
  ** description: process transaction linkpoint.net
  ** parameters: $order_number, the number of the order, we're processing here
  **            $order_total, the total $ of the order
  ** returns: T/F
  ***************************************************************************/
   function process_payment($order_number, $order_total, &$d) {


// We must include the yourpay/linkpoint api file. 
        include"lphp.php";
// Declare new linkpoint php class
        $mylphp=new lphp;

        global $vendor_mail, $vendor_currency, $PHPSHOP_LANG, $database;

        $ps_vendor_id = $_SESSION["ps_vendor_id"];
        $auth = $_SESSION['auth'];
        $ps_checkout = new ps_checkout;

        require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");


        // Get user billing information
        $dbbt = new ps_DB;
        $qt = "SELECT * FROM #__users WHERE id='".$auth["user_id"]."' AND address_type='BT'";
        $dbbt->query($qt);
        $dbbt->next_record();
        $user_info_id = $dbbt->f("user_info_id");
        if( $user_info_id != $d["ship_to_info_id"]) {
            // Get user billing information
            $dbst =& new ps_DB;
            $qt = "SELECT * FROM #__pshop_user_info WHERE user_info_id='".$d["ship_to_info_id"]."' AND address_type='ST'";
            $dbst->query($qt);
            $dbst->next_record();
        }
        else {
            $dbst = $dbbt;
        }

// Start gathering the information needed for the XML transaction
        $cuname = substr($dbbt->f("first_name"), 0, 25) . " " . substr($dbbt->f("last_name"), 0, 25);
// The following should be static for linkpoint, if not, change to the specified host
        $myorder["host"]       = "secure.linkpt.net";
        $myorder["port"]       = "1129";
        $myorder["keyfile"]    = LP_KEYFILE;
        $myorder["configfile"] = LP_LOGIN; 

        $myorder["name"]     = $cuname;
        $myorder["company"]  = substr($dbbt->f("company"), 0, 50);
        $myorder["address1"] = substr($dbbt->f("address_1"), 0, 60);
        $myorder["address2"] = substr($dbbt->f("address_2"), 0, 60);
        $myorder["city"]     = substr($dbbt->f("city"), 0, 40);
        $myorder["state"]    = substr($dbbt->f("state"), 0, 40);
        $myorder["zip"]      = substr($dbbt->f("zip"), 0, 20);
        $myorder["country"]  = substr($dbbt->f("country"), 0, 60);
        $myorder["phone"]    = substr($dbbt->f("phone_1"), 0, 25);
        $myorder["fax"]      = substr($dbbt->f("fax"), 0, 25);
        $myorder["email"]    = $dbbt->f("email");

        $myorder["cardnumber"]    = $_SESSION['ccdata']['order_payment_number'];
        $myorder["cardexpmonth"]  = $_SESSION['ccdata']['order_payment_expire_month'];
        $myorder["cardexpyear"]   = substr($_SESSION['ccdata']['order_payment_expire_year'],2,2);
        $myorder["cvmindicator"]  = "provided";
        $myorder["cvmvalue"]      = $_SESSION['ccdata']['credit_card_code'];
        $myorder["chargetotal"]   = $order_total;

// Working on a fix for this orderid, this process seems to send "Duplicate transaction"
// if the user made a typo the first time they entered their card number.  All in all, it works
// but their could ba a change.
        $myorder["oid"]           = $order_number; // need to clean this up, no offence Soeren, but those order numbers are a mess.


        // Let me see the output.
        //$myorder["debugging"]="true";


        if (LP_RECURRING == "YES") {

//if we are doing recurring billing, and the payments are not processed imedeately, we should run a Pre-Auth
// This is mostly if you are offering a customer x ammount of free days for a service, if you are charging the card
// at this time, you can uncomment the following 2 lines Pre-Auth part .
if (LP_PREAUTH == "YES") {

        $myorder["ordertype"]     = "PREAUTH";
// Process the PREAUTH
        $result = $mylphp->curl_process($myorder);

if ($result["r_approved"] != "APPROVED") {   // transaction failed, print the reason
$d["error"] = $result["r_error"];
$d["order_payment_log"] = $result["r_error"];
$d["order_payment_log"] .= $result["r_message"];
$d["order_payment_trans_id"] = $result["r_ordernum"];
return False;
}
}

$myorder["action"] = "SUBMIT";
$myorder["installments"] = -1;
$myorder["periodicity"] = monthly;
// We will give them 30 days free.
$myorder["startdate"] =  date(Ymd,time()+2592000);
$myorder["threshold"] =  3;
$myorder["ordertype"]     = "SALE";
// If everything worked out fine, then process the order here and leave the class.  Saved by the Bell
        $result = $mylphp->curl_process($myorder);
if ($result["r_approved"] != "SUBMITTED")    // transaction failed, print the reason
{
   $d["error"] = $result["r_error"];
   $d["order_payment_log"] = $result["r_error"];
   $d["order_payment_log"] .= $result["r_message"];
   $d["order_payment_trans_id"] = $result["r_ordernum"];
   return False;
}
else    // Success, let's return
{
   $d["order_payment_log"] = $PHPSHOP_LANG->_PHPSHOP_PAYMENT_TRANSACTION_SUCCESS.": ";
   $d["order_payment_log"] = $result["r_approved"];
   // Catch Transaction ID
   $d["order_payment_trans_id"] = $result["r_ordernum"];
   return True;
}
}else{
// Not recurring, just plain old sale.
$myorder["ordertype"]     = "SALE";
}

// If everything worked out fine, then process the order.
        $result = $mylphp->curl_process($myorder);

        if ($result["r_approved"] != "APPROVED")    // transaction failed, print the reason
        {
           $d["error"] = $result["r_error"];
           $d["order_payment_log"] = $result["r_error"];
           $d["order_payment_log"] .= $result["r_message"];
           $d["order_payment_trans_id"] = $result["r_ordernum"];
           return False;
        }
        else    // Success, let's return
        {
           $d["order_payment_log"] = $PHPSHOP_LANG->_PHPSHOP_PAYMENT_TRANSACTION_SUCCESS.": ";
           $d["order_payment_log"] = $result["r_approved"];
           // Catch Transaction ID
           $d["order_payment_trans_id"] = $result["r_ordernum"];
           return True;
        }

   }

}

David Glines

This is a great addition for mambo-phpshop. Thanks for your time and posting this!

dg

abfchgirlx

Wow, I just posted a couple of weeks ago (I think) regarding Yourpay.

My bank is suggests yourpay.  And I think you so much!  I'm sure once I get the ball rolling, I'll be PMing you for guidance. :)

Thank You!!

edeleon

Hello to everybody, i read a lot to find a module to use the Paradata Systemas PHP Api for the tool OpenConnect, finally this post helps me a lot and i made changes to use it for Open Connect, thnx, James.

And i like to share with you guys if someone need it



<?php
/*
* @version $Id: ps_paradata.php,v 0.8 2005/07/23
* @package Mambo_4.5.x
* @subpackage mambo-phpShop
* @copyright (C) 2005 Edgar de Leon
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*
* The ps_paradta class, containing the payment processing code
* for transactions with Paradata Systems with many payment processors.
* This version doesn't contains code for Recurring billing an/or PreAuth Options
*
* Installation:  You must have the Paradata API  file (Paygateway.php) in the
* current working directory, or your php includes directory.
* you also got to provide the Token of your account in the configuration file.
*
* In the administrator console of mambo-phpShop -> Payment Method List -> Creditcard PD -> Configuration
* you can insert your token number.
*
* Any questions, email edeleon@intra.net.gt
*/

defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class 
ps_paradata {

    var 
$payment_code "PD";
    var 
$classname "ps_paradata";

    
/**
* Most of this top configuration code was stripped and hacked from the authorize.net payment class
* and the LinkPoint payment class found on the Mambo_phpshop forums made by James McMillan (thnx James!)
    * Show all configuration parameters for this payment method
    * @returns boolean False when the Payment method has no configration
    */
    
function show_configuration() {

      global 
$PHPSHOP_LANG$sess;
      
$payment_method_id mosGetParam$_REQUEST'payment_method_id'null );
      
/** Read current Configuration ***/
      
require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");
    
?>

      <table>
        <tr>
            <td><strong><?php echo "Paradata OpenConnect Token" ?></strong></td>
            <td>
                <input type="text" name="PD_TOKEN" class="inputbox" value="<? echo PD_TOKEN ?>" />
            </td>
            <td><?php echo "This is the token assigned to your Store. To put your production token in test mode, append the word TEST to the front of the token." ?>
            </td>
        </tr>
        <tr>
            <td><strong><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_CVV2 ?></strong></td>
            <td>
                <select name="PD_CHECK_CARD_CODE" class="inputbox">
                <option <?php if (PD_CHECK_CARD_CODE == 'YES') echo "selected=\"selected\""?> value="YES">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_YES ?></option>
                <option <?php if (PD_CHECK_CARD_CODE == 'NO') echo "selected=\"selected\""?> value="NO">
                <?php echo $PHPSHOP_LANG->_PHPSHOP_ADMIN_CFG_NO ?></option>
                </select>
            </td>
            <td><?php echo $PHPSHOP_LANG->_PHPSHOP_PAYMENT_CVV2_TOOLTIP ?></td>
        </tr>

      </table>
   <?php
      
// return false if there's no configuration
      
return true;
   }

    function 
has_configuration() {
      
// return false if there's no configuration
      
return true;
   }

  
/**
    * Returns the "is_writeable" status of the configuration file
    * @param void
    * @returns boolean True when the configuration file is writeable, false when not
    */
   
function configfile_writeable() {
      return 
is_writeableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }

  
/**
    * Returns the "is_readable" status of the configuration file
    * @param void
    * @returns boolean True when the configuration file is writeable, false when not
    */
   
function configfile_readable() {
      return 
is_readableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }
  
/**
    * Writes the configuration file for this payment method
    * @param array An array of objects
    * @returns boolean True when writing was successful
    */
   
function write_configuration( &$d ) {

      
$my_config_array = array("PD_TOKEN" => $d['PD_TOKEN'],
                              
"PD_CHECK_CARD_CODE" => $d['PD_CHECK_CARD_CODE']
                            );
      
$config "<?php\n";
      
$config .= "defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); \n\n";
      foreach( 
$my_config_array as $key => $value ) {
        
$config .= "define ('$key', '$value');\n";
      }

      
$config .= "?>
";

      if ($fp = fopen(CLASSPATH ."payment/".$this->classname.".cfg.php", "w")) {
          fputs($fp, $config, strlen($config));
          fclose ($fp);
          return true;
     }
     else
        return false;
   }

  /**************************************************************************
  ** name: process_payment()
  ** created by: James McMillan
  ** modified by: Edgar de Leon (to use OpenConnect PHP API)
  ** description: process transaction paradata.com
  ** parameters: $order_number, the number of the order, we're processing here
  **            $order_total, the total $ of the order
  ** returns: T/F
  ***************************************************************************/
   function process_payment($order_number, $order_total, &$d) {


// We must include the paradata api file.
        include"Paygateway.php";
// Declare new paradata php class
        $creditCardRequest = new TransactionRequest();

        global $vendor_mail, $vendor_currency, $PHPSHOP_LANG, $database;

        $ps_vendor_id = $_SESSION["ps_vendor_id"];
        $auth = $_SESSION['auth'];
        $ps_checkout = new ps_checkout;

        require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");

        $creditCardRequest->setAccountToken(PD_TOKEN);
        $creditCardRequest->setChargeType(SALE);           //To implement other types of Charges!


        // Get user billing information
        $dbbt = new ps_DB;
        $qt = "SELECT * FROM #__users WHERE id='".$auth["user_id"]."' AND address_type='BT'";
        $dbbt->query($qt);
        $dbbt->next_record();
        $user_info_id = $dbbt->f("user_info_id");
        if( $user_info_id != $d["ship_to_info_id"]) {
            // Get user billing information
            $dbst =& new ps_DB;
            $qt = "SELECT * FROM #__pshop_user_info WHERE user_info_id='".$d["ship_to_info_id"]."' AND address_type='ST'";
            $dbst->query($qt);
            $dbst->next_record();
        }
        else {
            $dbst = $dbbt;
        }

// Start gathering the information needed for the XML transaction
        $creditCardRequest->setBillFirstName(substr($dbbt->f("first_name"), 0, 25));
        $creditCardRequest->setBillLastName(substr($dbbt->f("last_name"), 0, 25));
        $creditCardRequest->setBillCompany(substr($dbbt->f("company"), 0, 50));
        $creditCardRequest->setBillAddressOne(substr($dbbt->f("address_1"), 0, 60));
        $creditCardRequest->setBillAddressTwo(substr($dbbt->f("address_2"), 0, 60));
        $creditCardRequest->setBillCity(substr($dbbt->f("city"), 0, 40));
        $creditCardRequest->setBillStateOrProvince(substr($dbbt->f("state"), 0, 40));
        $creditCardRequest->setBillZipOrPostalCode(substr($dbbt->f("zip"), 0, 20));
        $creditCardRequest->setBillCountryCode(substr($dbbt->f("country"), 0, 60));
        $creditCardRequest->setBillPhone(substr($dbbt->f("phone_1"), 0, 25));
        $creditCardRequest->setBillFax(substr($dbbt->f("fax"), 0, 25));
        $creditCardRequest->setBillEmail($dbbt->f("email"));

        $creditCardRequest->setCreditCardNumber($_SESSION['ccdata']['order_payment_number']);
        // El nombre que aparece enla tarjeta esta en esta variable pero paradata no la pide    order_payment_name
        $creditCardRequest->setExpireMonth($_SESSION['ccdata']['order_payment_expire_month']);
        $creditCardRequest->setExpireYear(substr($_SESSION['ccdata']['order_payment_expire_year'],2,2));
        // Para verificar el codigo de la tarjeta $creditCardRequest->setCreditCardVerificationNumber($_SESSION['ccdata']['credit_card_code']);
        $creditCardRequest->setChargeTotal($order_total);
        $creditCardRequest->setOrderID($order_number);

// process the order.
        $creditCardResponse = $creditCardRequest->doTransaction();

      if($creditCardResponse) {
        if ($creditCardResponse->GetResponseCode() != 1)    // transaction failed, print the reason
        {
           $d["error"] = "Error ".$creditCardResponse->GetResponseCode();
           $d["error"] .= " ".$creditCardResponse->GetResponseCodeText();
           $d["order_payment_log"] = $creditCardResponse->GetResponseCode();
           $d["order_payment_log"] .= " Response: ".$creditCardResponse->GetResponseCodeText();
           $d["order_payment_trans_id"] = " TimeStamp: ".$creditCardResponse->GetTimeStamp();
           return False;
        }
        else    // Success, let's return
        {
           $d["order_payment_log"] = $PHPSHOP_LANG->_PHPSHOP_PAYMENT_TRANSACTION_SUCCESS.": ";
           $d["order_payment_log"] = $creditCardResponse->GetResponseCodeText();
           $d["order_payment_log"] .= " TimeStamp: ".$creditCardResponse->GetTimeStamp();
           $d["order_payment_log"] .= " Bank Approval Code :".$creditCardResponse->GetBankApprovalCode();
           // Catch Transaction ID
           $d["order_payment_trans_id"] = $creditCardResponse->GetBankTransactionID();
           return True;
        }
      } else {
                $d["error"] = $creditCardRequest->getError();
                $d["order_payment_log"] = $creditCardRequest->getError();
                $d["order_payment_trans_id"] = $creditCardRequest->GetOrderID($order_number);
      }
   }

}


Gerto

#9
I have a few questions about that code posted before:

* Installation:  You must have the linkpoint/yourpay.com API  file (lphp.php) in the
* current working directory, or your php includes directory.
* you also should have your public key file provided by linkpoint/yourpay.com secured
* in a directory outside of the webroot, but readable by the webserver daemon owner (ie; nobody)
*
* In the administrator console of mambo-phpShop -> Payment Method List -> Creditcard LP -> Configuration
* you can insert your store number, and public key location.


So, I have the lphp.php and the public key;
But now, so I go to the phpshop admin panel -> payment method list, and I only see:
1 Credit Card  AN 0.00 -default- Use Payment Processor     
2 Credit Card (2Checkout)  2CO 0.00 -default- PayPal related     
3 Credit Card (eProcessingNetwork)  EPN 0.00 -default- Use Payment Processor     
4 Credit Card (PayMeNow)  PN 0.00 -default- Use Payment Processor     



=> No linkpoint  ??? (I've tried it with mambo-phpShop 1.2 stable 3 and with Virtuemart

Could somebody please help me with this?

Thanks,
Gert

zac

My client is being charged fees because the addresses are not being verified.  I cannot see were to make this happen.  Any help is greatly appreciated!!!