Magento PayPal Requested and configured merchant emails do not match - magento

Magento is periodically logging the following error.
ERR (3): exception 'Exception' with message 'Requested and configured
user#domain.com merchant emails do not match.' in
/home/user/public_html/app/code/core/Mage/Paypal/Model/Ipn.php:257
Based on my reading of the code:
The "configured merchant email" comes from the Magento configuration
The empty "Requested merchant email" comes from the receiver_email
field in the PayPal IPN message.
Why would the IPN message have an empty receiver_email field? I can make several guesses:
Protocol error from PayPal's service.
Configuration error in the PayPal.com account.
Magento bug resulting in empty or corrupt data.
Network problem resulting in empty or corrupt data.
Which is more likely, and how can I narrow it down?
It appears to be related to an adjustment transaction. A few odd things:
The referenced order was paid by credit card, not Paypal Express.
The referenced order was adjusted months ago.
This latest transaction is missing from the order comment history.
I suspect this is a code or protocol error. The transaction POST data is below with identifiers obscured to protect the innocent.
Array
(
[txn_type] => adjustment
[payment_date] => 12:17:03 Jul 20, 2015 PDT
[payment_gross] => -64.45
[mc_currency] => USD
[verify_sign] => ...
[payer_status] => verified
[payer_email] => seller#address.com
[txn_id] => ...
[parent_txn_id] => ...
[payer_id] => ...
[invoice] => 123456789
[reason_code] => chargeback_settlement
[payment_status] => Completed
[payment_fee] => -20.00
[mc_gross] => -64.45
[charset] => windows-1252
[notify_version] => 3.8
[ipn_track_id] => ...
)

In my case the issue was the configured email was not the primary email set on my paypal account. So, paypal was sending the default email account (which was different) as the requested email. After setting the configured email as the primary email address in paypal the issue seems to have been fixed.

I think this is a Magento bug. For chargebacks the merchant is actually the "payer". That is why in this case the address can be found in the payer_email field. The _verifyOrder method will have to be adjusted accordingly.

In my case the error happened after changing the primary email in the PayPal admin panel.
When changing the primary email in PayPal you need to generate new API credentials since it looks like the credential are based on the primary email at the moment of its generation.
Once you remove the old API credentials and generate new ones, update the credentials in Magento (Stores > Configuration > Sales > Payment Methods > PayPal Express Checkout), flush the cache and the problem should be gone.

Related

Plaid - error_code: 'ITEM_LOGIN_REQUIRED'. Recurring every hour or so

I am getting the following response when calling the /accounts/balances/get endpoint in the development environment. After getting this, I'll use update mode to get a new access_token. Once I swap in the new token, everything works fine for about an hour and then this error will occur again. I am 100% not making any updates on the bank side.
{ display_message: null,
error_code: 'ITEM_LOGIN_REQUIRED',
error_message: 'the login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information. use Link's update mode to restore the item to a good state',
error_type: 'ITEM_ERROR',
request_id: 'redacted',
suggested_action: null }
Does the login associated with the Item have "perpetual OTP" enabled -- i.e., is it configured so that you need to enter a 2-factor authentication token every time you log in to your bank, even on a trusted device?
If so, this is expected behavior -- once your original session expires, Plaid requires a user to be present to provide a new token and create a new session to get fresh data.
If not, there may be an issue with the integration between Plaid and the specific financial institution. If that's the situation, you should file a support ticket with Plaid so we can investigate further.

Namecheap\Mailgun - receiving email

I am wondering how to setup namcheap and maligun to receive emails. Currently I am able to send emails with my laravel application through maligun, but I am not sure how to setup maligun to receives replies?
I have seen the options of setting up routes to receive emails to some wanted enpoint, but currently I am not receiving anything on maligun, so I have nothing to forward. I am getting the message:
This is the mail system at host eforward3e.registrar-servers.com.
I'm sorry to have to inform you that your message could not be
delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can delete your
own text from the attached returned message.
The mail system
: unknown user:
"support#my-domain.com"
Final-Recipient: rfc822; support#my-domain.com
Original-Recipient: rfc822;support#my-domain.com Action: failed
Status: 5.1.1 Diagnostic-Code: X-Postfix; unknown user:
"support#my-domain.com"
How should I set this up?
Hope you register your domain at mailgun, if not then do it here. Once your domain register follow below steps:
1) Get domain and API Key from Mailgun > Doamins > Domain Information page
2) Setup config/services.php:
'mailgun' => array(
'domain' => 'YOURDOMAINNAME',//Place your register domain name here...
'secret' => 'API Key',//Place your API Key here...
),
3) Setup .env:
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=USERNAME
MAIL_PASSWORD=YOURPASSWORD
MAIL_ENCRYPTION=tls
4) Check with sending mail from laravel application.
That's it...

Magento payment - Unable to communicate with the PayPal gateway

