Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default PayPal Express Checkout - Prevent Unverified Accounts from making purchases

    Hello everyone. I'm trying to figure out if it would be possible to have a code that would check for the Payer Status and if it's verified accept the order, and if not throw an error message and not charge the paypal account, maybe on the checkout_success page?

    I use a combination of codes to display different messages/hide checkout button depending on my store's needs. This below is the code currently on the page:
    PHP Code:
    <?php
    if (!IS_ADMIN_FLAG) { 
        global 
    $order$db;
          if ((
    $order->info['total'] < MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) && (substr_count($_SESSION['shipping']['id'], 'freeoptions') !=0)) { 
      
        echo 
    '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order no longer qualifies for Free Shipping.</strong></p>
        <p style="text-align: center;"><strong>The total for your order is below the minimum qualifying for Free Shipping.</strong></p>
        <p style="text-align: center;"><strong>Please head back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to increase the quantity of products in your bag, add more products or select 
        a different shipping option.</strong></p>'

        echo
    '<span id="opc-order-confirm"></span>';  
      } else {
    ?>


    <?php
    if ($_SESSION['payment'] == 'paypalwpp') {
      
    // do something
        
    echo '<div class="buttonRow">' TITLE_CONTINUE_CHECKOUT_PROCEDURE '</div>';
      
    } else {
      
    // do not do something
    ?>
    <div class="buttonRow"><?php echo TEXT_CONTINUE_CHECKOUT_PROCEDURE?></div>
    <div class="buttonRow confirm-order"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDERBUTTON_CONTINUE_CHECKOUT_CONFIRMATION_ALT'name="btn_submit" id="btn_submit"') ;?></div>

    <?php } } ?>
    The first block hides the checkout button and displays a message if the order total is below the free shipping threshold. The second displays a message if paypal is selected as a method of payment, instructing them we do not accept paypal payments if account is unverified, which has been an issue.

    I thought I could add a code to the paypal portion to establish if the paypal account is verified or not, but that wouldn't work, since the login to the customer's paypal account isn't established until they actually click the checkout button.

    So I thought perhaps a piece of code in the checkout_success might work instead(?) but then the issue is the paypal account at that point is already charged and not much we can do.

    So far what we've been doing is cancelling the orders from unverified accounts, which is a pain.

    I guess my question is, is it possible for orders paid with paypal, to get pre-verified before reaching paypal and charging the account, and if the user's account is unverified, throw an error message and not charge the paypal account?

    Thank you for the help.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PayPal Express Checkout - Prevent Unverified Accounts from making purchases

    While not exactly the same thing as what you're asking, since a confirmed address is a form of verification, do you have Express Checkout: Require Confirmed Address set to true already in the Express Checkout module?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: PayPal Express Checkout - Prevent Unverified Accounts from making purchases

    Quote Originally Posted by DrByte View Post
    While not exactly the same thing as what you're asking, since a confirmed address is a form of verification, do you have Express Checkout: Require Confirmed Address set to true already in the Express Checkout module?
    Yes, it's set to true. Could it be possible to use that code as the platform to do what I'm looking for?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PayPal Express Checkout - Prevent Unverified Accounts from making purchases

    Try adding the following. (I've not tested it with a live purchase, but it seems right according to the docs.)

    /includes/modules/payment/paypalwpp.php (around line 1860 in v156c)
    Code:
    // get the payer_id from the customer's info as returned from PayPal
    $_SESSION['paypal_ec_payer_id'] = $response['PAYERID'];
    $this->notify('NOTIFY_PAYPAL_EXPRESS_CHECKOUT_PAYERID_DETERMINED', $response['PAYERID']);
    
    
    // Block unverified PayPal accounts
    if (!empty($response['PAYERSTATUS']) && $response['PAYERSTATUS'] !== 'verified') {
      $this->terminateEC('Sorry, your PayPal account is unverified. Please go to PayPal and verify your account before resuming checkout.', true, FILENAME_SHOPPING_CART);
    }
    
    
    // More optional response elements; initialize them to prevent follow-on PHP notices.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: PayPal Express Checkout - Prevent Unverified Accounts from making purchases

    Quote Originally Posted by DrByte View Post
    Try adding the following. (I've not tested it with a live purchase, but it seems right according to the docs.)

    /includes/modules/payment/paypalwpp.php (around line 1860 in v156c)
    Code:
    // get the payer_id from the customer's info as returned from PayPal
    $_SESSION['paypal_ec_payer_id'] = $response['PAYERID'];
    $this->notify('NOTIFY_PAYPAL_EXPRESS_CHECKOUT_PAYERID_DETERMINED', $response['PAYERID']);
    
    
    // Block unverified PayPal accounts
    if (!empty($response['PAYERSTATUS']) && $response['PAYERSTATUS'] !== 'verified') {
      $this->terminateEC('Sorry, your PayPal account is unverified. Please go to PayPal and verify your account before resuming checkout.', true, FILENAME_SHOPPING_CART);
    }
    
    
    // More optional response elements; initialize them to prevent follow-on PHP notices.

    It seems to be working, but yet again my PP account is verified. I'm creating a new PP account just for testing, and report back. Thank you! =)

 

 

Similar Threads

  1. Using Store From Mobile With Express Checkout Casues Error From PayPal
    By shyguy0507 in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 4 Nov 2010, 07:39 PM
  2. demo video from paypal express checkout
    By kitcorsa in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 14 May 2008, 11:04 AM
  3. how to refuse unverified paypal payment?
    By william_c in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 21 Mar 2008, 05:15 PM
  4. Paypal Express - but for 'verified paypal' accounts only - possible?
    By DogTags in forum PayPal Express Checkout support
    Replies: 4
    Last Post: 22 Oct 2007, 05:54 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR