cancel
Showing results for 
Search instead for 
Did you mean: 

Paypal API Setting MERCHDESCR & MERCHANTCITY

Paypal API Setting MERCHDESCR & MERCHANTCITY

Hi

 

I run multiple websites through my paypal account, the issue with multiple websites is that I need to pass the credit card descriptor to paypal so customers know where the charge came from. I can't use BrainTree because I am in Canada so I am stuck with payments pro.

 

I contacted paypal and they said I need to pass the following parameters to paypal MERCHDESCR & MERCHANTCITY through the API

 

I think I found where to set the information (I could be wrong)

 

under /app/code/core/Mage/Paypal/Model/Api/nvp.php but I am stuck after that. 

 

Thank you in advance for your help.

 

Jonathan

 

 

9 REPLIES

Re: Paypal API Setting MERCHDESCR & MERCHANTCITY

Hi,

 

Did you manage to get this to work? We have multiple sites and need this adding.

 

Thanks

 

Matt

Re: Paypal API Setting MERCHDESCR & MERCHANTCITY

Hi jwypych,

 

We're still having problems implementing this so if you've managed to get anywhere any help would be much appreciated.

 

Thanks

 

Matt

Re: Paypal API Setting MERCHDESCR

Hi
I was able to pass the key values to PayPal. I even had a PayPal
technician verify they where receiving them.

The PayPal system just ignores those values and just uses the account
defaults.

>From the technician they said said they didn't know why it wasn't working
so they started moving my account into Brain tree.

PayPal just doesn't work with multiple accounts.

Re: Paypal API Setting MERCHDESCR

Hi jwypych,

 

Thanks for the reply, it doesn't sound good that PayPal can't support this kind of thing. I don't suppose you've still got the code to pass the extra information to PayPal so we can give it a quick go?

 

It would save us a lot of time if you could help us out.

 

Thanks in advance.

 

Matt

Re: Paypal API Setting MERCHDESCR

Hi

 

Modify the file here

under /app/code/core/Mage/Paypal/Model/Api/nvp.php

 

There are a few parts of the code that need modification to pass the values correctly.

 

Around line 79, under the $_globalMap = array (

 

Add the following two lines

 

'MERCHDESCR' => 'merchdescr',

'MERCHANTCITY' => 'merchantcity', 

 

Around line 261

 

Modify the function 

protected $_doDirectPaymentRequest = array(

 

include the two values 'MERCHDESCR', 'MERCHANTCITY'

 

 

should look like this

 

protected $_doDirectPaymentRequest = array(
'PAYMENTACTION', 'IPADDRESS', 'RETURNFMFDETAILS',
'AMT', 'CURRENCYCODE', 'INVNUM', 'MERCHDESCR', 'MERCHANTCITY', 'NOTIFYURL', 'EMAIL', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT','CREDITCARDTYPE', 'ACCT', 'EXPDATE', 'CVV2', 'STARTDATE', 'ISSUENUMBER', 'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI3DS', 'XID',
);

 

Around line 667

 

Modify

public function callDoDirectPayment()

 

should look like this

 

public function callDoDirectPayment()
{
$request = $this->_exportToRequest($this->_doDirectPaymentRequest);
$this->_exportLineItems($request);
if ($this->getAddress()) {
$request = $this->_importAddresses($request);
}

//credit card descriptor //PP
$request['MERCHDESCR'] = "DESCRIPTOR";
$request['MERCHCITY'] = "ADDITIONAL DESCRIPTOR";


$response = $this->call(self:Smiley Very HappyO_DIRECT_PAYMENT, $request);
$this->_importFromResponse($this->_doDirectPaymentResponse, $response);
}

 

You can also try to replace the above with

 

'SOFTDESCRIPTOR'
'SOFTDESCRIPTORCITY'

 

Neither worked for me

 

If you turn on logging you should see that the values are being passed to paypal. I did a bunch of test charges with my personal credit card and it didn't do anything. 

 

I even got it verified by a paypal technician that they where receiving the values correctly and they where, but are at a loss on why it was setting correctly.

 

Hope it could be some help.

 

Jonathan

 

 

 

 

Re: Paypal API Setting MERCHDESCR

Hi jwypych,

 

Just tried this for my self and I couldn't get the information to pass through at all? I've turned on the logs and the two new values are no where to be seen!

 

Is there something I'm still missing?

 

Thanks in advance,

 

Elliot.

 

Re: Paypal API Setting MERCHDESCR

That should work above, the only thing I could think of is if you are not using payments pro with direct payment you wouldn't see the values. If you are using express checkout those get modified in a different function.

Re: Paypal API Setting MERCHDESCR

I'm 100% using Payments Pro whilst testing this, I'm using a Sandbox Credit Card to test this, although I wouldn't think this would cause a problem? 

 

Here are the modifications as copied from you, below:

 

protected $_globalMap = array(

........

'MERCHDESCR' => 'merchdescr',
'MERCHANTCITY' => 'merchantcity',

);

 

protected $_doDirectPaymentRequest = array(
'PAYMENTACTION', 'IPADDRESS', 'RETURNFMFDETAILS',
'AMT', 'CURRENCYCODE', 'INVNUM', 'MERCHDESCR', 'MERCHANTCITY', 'NOTIFYURL', 'EMAIL', 'ITEMAMT', 'SHIPPINGAMT', 'TAXAMT',
'CREDITCARDTYPE', 'ACCT', 'EXPDATE', 'CVV2', 'STARTDATE', 'ISSUENUMBER',
'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI3DS', 'XID',
);

 

 

 

public function callDoDirectPayment()
{
$request = $this->_exportToRequest($this->_doDirectPaymentRequest);
$this->_exportLineItems($request);
if ($this->getAddress()) {
$request = $this->_importAddresses($request);
}

$request['MERCHDESCR'] = "DESCRIPTOR";
$request['MERCHANTCITY'] = "ADDITIONAL DESCRIPTOR";

$response = $this->call(self:Smiley Very HappyO_DIRECT_PAYMENT, $request);
$this->_importFromResponse($this->_doDirectPaymentResponse, $response);
}

 

I'm sure these should be the same as you, though! 

 

Thanks again.

 

 

Re: Paypal API Setting MERCHDESCR & MERCHANTCITY

We are trying to accomplish the same thing - to have different descriptors appear on the bank/credit statements of the customer. If Joe's Garage made a sale, Joe's Garage should appear on the statement, and if Barney's Garage made a sale it should be Barney.

 

My questions to anyone are:

  1. What version of Magento are you using?
  2. Do you have your PayPal Pro accounts set up correctly:
    1. https://www.paypal.com/us/cgi-bin/webscr?cmd=p/sell/multiple_emai - this article clearly states that PayPal can do what we are after. Has anyone tried this? How did it work out?
    2. I called PayPal and I was told I needed adaptive payments set up on my account. Has anyone tried it with adaptive payments? And, how did it work out?