0

I've set up my Sandbox PayPal account in Magento, but when completing the order, I get a dialog box saying 'There was an error processing your order. Please contact us or try again later.'

No order turns up in the back end, and the pag doesn't go anywhere. The Payment failed email comes through to me (via BCC though, so I assume it's being processed).

After I turned logging on, the exception log contained:

2013-11-06T11:06:45+00:00 ERR (3): 
exception 'Exception' with message 'PayPal response hasn't required fields.' in /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Api/Nvp.php:984
Stack trace:
#0 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Api/Nvp.php(655): Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
#1 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Direct.php(343): Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
#2 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Direct.php(178): Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), 229.99)
#3 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order/Payment.php(1077): Mage_Paypal_Model_Direct->authorize(Object(Mage_Sales_Model_Order_Payment), 229.99)
#4 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order/Payment.php(342): Mage_Sales_Model_Order_Payment->_authorize(true, 229.99)
#5 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order.php(885): Mage_Sales_Model_Order_Payment->place()
#6 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order.php(1103): Mage_Sales_Model_Order->_placePayment()
#7 [internal function]: Mage_Sales_Model_Order->place()
#8 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#9 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#10 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#11 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#12 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/community/Swift/OnepageCheckout/Model/Type/Opcheckout.php(678): Mage_Sales_Model_Service_Quote->submitAll()
#13 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/community/Swift/OnepageCheckout/controllers/IndexController.php(518): Swift_OnepageCheckout_Model_Type_Opcheckout->saveOrder()
#14 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Swift_OnepageCheckout_IndexController->saveOrderAction()
#15 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#16 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#19 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/index.php(71): Mage::run('', 'store')
#20 {main}
2013-11-06T11:06:45+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'There was an error processing your order. Please contact us or try again later.' in /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/Mage.php:594
Stack trace:
#0 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Api/Nvp.php(987): Mage::throwException('There was an er...')
#1 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Api/Nvp.php(655): Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
#2 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Direct.php(343): Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
#3 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Paypal/Model/Direct.php(178): Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), 229.99)
#4 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order/Payment.php(1077): Mage_Paypal_Model_Direct->authorize(Object(Mage_Sales_Model_Order_Payment), 229.99)
#5 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order/Payment.php(342): Mage_Sales_Model_Order_Payment->_authorize(true, 229.99)
#6 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order.php(885): Mage_Sales_Model_Order_Payment->place()
#7 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Order.php(1103): Mage_Sales_Model_Order->_placePayment()
#8 [internal function]: Mage_Sales_Model_Order->place()
#9 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#10 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#11 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#12 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#13 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/community/Swift/OnepageCheckout/Model/Type/Opcheckout.php(678): Mage_Sales_Model_Service_Quote->submitAll()
#14 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/community/Swift/OnepageCheckout/controllers/IndexController.php(518): Swift_OnepageCheckout_Model_Type_Opcheckout->saveOrder()
#15 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Swift_OnepageCheckout_IndexController->saveOrderAction()
#16 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#17 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#20 /var/www/vhosts/acesigns.biz/httpdocs/gadgetclinic/index.php(71): Mage::run('', 'store')
#21 {main}

Is there anything immediately I should be looking at? Because I can't seem to see what this log file is really trying to tell me... can anyone give me a few pointers or some help?

EDIT: The PayPal Payment Log

2013-11-06T11:06:45+00:00 DEBUG (7): Array
(
    [url] => https://api-3t.sandbox.paypal.com/nvp
    [DoDirectPayment] => Array
        (
            [PAYMENTACTION] => Authorization
            [IPADDRESS] => ***
            [RETURNFMFDETAILS] => 1
            [AMT] => 229.99
            [CURRENCYCODE] => GBP
            [INVNUM] => 100000005
            [NOTIFYURL] => http://www.asg.co.uk/gadgetclinic/paypal/ipn/
            [EMAIL] => ***
            [CREDITCARDTYPE] => ****
            [ACCT] => ****
            [EXPDATE] => ****
            [CVV2] => ****
            [ISSUENUMBER] => 
            [ITEMAMT] => 219.99
            [TAXAMT] => 0.00
            [SHIPPINGAMT] => 10.00
            [BUSINESS] => 
            [FIRSTNAME] => Lee
            [LASTNAME] => Collings
            [MIDDLENAME] => 
            [SALUTATION] => 
            [SUFFIX] => 
            [COUNTRYCODE] => GB
            [STATE] => ***
            [CITY] => ***
            [STREET] => ***
            [ZIP] => ***
            [PHONENUM] => ***
            [SHIPTOCOUNTRYCODE] => GB
            [SHIPTOSTATE] => ***
            [SHIPTOCITY] => ***
            [SHIPTOSTREET] => ***
            [SHIPTOZIP] => ***
            [SHIPTOPHONENUM] => ***
            [SHIPTOSTREET2] => 
            [STREET2] => 
            [SHIPTONAME] => Lee Collings
            [METHOD] => DoDirectPayment
            [VERSION] => 72.0
            [USER] => ****
            [PWD] => ****
            [SIGNATURE] => ****
            [BUTTONSOURCE] => Varien_Cart_DP_UK
        )

    [response] => Array
        (
            [TIMESTAMP] => 2013-11-06T11:06:45Z
            [CORRELATIONID] => fa395672b3fcb
            [ACK] => Failure
            [VERSION] => 72.0
            [BUILD] => 8311702
            [L_ERRORCODE0] => 10002
            [L_SHORTMESSAGE0] => Security error
            [L_LONGMESSAGE0] => Security header is not valid
            [L_SEVERITYCODE0] => Error
        )

    [__pid] => 7390
)
  • I have same issue, I repeated steps mentioned by @adam but no success. Was it resolved ? – user6485 May 6 '14 at 17:37
1

Enable paypal debugging log and check the payment_paypal_standard.log, it provides significantly more information for debugging purposes. If you can reply back with the log for a transaction I may be able to help you further.

Edit:

In which case, i've run into this before:

Remove API Username, API Password and API Signature from Admin->configuration->Paypal->API/Integration Settings. Clear your cache and retest!

  • In the log, the response I'm getting is saying Error Code 10002 Security Error: Security header is not valid. - Have added the code above in my original post. Thanks for your help! – Lee Collings Nov 7 '13 at 9:17
1

The problem you're having is because Magento is trying to insert transactions into either the "sales_flat_quote_payment" or "sales_flat_order_payment" or "sales_payment_transaction" table. This is why you're seeing the error: Integrity constraint violation: 1062 Duplicate entry '46-46-1' for key 'PRIMARY''

The problem is generated if you truncate the all order related table and not truncate the table of payment then duplicate order_id in "sales_payment_transaction"

I'm 100% sure this is the problem, so it's just a matter of finding the right table and deleting the records or truncate the table.

I'm assuming the sites not in production. If it is, then you may not be able to delete these records. Then there's another solution...

Note - Before delete the any records or truncate the table please take backup of your database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.