If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Credit Card Error Messages - How To Create?

Credit Card Error Messages - How To Create?

Started by youngblood on 22 Jul 2011, 8:04 PM · Views: 1,188

Results 1 to 2 of 2
22 Jul 2011, 8:04 PM
#1
youngblood avatar

youngblood

New Zenner

Join Date:
Apr 2010
Posts:
59
Plugin Contributions:
0

Post #1 by youngblood

Good afternoon,

Problem: When a customer attempts to checkout with the wrong CC information or insufficient funds, they progress to the checkout confirmation page and then they are sent back to the checkout payment page with no error when they confirm their order.

I'm trying to add a define parameter in this array for the gateway_services_cc.php file.

My objective is to create a generic credit card error message for users that enter in the incorrect card number or when their card is declined due to insufficient funds.

I have a good idea on where and how to implement the code, I just don't know how to create the variables that would define the error so that Zen can pick up on it and que the error message.

Any help you can provide would be much appreciated as always.

~Youngblood
http://www.primevapor.com

ZenCart 1.3.9h

22 Jul 2011, 8:17 PM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

Use the $messageStack.
An example from the Authorize.net module:```
// If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message
if ($response_code != '1') {
$messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE, 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}

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