If this is your first visit, check our documentation. To post, register or login.

Define PayPal Errors

Locked

Started by crystalkoi on 10 Sep 2008, 6:17 AM · Views: 3,097

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
10 Sep 2008, 6:17 AM
#1
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #1 by crystalkoi

I would like to take the errors that are passed from PayPal, such as if the customer enters the wrong cvv code, then instead of getting

"15004 Gateway Decline - This transaction cannot be processed."

They would get, Sorry, but you entered the wrong cvv code, please check your card and try again.

Or if they were over their limit, then I could say, sorry, but your card is over its limit.

I believe this would help, and it would also allow errors to be in more than just English.

I have been trying to mess with the code in tpl_checkout_payment_default.php file, but nothing I do seems to be working.

Any help would be great.

Regards,

CKD

10 Sep 2008, 7:26 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

In the paypal shipping module code there is a _errorHandler() function that traps the error numbers and displays messages.

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

10 Sep 2008, 1:16 PM
#4
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #4 by crystalkoi

I mean this.

    if ($proceedToCapture) {
      $response = $doPayPal->DoCapture($txnID, $captureAmt, $currency, $captureType, '', $captureNote);
      $error = $this->_errorHandler($response, 'DoCapture');
      if (!$error) {
        if (isset($response['PNREF'])) {
          if (!isset($response['AMT'])) $response['AMT'] = $captureAmt;
          if (!isset($response['ORDERTIME'])) $response['ORDERTIME'] = date("M-d-Y h:i:s");
        }
        // Success, so save the results
        $sql_data_array = array('orders_id' => (int)$oID,
                                'orders_status_id' => (int)$new_order_status,
                                'date_added' => 'now()',
                                'comments' => 'FUNDS COLLECTED. Trans ID: ' . urldecode($response['TRANSACTIONID']) . $response['PNREF']. "\n" . ' Amount: ' . urldecode($response['AMT']) . ' ' . $currency . "\n" . 'Time: ' . urldecode($response['ORDERTIME']) . "\n" . (isset($response['RECEIPTID']) ? 'Receipt ID: ' . urldecode($response['RECEIPTID']) : 'Auth Code: ' . $response['AUTHCODE']) . (isset($response['PPREF']) ? "\nPPRef: " . $response['PPREF'] : '') . "\n" . $captureNote,
                                'customer_notified' => 0
                             );
        zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
        $db->Execute("update " . TABLE_ORDERS  . "
                      set orders_status = '" . (int)$new_order_status . "'
                      where orders_id = '" . (int)$oID . "'");
        $messageStack->add_session(sprintf(MODULE_PAYMENT_PAYPALDP_TEXT_CAPT_INITIATED, urldecode($response['AMT']), urldecode($response['RECEIPTID'] . $response['AUTHCODE']). $response['PNREF']), 'success');
        return true;
      }
    }
10 Sep 2008, 7:43 PM
#5
drbyte avatar

drbyte

Sensei

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

Post #5 by drbyte

no...

function _errorHandler( .... )

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

21 Sep 2008, 2:51 AM
#7
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #7 by crystalkoi

Hi DrByte,

I am trying to work things out here, but if you could help me find what I need to change in the code. I would just like to setup language definitions for some of the codes.

Anyways, if you can help, that would help me a ton.

Thanks for your time.

Regards,

CKD