I tested paypal on my development environment, when I wanted to create invoice, the system return an error:"Unable to communicate with the PayPal gateway."
then I checked the exception log and found:
exception 'Exception' with message 'PayPal NVP CURL connection error #6: Couldn't resolve host 'api-3t.sandbox.paypal.com'' in /data1/sites/testCE/app/code/core/Mage/Paypal/Model/Api/Nvp.php:983
order payment information:
Payer Status: unverified
Payer Address Status: Unconfirmed
Merchant Protection Eligibility: Eligible
Last Correlation ID: 152ec93611d7
Last Transaction ID: 2DT505704J718760U
Any help will be greatly appreciated, Thank you.
Best Regards
Try to disable SSL verification from your magento paypal configuration.

Missing SagePay RelatedSecurityKey

I am writing a refund function for our ecommerce site and I'm getting error code 3033 : The RelatedSecurityKey is required.
I have checked and the documentation says this key should be returned when the original transaction was made. We save the details without any modifications to the database, but I can't find it. The return values for my test transaction are:
VendorTxCode=241****
&VPSTxId={EBA625AB-955E-75C8-4409-*********}
&Status=OK
&StatusDetail=0000 : The Authorisation was Successful.
&TxAuthNo=763****
&AVSCV2=SECURITY CODE MATCH ONLY
&AddressResult=NOTMATCHED
&PostCodeResult=NOTMATCHED
&CV2Result=MATCHED
&GiftAid=0
&3DSecureStatus=NOTCHECKED
&CardType=VISA
&Last4Digits=0006
&Amount=25.00
Any suggestions?
SecurityKey - Only present if Status is OK.
To register the initial transaction, you post to Sage Pay via the Transaction Registration URL (A1).
Sage Pay send a server reponse to the tranasction registration POST in the Server protocol (see A2 in Sage Pay Server Protocol). The response includes the following - VPSProtocol, Status, StatusDetail, VPSTxId, SecurityKey and NextURL.
[A Security key which Sage Pay uses to generate a MD5 Hash to sign the Notification message (step A3 from the Sage Pay Server protocol, which is the example you are providing in response to the Notification post via the Notification URL). The signature is called VPSSignature. This value is used to allow detection of tampering with notifications from the Sage Pay Server. It must be kept secret from the Customer and held in your database. Only present if Status is OK.] You need the SecurityKey incase want to refund against the transaction in future as this will become the RelatedSecurityKey.
The NextURL redirects the customer/shopper to the Sage Pay payment page.
Sage Pay then notify you via the NotificationURL with the VPSSignature. (A3)
You then acknowledge receipt of the post and the customer is redirected via the RedirectURL back to a page on your website.

Paypal with Codeigniter

I am using paypal with codeigniter.
I have paypal credentials, find below -
$this->API_USERNAME = '************';
$this->API_PASSWORD = '************';
$this->API_SIGNATURE = '************';
My requirement is: Direct send payment to user's paypal email address. I have only user's paypal email address.
I used Paypal_pro codeigniter library but no luck, any suggestion. FInd my code below -
$nvpStr = "&EMAILSUBJECT=$emailSubject&RECEIVERTYPE=$receiverType&CURRENCYCODE=$currency";
$nvpStr.="&L_EMAIL0=$receiverEmail&L_Amt0=$amount&L_ITEMAMT=$amount&L_UNIQUEID0=$uniqueID&L_NOTE0=$note";
$httpParsedResponseAr = $this->paypal_pro->hash_call('MassPay', $nvpStr);
Response is-
Array ( [TIMESTAMP] => 2013-09-05T17:45:07Z [CORRELATIONID] => 3dfc532f74f43 [ACK] => Failure [VERSION] => 57.0 [BUILD] => 7560199 [L_ERRORCODE0] => 10329 [L_SHORTMESSAGE0] => User is blocked [L_LONGMESSAGE0] => We're sorry, but your PayPal account isn't currently eligible to send mass payments. Please contact either PayPal Customer Service or your account manager. [L_SEVERITYCODE0] => Error )
but above code works fine with test credentials, find below-
$this->API_USERNAME = 'seller_1297608781_biz_api1.lionite.com';
$this->API_PASSWORD = '1297608792';
$this->API_SIGNATURE = 'A3g66.FS3NAf4mkHn3BDQdpo6JD.ACcPc4wMrInvUEqO3Uapovity47p';
Then i changed this line-
$httpParsedResponseAr = $this->paypal_pro->hash_call('SetExpressCheckout', $nvpStr);
But it return below error -
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => Order total is missing.
Can anyone help me whats wrong i did?
MassPay has to be specifically approved and enabled on a live account in order to use it. The sandbox has access to it without approval so that's why it works fine with your test account.
SetExpressCheckout is the first step in integrating the Express Checkout payment flow into your website or application and its NVP string will be entirely different from what you're trying with MassPay. The error you got is because there was no AMT parameter included in the string you sent.
If you're simply trying to send money from your own account to another account you can use the Pay API for that.
I would recommend taking a look at my CodeIgniter library for PayPal which will make this very simple for you to setup your Pay request.

Resources