• Resolved stephenblender

    (@stephenblender)


    I noted I had some failed transactions in woocommerce which were successful in PayPal, obviously concerning. I found the cause and possible solution, and while looking another possible problem with solution.

    Problem 1: [RESPMSG] => Approved: 10431-Item amount is invalid.

    This response was being sent by Paypal as relay response(?), not silent. The [RESULT] is 0 (success) and the payment is successful in paypal, but in woocommerce this does not trigger pending->processing. The invalid amount is being caused by a creative use of negative fees, which may or may not be a good idea.

    Proposed solution:
    file:wc-gateway-paypal-advanced-angelleye.php, line ~412

                //handle the successful transaction
                switch ($_REQUEST['RESULT']) {
    
                    case 0 :
                        //stephen
                        //handle exceptional cases
                        if ($_REQUEST['RESPMSG'] == 'Approved' || $_REQUEST['RESPMSG'] == 'Verified') {
                            $this->success_handler($order, $order_id, $silent_post);
                        } else if ( substr($_REQUEST['RESPMSG'],0,9) == 'Approved:') {
                            $order->add_order_note( __('Payment warning via PayPal Advanced.', 'paypal-for-woocommerce') . ' ' . $_POST['RESPMSG']);
                            $this->success_handler($order, $order_id, $silent_post);
                        } else if ($_REQUEST['RESPMSG'] == 'Declined') {
                            $this->decline_handler($order, $order_id, $silent_post);
                        } else {
                            $this->error_handler($order, $order_id, $silent_post);
                        }
                        break;
                        //.stephen
    
                        /* old code removed by stephen
                        //handle exceptional cases
                        if ($_REQUEST['RESPMSG'] == 'Approved' || $_REQUEST['RESPMSG'] == 'Verified') {
                            $this->success_handler($order, $order_id, $silent_post);
                        } else if ($_REQUEST['RESPMSG'] == 'Declined') {
                            $this->decline_handler($order, $order_id, $silent_post);
                        } else {
                            $this->error_handler($order, $order_id, $silent_post);
                        }
                        break;
                        */

    This detects “Approved:” and treated like “Approved” with the addition of adding an oder note.

    Problem 2 – [RESPMSG] => Failed AVS Check.

    While testing the above I noticed my silent post for the same transaction was failing [RESULT] => 112. I was careless with my address I guess. If a transaction is declined the order status is changed to failed and a note is added. Because this was an unspecified error no note is added to the order which to me seems like an oversite as I would like to know if Paypal sends this sort of information.

    I suggest adding notes for error to the order:
    file:wc-gateway-paypal-advanced-angelleye.php, line ~300

    private function error_handler($order, $order_id, $silent_post) {
    
            //stephen add
            $order->add_order_note( __('Payment failed via PayPal Advanced because of.', 'paypal-for-woocommerce') . ' ' . $_POST['RESPMSG']);
            //.stephen
    

    Consideration: I am not very familiar with Paypal process or practices. These changes might have ramifications I do not appreciate.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor angelleyesupport

    (@angelleyesupport)

    Thanks for your feedback, I have forwarded your proposed suggestions to our tech lead, we will review it and do what is needed to be done ??
    Really appreciate your help.

    Thread Starter stephenblender

    (@stephenblender)

    Thought I would bump this topic as I found another related case where a payment is approved by PayPal, but the plugin is not accepting the returned message because the “Approved” message includes additional text.

    I have had a few orders come back which have not had successful CSC checks, but not failed either. They have condition “X” which is documented at “unsupported by the bank”. I should note: my paypal settings are for full CSC check, despite what the approval conditional message says. The PROCCVV2 ‘x’ is defined in paypal documentation as not supported by the bank, and incorrect number is ‘n’.

    [RESPMSG] => Approved: 10571-This transaction was approved. However, the Card Security Code provided had too few, too many, or invalid character types but, as per your account option settings, was not required in the approval process.
    [PROCCVV2] => X

    In Paypal the customer has been charged and the transaction is successful, but in woocommerce the order is still pending.

    My solution in the op also solves this issue.

    Plugin Contributor angelleyesupport

    (@angelleyesupport)

    Thanks again for the followup again , I have put these remarks for our developer’s we will what is needed to be done for this, in a future release.
    Thanks again,

    Plugin Contributor angelleye

    (@angelleye)

    We have made adjustments for this which will be included in the 1.4.15 update coming soon. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PayPal Advanced – 2 edge case errors with possible solutions’ is closed to new replies.