Forums / Built-in Shipping and Payment Modules / Block Customers' Paypal Email Address or PAYERID?

Block Customers' Paypal Email Address or PAYERID?

Views: 25,410

Results 21 to 29 of 29
21 Nov 2009, 10:43 AM
#21
opal avatar

opal

New Zenner

Join Date:
Apr 2008
Posts:
70
Plugin Contributions:
0

Block Customers' Paypal Email Address or PAYERID?

Thank you so much once again! :hug:

8 Mar 2011, 3:30 PM
#22
opal avatar

opal

New Zenner

Join Date:
Apr 2008
Posts:
70
Plugin Contributions:
0

Re: Block Customers' Paypal Email Address or PAYERID?

Dr. Byte, I was just wondering, I have updated my zen store to version 1.3.9h and I noticed that the line I had to edit for this in the paypalwpp.php has now changed to around line 1638. It also has additional text added to it: $this->notify('NOTIFY_PAYPAL_EXPRESS_CHECKOUT_PAYERID_DETERMINED', $response['PAYERID']);

Where would I now put the block code for the new updated paypalwpp.php file?

Do I replace it with:

$_SESSION['paypal_ec_payer_id'] = $response['PAYERID'];
if ($response['PAYERID'] == 'PUT_PAYER_ID_HERE') {
$this->terminateEC('Sorry, your transaction cannot be completed at this time.', true, FILENAME_CHECKOUT_SHIPPING);
}
$gender = '';

or do I add after?

Thank you.

8 Mar 2011, 11:49 PM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Block Customers' Paypal Email Address or PAYERID?

There's an even better way, which now means you won't have to edit the PayPal PHP file anymore!

That line that's replaced the part you were inserting before now allows the logic for your custom change to be handled by another file altogether. And that means it's easier for you to maintain the list without having to hunt through a huge long file to re-make the changes whenever an upgrade happens, or when you want to add another ID to the list.

Create two new files on your server, as follows:

  1. /includes/auto_loaders/config.paypal_restricted_buyers.php```
<?php /** * Autoloader to instantiate observer class */ $autoLoadConfig[200][] = array('autoType'=>'class', 'loadFile'=>'observers/class.paypal_restricted_buyers.php'); $autoLoadConfig[200][] = array('autoType'=>'classInstantiate', 'className'=>'paypal_restricted_buyers', 'objectName'=>'paypal_restricted_buyers'); ``` 2. /includes/classes/observers/class.paypal_restricted_buyers.php``` <?php /** * Deny certain PayPal buyers (intended only to be used when certain buyers are chronic refunders or fraudulent but PayPal isn't shutting them down) * * @package observers * @copyright Copyright 2003-2011 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: class.paypal_restricted_buyers.php 18039 2011-03-08 20:53:35Z drbyte $ */ class paypal_restricted_buyers extends base { /** constructor method ! * * Attach observer class to the global $zco_notifier and watch for a single notifier event. */ //function paypal_restricted_buyers() { //use this line if using old version of PHP (4 or lower), instead of the next line function __construct() { $this->attach($this, array('NOTIFY_PAYPAL_EXPRESS_CHECKOUT_PAYERID_DETERMINED')); } /** Actual Method that does the desired activity * * Called by observed class when any of the notifiable events occur * * @param object $class * @param string $eventID */ function update(&$class, $eventID, $paramsArray = array()) { $denied = array(); // Set list of denied PayPal PAYERIDs here: [B] $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE'; $denied[] = 'PUT_PAYER_ID_HERE';[/B] //repeat additional lines ABOVE as needed, following the same pattern //--------------------------------------------------- // Do not touch below: foreach($denied as $key=>$val) { if ($val != '' && $val != 'PUT'. '_PAYER_ID_' . 'HERE') { if ($paramsArray == $val) { $class->terminateEC('Sorry, your transaction cannot be completed at this time.', true, FILENAME_CHECKOUT_SHIPPING); } } } } } ```The part in red is the only thing you'll edit. Everything else should work exactly as-is. I recommend testing with your own ID for verification.

.
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.

9 Mar 2011, 12:01 PM
#24
opal avatar

opal

New Zenner

Join Date:
Apr 2008
Posts:
70
Plugin Contributions:
0

Re: Block Customers' Paypal Email Address or PAYERID?

Thank you so very much Dr.Byte! It's very much appreciated!

23 Apr 2011, 8:36 PM
#25
advplans avatar

advplans

New Zenner

Join Date:
Nov 2010
Posts:
3
Plugin Contributions:
0

Re: Block Customers' Paypal Email Address or PAYERID?

Dr. Byte,

does this new method in 1.3.9h still work only with paypal express checkout, or can it be made to work with PayPal Website Payments Standard?

I gotta couple of problem buyers with the same problem as the original poster.

24 Apr 2011, 1:31 AM
#26
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Block Customers' Paypal Email Address or PAYERID?

Due to PayPal's architecture of Website Payments Standard, this method cannot be used with that module.
It can be easily used with Express Checkout though, as described above.

.
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.

22 Jan 2013, 8:22 AM
#27
dreamer40 avatar

dreamer40

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: Block Customers' Paypal Email Address or PAYERID?

After yet another raid on my site yesterday by someone who buys my digital downloads and puts them on auction sites I did a quick hack on my site. I am still using PayPal Website Payments Standard and am more of a DBA than a programmer so put my DBA hat on and created a trigger on the paypal table. It checks the Paypal payer_id of any new entries against a lookup table of banned id's and, if it finds a match, changes the order to Pending so that they don't get a download button. I can then cancel the order and refund the payment at my leisure.

I am sure it won't stop them if they are determined but it made me feel better :smile:

7 Apr 2014, 3:53 AM
#28
ifss avatar

ifss

New Zenner

Join Date:
Oct 2013
Location:
Australia
Posts:
13
Plugin Contributions:
0

Re: Block Customers' Paypal Email Address or PAYERID?

Hi all,
Resurrecting an old thread, but this interests me greatly.

We have a repeat offender (digital downloads) and we've blocked him via both our .htaccess file and through our Gateway.
We use Paymate, and the slippery little sucker got through both of our restrictions, I am now looking at a full country ban.

Can the above be adapted to use for Country ID/Code/Name as Paymate do not accept the country at all.

I like the solution in #23 by Dr. Byte as it is elegant, and can be run independantly, which means it's safer in some respects to alter. Having it adapted for more than 1 gateway, would be fab.
http://www.zen-cart.com/showthread.php?141658-Block-Customers-Paypal-Email-Address-or-PAYERID&p=1004800#post1004800

Great work.

16 Apr 2014, 2:07 PM
#29
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Block Customers' Paypal Email Address or PAYERID?

Yes it can. You just have to edit your paymate payment module code and find where it processes responses from the gateway, and then inspect the transaction details for whatever criteria you're able to use to identify bad buyers. Your best bet for help with that is to talk to the Paymate folks, since they're the experts on what you can use to determine bad buyers.

.
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.