Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 7 of 7

Thread: Paypal WPP conflicting with PWA?

  1. #1
    liquidhal
    Guest


    Default Paypal WPP conflicting with PWA?

    For some reason, after installing paypal's website payments pro contrib, users can no longer create accounts. instead i get the message, "Parse error: syntax error, unexpected $end in /home/rlspecia/public_html/create_account.php on line 394"

    394 being the last line of the file.

    I have very limited php skills, so I simply added the paypal bit in the appropriate place, but it's immediately followed by a pay without account segment of code that looks similar, could they be conflicting?


    PHP Code:
    //---PayPal WPP Modification START ---//    
          //$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
          
    $check_email_query tep_db_query("select customers_id as id, customers_paypal_ec as ec from " TABLE_CUSTOMERS " where customers_email_address = '" tep_db_input($email_address) . "'");
          if (
    tep_db_num_rows($check_email_query) > 0) {
            
    $check_email tep_db_fetch_array($check_email_query);
            if (
    $check_email['ec'] == '1') {
              
    //It's a temp account, so delete it and let the user create a new one
              
    tep_db_query("delete from " TABLE_ADDRESS_BOOK " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_INFO " where customers_info_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_WHOS_ONLINE " where customer_id = '" . (int)$check_email['id'] . "'");
            } else {
              
    $error true;

              
    $messageStack->add('create_account'ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
            }
    //---PayPal WPP Modification END---//    
          
    $check_email_query tep_db_query("select count(*) as total from " TABLE_CUSTOMERS " where customers_email_address = '" tep_db_input($email_address) . "'");
          
    $check_email tep_db_fetch_array($check_email_query);
    // BOF: MOD - PWA
    //      if ($check_email['total'] > 0) {
    //        $error = true;
    //        $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
          
    if ($check_email['total'] > 0) {
    //PWA delete account
            
    $get_customer_info tep_db_query("select customers_id, customers_email_address, purchased_without_account from " TABLE_CUSTOMERS " where customers_email_address = '" tep_db_input($email_address) . "'");
            
    $customer_info tep_db_fetch_array($get_customer_info); 
            
    $customer_id $customer_info['customers_id']; 
            
    $customer_email_address $customer_info['customers_email_address']; 
            
    $customer_pwa $customer_info['purchased_without_account']; 
            if (
    $customer_pwa !='1') {
               
    $error true;

               
    $messageStack->add('create_account'ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
            } else {   
              
    tep_db_query("delete from " TABLE_ADDRESS_BOOK " where customers_id = '" $customer_id "'");   
              
    tep_db_query("delete from " TABLE_CUSTOMERS " where customers_id = '" $customer_id "'");   
              
    tep_db_query("delete from " TABLE_CUSTOMERS_INFO " where customers_info_id = '" $customer_id "'");   
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET " where customers_id = '" $customer_id "'");   
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " where customers_id = '" $customer_id "'");   
              
    tep_db_query("delete from " TABLE_WHOS_ONLINE " where customer_id = '" $customer_id "'"); 
            }  
    // EOF: MOD - PWA 

  2. #2
    jpf
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    Yep - look at the duplicate code.
    Code:
     $check_email = tep_db_fetch_array($check_email_query);
    Code:
            if ($check_email['.......'] == '1') {
    Code:
              tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_email['id'] . "'");
              tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_email['id'] . "'");
              tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$check_email['id'] . "'");
              tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$check_email['id'] . "'");
              tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$check_email['id'] . "'");
              tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$check_email['id'] . "'");
    Code:
              $error = true;
    Code:
              $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);

    Re-read the instructions. Did it said to insert or replace:

    Code:
          if ($check_email['total'] > 0) {
            $error = true;
            $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
    ....
    This is the code that PWA changed.

  3. #3
    jpf
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    Try this:

    PHP Code:
          $messageStack->add('create_account'ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
        } else {

    //---PayPal WPP Modification START ---//    
          //$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
          
    $check_email_query tep_db_query("select customers_id as id, customers_paypal_ec as ec from " TABLE_CUSTOMERS " where customers_email_address = '" tep_db_input($email_address) . "'");
          if (
    tep_db_num_rows($check_email_query) > 0) {
            
    $check_email tep_db_fetch_array($check_email_query);
    //      if ($check_email['total'] > 0) {
    //        $error = true;
    //        $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
            
    if ($check_email['ec'] == '1') {
              
    //It's a temp account, so delete it and let the user create a new one
              
    tep_db_query("delete from " TABLE_ADDRESS_BOOK " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_INFO " where customers_info_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " where customers_id = '" . (int)$check_email['id'] . "'");
              
    tep_db_query("delete from " TABLE_WHOS_ONLINE " where customer_id = '" . (int)$check_email['id'] . "'");
            } else {
    // BOF: MOD - PWA
              
    if ($check_email['total'] > 0) {
    //PWA delete account
                
    $get_customer_info tep_db_query("select customers_id, customers_email_address, purchased_without_account from " TABLE_CUSTOMERS " where customers_email_address = '" tep_db_input($email_address) . "'");
                
    $customer_info tep_db_fetch_array($get_customer_info); 
                
    $customer_id $customer_info['customers_id']; 
                
    $customer_email_address $customer_info['customers_email_address']; 
                
    $customer_pwa $customer_info['purchased_without_account']; 
                if (
    $customer_pwa !='1') {
                   
    $error true;

                   
    $messageStack->add('create_account'ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
                } else {   
                  
    tep_db_query("delete from " TABLE_ADDRESS_BOOK " where customers_id = '" $customer_id "'");   
                  
    tep_db_query("delete from " TABLE_CUSTOMERS " where customers_id = '" $customer_id "'");   
                  
    tep_db_query("delete from " TABLE_CUSTOMERS_INFO " where customers_info_id = '" $customer_id "'");   
                  
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET " where customers_id = '" $customer_id "'");   
                  
    tep_db_query("delete from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " where customers_id = '" $customer_id "'");   
                  
    tep_db_query("delete from " TABLE_WHOS_ONLINE " where customer_id = '" $customer_id "'"); 
                }  
              }  
            }  
    //---PayPal WPP Modification END---//    
    // EOF: MOD - PWA
          
    }
        }

        if (
    strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
          
    $error true
    Not tested but should be close.

  4. #4
    jpf
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    FYI a complete package of:

    PayPal Website Payments Pro

    This module implements PayPal Website Payments Pro which consists of PayPal's Express Checkout and Direct Payment methods. Since it over-writes several checkout files, it is likely to be incompatible with any modifications you have made to your checkout process or any other contributions that modify the checkout process. We hope to enhance it in the future so that it can be installed along side other checkout modifications.

    This module does not use the PayPal PHP SDK so the installation is fairly easy.



    This has not be fully tested - this is a port to BTS and is OSCMAX compatible - the only file that may need tweaking is the above file. Anyone who use PAYPAL please test with PWA and report back.
    Attached Files Attached Files

  5. #5
    telder
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    I installed this mod and everything works up until the point where it reaches the checkout_process.php page. Once it hits this page I am given a blank screen. If someone clicks on the link to do an express payment it also sends them to a blank page via ex_process.php. Has anyone ran into this before and if so what was done to fix it?
    Last edited by telder; 11-21-2007 at 07:55 PM.

  6. #6
    telder
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    Does anyone have ANY thoughts on this??

  7. #7
    telder
    Guest


    Default Re: Paypal WPP conflicting with PWA?

    There has to be someone that has implemented this and knows how to resolve the issues that have cropped up. IF I can't get this resolved within the next few days I'll have to move on to a solution that actually works.

Similar Threads

  1. PayPal IPN in RC3 - values not being passed to PayPal?
    By SavageSinister in forum osCmax v2 Installation issues
    Replies: 3
    Last Post: 02-12-2007, 03:57 PM
  2. conflicting Text Characters html and php
    By anthon in forum osCommerce 2.2 Installation Help
    Replies: 4
    Last Post: 11-11-2004, 10:35 PM
  3. paypal and paypal IPN, whats the diff?
    By lhotch in forum osCommerce 2.2 Installation Help
    Replies: 1
    Last Post: 09-06-2003, 06:34 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •