Zen Cart Logo
Forums / PayPal Website Payments Pro support / Define PayPal Errors

Define PayPal Errors

Locked

Views: 3,070

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

crystalkoi

Zen Follower

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

Define PayPal Errors

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, 07:26
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Define PayPal Errors

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

10 Sep 2008, 13:06
#3
crystalkoi avatar

crystalkoi

Zen Follower

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

Re: Define PayPal Errors

Hi DrByte,

Thanks for the tip. Is this what I am looking for?

_errorHandler($response, 'DoCapture');

Regards,

Shaun

10 Sep 2008, 13:16
#4
crystalkoi avatar

crystalkoi

Zen Follower

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

Re: Define PayPal Errors

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, 19:43
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Define PayPal Errors

no...

function _errorHandler( .... )
10 Sep 2008, 23:20
#6
crystalkoi avatar

crystalkoi

Zen Follower

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

Re: Define PayPal Errors

Thanks, found it.

21 Sep 2008, 02:51
#7
crystalkoi avatar

crystalkoi

Zen Follower

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

Re: Define PayPal Errors

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

27 Sep 2008, 03:32
#8
crystalkoi avatar

crystalkoi

Zen Follower

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

Re: Define PayPal Errors

Hi DrByte,

I got it all worked out now. Thanks for putting me in the right direction.

Regards,

CKD