i accept your apology.
i have never been a hug fan of the way coupons work on zen-cart. i have worked on them in the past; both in the core repository as well as on various client sites.
i think the problem you are pointed out can be seen here:
https://www.dropbox.com/s/5qnyafrk2c...upon.webm?dl=0
which, i am in agreement is a bit misleading. customers want to put in a coupon code, and then ensure the coupon is taken prior to giving up their credit card data. that makes sense to me.
if you find the following method, which in version v1.0.3 is on line 257, you can change the code as follows:
PHP Code:
//from
public function pre_confirmation_check()
{
global $messageStack;
if (empty($_REQUEST['tokenResult'])) {
trigger_error('missing token result: ' . " check if card button is disabled on dev console using: document.getElementById('card-button'); else look for javascript error in console.");
$messageStack->add_session('checkout_payment', MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION, 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}
//to
public function pre_confirmation_check()
{
global $messageStack;
if (empty($_REQUEST['tokenResult'])) {
if (empty($messageStack->messages)) {
trigger_error('missing token result: ' . " check if card button is disabled on dev console using: document.getElementById('card-button'); else look for javascript error in console.");
$messageStack->add_session('checkout_payment', MODULE_PAYMENT_SQ_WEBPAY_TEXT_MISCONFIGURATION, 'error');
}
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}
i think your problem will go away. assuming i have it correct. you can see the results of my testing here:
https://www.dropbox.com/s/l02ri0fp6x...ange.webm?dl=0
note that i have only included about half of the pre_confirmation check function. the rest of the function remains the same and is required.
hope that helps.
Bookmarks