Version 2.1.7 uploaded.
Payment succeeded message is editable from this version.
and Payment form moved from bottom to under the billing address.
Nihon Yokane corporation[/QUOTE]
Printable View
Version 2.1.7 uploaded.
Payment succeeded message is editable from this version.
and Payment form moved from bottom to under the billing address.
Nihon Yokane corporation[/QUOTE]
"Payment succeeded" message is displayed after pushing Confirmation button.
Language of the stripe form is multi language. It is automatically switched by user's browser.
but "Payment succeeded" message is not multi language.
Therefore,Administrator can change the word.
Attachment 20819
Nihon Yokane corporation
On the stripe download page it shows support for Zen:
v1.5.7, v1.5.8, v2.0.0
In the help it shows: v1.5.7d
In the same help file is shows v1.5.8
Which is the true minimum Zen and PHP versions supported?
I'm using Zen 1.5.7c, I assume that this means Stripe_module_zc157d will not work?
I compared the code for stripe 1.5.7d and 1.5.8 and it looked like 1.5.8 should work with zen cart 1.5.7c and php 7.4
Installed the files, went to zen's payment module screen. There was this error:
There is no such file in that path. Instead there is lang_stripe.phpPHP Code:
ERROR: module not loaded due to missing language file: /path/includes/languages/english/modules/payment/stripe.php
Is this a known issue?
Changed the name from lang_stripe.php to stripe.php, and the error is gone
On the Zen Payment Modules page, instead of "STRIPE" or whatever it should be, it is listed as:
MODULE_PAYMENT_STRIPE_TEXT_TITLE
Ignoring this for now, I installed it, configured it, and it appears to be working. But on the Zen order checkout page, it is again shown as:
MODULE_PAYMENT_STRIPE_TEXT_TITLE
with no image.
If I select it, click Continue, its the normal checkout page with stripe at the bottom....which is good
The last update posted was 12/6/24 and is version 2.1.6
https://www.zen-cart.com/downloads.php?do=file&id=1548
The difference between zen cart 1.5.8 versions and older versions is the difference in language files and comment data.
\includes\languages\lang.english.php and \includes\languages\english.php
Please check the files yourself .
When creating the stripe module, comments are added in the session ($_SESSION['order_add_comment']) because zen cart versions 1.5.7 cannot retain the comment content from the checkout payment page to the checkout confirmation page.
added files are as follows.
\includes\modules\pages\checkout_payment\header.php.php
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_payment_default.php
Okay, I uninstalled stripe from Zen
removed previous files
uploaded files from stripe 1.5.7d
doubled checked uploaded files
Went to Zen Payment module screen.
Now it shows: Stripe Payments : Credit Card , So that problem is resolved
But when I click +Install Module
I get an error page:
WARNING: An Error occurred, please refresh the page and try again.If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
How do I fix this?
I restored the Zen database from 7 days earlier, that surprisingly did not fix the issue
PHP Fatal error: 1064:You have an error in your SQL syntax; near '(id INT(11) AUTO_INCREMENT PRIMARY KEY,customers_id INT(11),Stripe_Customers_...' at line 1 :: CREATE TABLE zen_ stripe(id INT(11) AUTO_INCREMENT PRIMARY KEY,customers_id INT(11),Stripe_Customers_id VARCHAR(32)) ==> (as called by) /path/includes/modules/payment/stripe.php on line 216
I notice that above there is a space in "zen_ stripe"
Line 216 of stripe.php:
Should there be a space after the " before stripe( above?PHP Code:
$db-> execute("CREATE TABLE " . DB_PREFIX . " stripe(id INT(11) AUTO_INCREMENT PRIMARY KEY,customers_id INT(11),Stripe_Customers_id VARCHAR(32))");
Comparing it to the stripe 1.5.8, the space is not there
I removed the space,.... that was the issue. How can I be the first to find this older typo?
Zen v1.5.7c
PHP 7.4
On the Zen checkout page customers currently see:
Attachment 20823
How can I show an image instead of the text "Stripe Payments : Credit Card", just like is done for PayPal?
Might not be the first one to notice it >.>: https://www.zen-cart.com/showthread....12#post1404512
I think the edit was put in too late for Gozzandres but will definitely be in the next upload.
Regarding the Payment methods selected in Stripe's dashboard, not all will appear at checkout depending on the user. For example, you might have Apple pay and google pay enabled, but they don't show up at checkout, apparently because the user's browser has nothing indicating they use these payment services.
But why not display them anyway? I asked Stripe's AI how to force this, and was told:
To force a payment method to appear, you can make a minor modification in the Stripe module
Does anyone know what this modification would be?
Zen V1.5.7c
PHP: 7.4
In Test mode, Zen order transactions complete without error. At Stripe, the dashboard shows the transaction and its marked as "Succeeded", but the customer data fields are blank.
I have tried 4 separate test transactions, all are missing the customer data, as shown below.
Captured from Stripe Dashboard --> Transactions
Attachment 20825
The data is captured in Zen Orders correctly
.
When not in test mode, the name and email were filled transferred to stripe dashboard. So perhaps this issue is just related to test mode
Zen: 1.5.7c
PHP 7.4
I installed the stripe payment module and now PayPal Express has been impaired
on the 3rd/final checkout page, no sub total, shipping, sales tax, and Total is shown for PayPal.
The issue is the /includes/templates/template_default/templates/tpl_checkout_confirmation_default.php file
It has a section of original code commented out.
If I remove the comments, the sub total, shipping, sales tax, and Total return for PayPal
The issue is this command at line 164 is commented out and needed for PayPal:
If it is put back, it fixes PayPal, but causes Stripe to print the sub total, shipping, sales tax, and Total twice.PHP Code:
$order_totals = $order_total_modules->process();
ANYONE?
The reason is the low order fee.
Normally, for payments such as Paypal, customer information and payment price are sent after pressing the "confirmation order" button in checkout confirmation.
This Stripe module sends customer information and payment price when customer press the "continue" button in Checkout payment.
Therefore, Low order fee will not be added to $order->info['total'] at checkout payment.
\www\includes\modules\payment\stripe.php Lines 150-154 Checkout payment screen"Your Total" used for the payment price.
By executing lines 150-154, Sub-total, Per Item, and Total will be displayed twice on the checkout confirmation screen, so I prevent them from being displayed twice on checkout_confirmation.
If you do not use Low order fee, the solution is simple, just modify the code below.
\www\includes\modules\payment\stripe.php 150-154
toPHP Code:
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
$c = count($order_totals);
$c -= 1;
$order_value = $order_totals[$c]['value'];
} else{
$order_value = $order->info['total'];
}
www\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default .php 158-165PHP Code:
$order_value = $order->info['total'];
toPHP Code:
/*
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
?>
<?php
}
*/
**If anyone has any other ideas, please let me know.**PHP Code:
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
?>
<div id="orderTotals"><?php $order_total_modules->output(); ?></div>
<?php
}
Nihon Yokane corporation
What is the "Low order fee"?
Isn't that last change duplicated at line 173?...which is apparently why it was commented out (162-169)
Sorry, you are right.
following code is duplicated. Please erase the code.
<div id="orderTotals"><?php $order_total_modules->output(); ?></div>
and This statement is also incorrect.
\www\includes\modules\payment\stripe.php 150-154
Correct statement is as followsPHP Code:
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
$c = count($order_totals);
$c -= 1;
$order_value = $order_totals[$c]['value'];
} else{
$order_value = $order->info['total'];
}
This code can support low order fees.
PHP Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
$order_value = $order->info['total'] + MODULE_ORDER_TOTAL_LOWORDERFEE_FEE ;
} else{
$order_value = $order->info['total'];
}
It will be reflected in the next update.
includes\modules\payment\stripe.php
PHP Code:
<?php
/**
*
* @copyright Copyright 2003-2022 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: brittainmark 2022 Sep 10 Modified in v1.5.8 $
*/
class stripe extends base {
/**
* $_check is used to check the configuration key set up
* @var int
*/
protected $_check;
/**
* $code determines the internal 'code' name used to designate "this" payment module
* @var string
*/
public $code;
/**
* $description is a soft name for this payment method
* @var string
*/
public $description;
/**
* $email_footer is the text to me placed in the footer of the email
* @var string
*/
public $email_footer;
/**
* $enabled determines whether this module shows or not... during checkout.
* @var boolean
*/
public $enabled;
/**
* $order_status is the order status to set after processing the payment
* @var int
*/
public $order_status;
/**
* $title is the displayed name for this order total method
* @var string
*/
public $title;
/**
* $sort_order is the order priority of this payment module when displayed
* @var int
*/
public $sort_order;
// class constructor
function __construct() {
global $order;
$this->code = 'stripe';
$this->title = MODULE_PAYMENT_STRIPE_TEXT_TITLE;
$this->description = MODULE_PAYMENT_STRIPE_TEXT_DESCRIPTION;
$this->sort_order = defined('MODULE_PAYMENT_STRIPE_SORT_ORDER') ? MODULE_PAYMENT_STRIPE_SORT_ORDER : null;
$this->enabled = (defined('MODULE_PAYMENT_STRIPE_STATUS') && MODULE_PAYMENT_STRIPE_STATUS == 'True');
if (null === $this->sort_order) return false;
if (IS_ADMIN_FLAG === true && (MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY == '' || MODULE_PAYMENT_STRIPE_SECRET_KEY == '' || MODULE_PAYMENT_STRIPE_PUBLISHABLE_TEST_KEY == '' || MODULE_PAYMENT_STRIPE_SECRET_TEST_KEY == '' )) $this->title .= '<span class="alert"> (not configured - stripe publishable key and secret key)</span>';
if (IS_ADMIN_FLAG === true && (MODULE_PAYMENT_STRIPE_TEST_MODE == 'True')) $this->title .= '<span class="alert"> (Stripe is in testing mode)</span>';
if (IS_ADMIN_FLAG === true && (strpos(MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY,'_test_') !== false ) == true || (strpos(MODULE_PAYMENT_STRIPE_SECRET_KEY,'_test_') !== false ) == true) $this->title .= '<span class="alert"> (Test key entered in API publishable key or secret key )</span>';
if (IS_ADMIN_FLAG === true && (strpos(MODULE_PAYMENT_STRIPE_PUBLISHABLE_TEST_KEY,'_test_') !== false ) == false || (strpos(MODULE_PAYMENT_STRIPE_SECRET_TEST_KEY,'_test_') !== false ) == false) $this->title .= '<span class="alert"> (Test key not entered in the test mode field)</span>';
if ((int)MODULE_PAYMENT_STRIPE_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_STRIPE_STATUS_ID;
}
if (is_object($order)) $this->update_status();
}
// class methods
function update_status() {
global $order, $db,$amount,$payment_currency;
if ($this->enabled && (int)MODULE_PAYMENT_STRIPE_ZONE > 0 && isset($order->billing['country']['id'])) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_STRIPE_ZONE . "' and zone_country_id = '" . (int)$order->billing['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->billing['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
// other status checks?
if ($this->enabled) {
// other checks here
}
}
function javascript_validation() {
return false;
}
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
function pre_confirmation_check() {
global $order, $db,$stripeCustomerID,$user_id,$stripe_select,$order_total_modules;
$stripe_select = 'True';
if (MODULE_PAYMENT_STRIPE_TEST_MODE === 'True') {
$publishable_key = MODULE_PAYMENT_STRIPE_PUBLISHABLE_TEST_KEY;
$secret_key = MODULE_PAYMENT_STRIPE_SECRET_TEST_KEY;
$test_mode = true;
}else{
$publishable_key = MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY;
$secret_key = MODULE_PAYMENT_STRIPE_SECRET_KEY;
$test_mode = false;
}
$payment_currency = $order->info['currency'];
$Xi_currency = ['BIF','CLP','DJF','GNF','JPY','KMF','KRW','MGA','PYG','RWF','UGX','VND','VUV','XAF','XOF','XPF'];
$Xiooo_currency = ['BHD','JOD','KWD','OMR','TND'];
if (in_array($payment_currency,$Xi_currency) == true ) {
$multiplied_by = 1;
$decimal_places = 0;
} elseif (in_array($payment_currency,$Xiooo_currency) == true ) {
$multiplied_by = 1000;
$decimal_places = 2;
}else{
$multiplied_by = 100;
$decimal_places = 2;
}
if ( isset($_SESSION['opc_saved_order_total'])) {
$order_value = $_SESSION['opc_saved_order_total'];
}else{
if (MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
$order_value = $order->info['total'] + MODULE_ORDER_TOTAL_LOWORDERFEE_FEE ;
} else{
$order_value = $order->info['total'];
}
}
$amount_total=round($order_value * $order->info['currency_value'],$decimal_places)*$multiplied_by;
$fullname = $order->billing['firstname'].= $order->billing['lastname'];
$email = $order->customer['email_address'];
$user_id = $_SESSION['customer_id'];
$registered_customer = false;
$stripe_customer = $db->Execute("SELECT stripe_customers_id FROM " . TABLE_STRIPE . " WHERE customers_id = '" .$_SESSION['customer_id'] . "' order by id DESC LIMIT 1");
if ($stripe_customer->RecordCount() > 0) {
$registered_customer = true;
}
require_once 'stripepay/create.php' ;
}
function confirmation() {
return false;
}
function process_button() {
return false;
}
function before_process() {
global $order;
$order_comment = $_SESSION['order_add_comment']."\n Stripe ID:";
$order_comment = $order_comment . $_SESSION['paymentIntent'];
$order->info['comments'] = $order_comment;
}
function after_process() {
unset($_SESSION['order_add_comment']);
unset($_SESSION['paymentIntent']);
}
function get_error() {
return false;
}
function check() {
global $db;
if (!isset($this->_check)) {
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_STRIPE_STATUS'");
$this->_check = $check_query->RecordCount();
}
return $this->_check;
}
function install() {
global $db, $messageStack;
if (defined('MODULE_PAYMENT_STRIPE_STATUS')) {
$messageStack->add_session('StMoneyOrder module already installed.', 'error');
zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=stripe', 'NONSSL'));
return 'failed';
}
$db-> execute("DROP TABLE IF EXISTS " . DB_PREFIX . "stripe ;");
$db-> execute("CREATE TABLE " . DB_PREFIX . "stripe(id INT(11) AUTO_INCREMENT PRIMARY KEY,customers_id INT(11),Stripe_Customers_id VARCHAR(32))");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES('Enable Stripe Secure Payment Module', 'MODULE_PAYMENT_STRIPE_STATUS', 'True', 'Do you want to accept Stripe Secure Payment?', 6, 1, NULL, now(), NULL, 'zen_cfg_select_option(array(\'True\', \'False\'), ', NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('API Publishable Key:', 'MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY', '', 'Enter API Publishable Key provided by stripe', 6, 1, NULL, now(), NULL, NULL, NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Sort order of display.', 'MODULE_PAYMENT_STRIPE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', 6, 1, NULL, now(), NULL, NULL, NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Payment Zone', 'MODULE_PAYMENT_STRIPE_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', 6, 1, NULL, now(), 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Set Order Status', 'MODULE_PAYMENT_STRIPE_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', 6, 1, NULL, now(), 'zen_get_order_status_name', 'zen_cfg_pull_down_order_statuses(', NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('API Secret Key:', 'MODULE_PAYMENT_STRIPE_SECRET_KEY', '', 'Enter API Secret Key provided by stripe', 6, 1, NULL, now(), 'zen_cfg_password_display', NULL, NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Test Mode - API Publishable Test Key:', 'MODULE_PAYMENT_STRIPE_PUBLISHABLE_TEST_KEY', '', 'Enter API Publishable Test Key provided by stripe', 6, 1, NULL, now(), NULL, NULL, NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Test Mode - API Secret Test Key:', 'MODULE_PAYMENT_STRIPE_SECRET_TEST_KEY', '', 'Enter API Secret Test Key provided by stripe', 6, 1, NULL, now(), 'zen_cfg_password_display', NULL, NULL)");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Test Mode Stripe Secure Payment Module', 'MODULE_PAYMENT_STRIPE_TEST_MODE', 'True', 'Enter your Stripe API test publishable key and secret key.\r\nNote: Don\'t forget to set it to False after testing.', 6, 1, NULL, now(), NULL, 'zen_cfg_select_option(array(\'True\', \'False\'), ', NULL)");
}
function remove() {
global $db;
$db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_PAYMENT_STRIPE_STATUS', 'MODULE_PAYMENT_STRIPE_TEST_MODE','MODULE_PAYMENT_STRIPE_ZONE', 'MODULE_PAYMENT_STRIPE_STATUS_ID', 'MODULE_PAYMENT_STRIPE_SORT_ORDER', 'MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY','MODULE_PAYMENT_STRIPE_SECRET_KEY','MODULE_PAYMENT_STRIPE_PUBLISHABLE_TEST_KEY','MODULE_PAYMENT_STRIPE_SECRET_TEST_KEY');
}
}
includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.php
PHP Code:
<?php
/**
* Page Template
*
* Loaded automatically by index.php?main_page=checkout_confirmation.
* Displays final checkout details, cart, payment and shipping info details.
*
* @copyright Copyright 2003-2023 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Steve 2023 Feb 23 Modified in v1.5.8a $
*/
?>
<div class="centerColumn" id="checkoutConfirmDefault">
<h1 id="checkoutConfirmDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if ($messageStack->size('redemptions') > 0) echo $messageStack->output('redemptions'); ?>
<?php if ($messageStack->size('checkout_confirmation') > 0) echo $messageStack->output('checkout_confirmation'); ?>
<?php if ($messageStack->size('checkout') > 0) echo $messageStack->output('checkout'); ?>
<div id="checkoutBillto" class="back">
<h2 id="checkoutConfirmDefaultBillingAddress"><?php echo HEADING_BILLING_ADDRESS; ?></h2>
<?php if (!$flagDisablePaymentAddressChange) { ?>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<?php } ?>
<address><?php echo zen_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></address>
<h3 id="checkoutConfirmDefaultPayment"><?php echo HEADING_PAYMENT_METHOD; ?></h3>
<h4 id="checkoutConfirmDefaultPaymentTitle"><?php echo $payment_title; ?></h4>
<?php
if ($credit_covers === false && is_array($payment_modules->modules)) {
if ($confirmation = $payment_modules->confirmation()) {
?>
<div class="important"><?php echo $confirmation['title']; ?></div>
<?php
}
?>
<div class="important">
<?php
for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
?>
<div class="back"><?php echo $confirmation['fields'][$i]['title']; ?></div>
<div ><?php echo $confirmation['fields'][$i]['field']; ?></div>
<?php
}
?>
</div>
<?php
}
?>
<br class="clearBoth">
</div>
<?php
if ($_SESSION['sendto'] != false) {
?>
<div id="checkoutShipto" class="forward">
<h2 id="checkoutConfirmDefaultShippingAddress"><?php echo HEADING_DELIVERY_ADDRESS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . $editShippingButtonLink . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<address><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></address>
<?php
if ($order->info['shipping_method']) {
?>
<h3 id="checkoutConfirmDefaultShipment"><?php echo HEADING_SHIPPING_METHOD; ?></h3>
<h4 id="checkoutConfirmDefaultShipmentTitle"><?php echo $order->info['shipping_method']; ?></h4>
<?php
}
?>
</div>
<?php
}
?>
<br class="clearBoth">
<hr>
<h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<div><?php echo (empty($order->info['comments']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['comments'])) . zen_draw_hidden_field('comments', $order->info['comments'])); ?></div>
<br class="clearBoth">
<hr>
<h2 id="checkoutConfirmDefaultHeadingCart"><?php echo HEADING_PRODUCTS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<br class="clearBoth">
<?php if ($flagAnyOutOfStock) { ?>
<?php if (STOCK_ALLOW_CHECKOUT == 'true') { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
<?php } else { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
<?php } //endif STOCK_ALLOW_CHECKOUT ?>
<?php } //endif flagAnyOutOfStock ?>
<table id="cartContentsDisplay">
<tr class="cartTableHeading">
<th scope="col" id="ccQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
<th scope="col" id="ccProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
<?php
// If there are tax groups, display the tax columns for price breakdown
if (sizeof($order->info['tax_groups']) > 1) {
?>
<th scope="col" id="ccTaxHeading"><?php echo HEADING_TAX; ?></th>
<?php
}
?>
<th scope="col" id="ccTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
</tr>
<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
<tr class="<?php echo $order->products[$i]['rowClass']; ?>">
<td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
<td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
<?php if (!empty($stock_check[$i])) echo $stock_check[$i]; ?>
<?php // if there are attributes, loop thru them and display one per line
if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
echo '<ul class="cartAttribsList">';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
?>
<li>
<?php
echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
?>
</li>
<?php
} // end loop
echo '</ul>';
} // endif attribute-info
?>
</td>
<?php // display tax info if exists ?>
<?php if (sizeof($order->info['tax_groups']) > 1) { ?>
<td class="cartTotalDisplay">
<?php echo zen_display_tax_value($order->products[$i]['tax']); ?>%</td>
<?php } // endif tax info display ?>
<td class="cartTotalDisplay">
<?php echo $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
if ($order->products[$i]['onetime_charges'] != 0 ) echo '<br> ' . $currencies->display_price($order->products[$i]['onetime_charges'], $order->products[$i]['tax'], 1);
?>
</td>
</tr>
<?php } // end for loopthru all products ?>
</table>
<hr>
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
?>
<div id="orderTotals"><?php $order_total_modules->output(); ?></div>
<?php
}
?>
<!--------stripe-------->
<!-- Display a payment form -->
<form id="payment-form">
<div id="payment-head" style="color: #2254dd; font-size: 24px; font-weight: bold; margin:24px 0 12px;">Stripe</div>
<div id="payment-element">
<!--Stripe.js injects the Payment Element-->
</div>
<div id="payment-message" class="hidden"></div>
<button id="submit">
<div class="spinner hidden" id="spinner"></div>
<span id="button-text"><?php echo BUTTON_CONFIRM_ORDER_ALT; ?></span>
</button>
</form>
<!--------end-stripe-------->
<?php
echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
if ($credit_covers === false && is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"') ;?></div>
</form>
<div class="buttonRow back"><?php echo '<strong>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</strong>' . '<br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>
</div>
<!--------stripe-------->
<script>
if (typeof clientS === 'undefined') {
document.getElementById('btn_submit').display ="block";
document.getElementById('checkout_confirmation').display ="block";
document.getElementById('payment-form','submit').style.display ="none";
}else{
document.getElementById('btn_submit').style.display ="none";
document.getElementById('checkout_confirmation').style.display ="none";
document.getElementById('payment-form','submit').display ="block";
}
</script>
<!--------end-stripe-------->
Paste following code from line 169
PHP Code:
<!--------stripe-------->
<!-- Display a payment form -->
<form id="payment-form">
<div id="payment-head" style="color: #2254dd; font-size: 24px; font-weight: bold; margin:24px 0 12px;">Stripe</div>
<div id="payment-element">
<!--Stripe.js injects the Payment Element-->
</div>
<div id="payment-message" class="hidden"></div>
<button id="submit">
<div class="spinner hidden" id="spinner"></div>
<span id="button-text"><?php echo BUTTON_CONFIRM_ORDER_ALT; ?></span>
</button>
</form>
<!--------end-stripe-------->
Paste this code below the last line.
PHP Code:
<!--------stripe-------->
<script>
if (typeof clientS === 'undefined') {
document.getElementById('btn_submit').display ="block";
document.getElementById('checkout_confirmation').display ="block";
document.getElementById('payment-form','submit').style.display ="none";
}else{
document.getElementById('btn_submit').style.display ="none";
document.getElementById('checkout_confirmation').style.display ="none";
document.getElementById('payment-form','submit').display ="block";
}
</script>
<!--------end-stripe-------->
I pasted both those segments over the existing stripe 1.5.7d segments. Now both PayPal and Stripe no longer show Sub Total, Tax, Total on the final checkout page
I also tried the complete file sourced from 1.5.8, expecting it to fail, the PayPal was fixed, but the Stripe had duplicated Sub Total, Tax, Total on the final checkout page
Check you template select.
and following codes are for ver zen cart 157c template_default
PHP Code:
<?php
/**
* Page Template
*
* Loaded automatically by index.php?main_page=checkout_confirmation.<br />
* Displays final checkout details, cart, payment and shipping info details.
*
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: DrByte 2020 Oct 19 Modified in v1.5.7a $
*/
?>
<div class="centerColumn" id="checkoutConfirmDefault">
<h1 id="checkoutConfirmDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if ($messageStack->size('redemptions') > 0) echo $messageStack->output('redemptions'); ?>
<?php if ($messageStack->size('checkout_confirmation') > 0) echo $messageStack->output('checkout_confirmation'); ?>
<?php if ($messageStack->size('checkout') > 0) echo $messageStack->output('checkout'); ?>
<div id="checkoutBillto" class="back">
<h2 id="checkoutConfirmDefaultBillingAddress"><?php echo HEADING_BILLING_ADDRESS; ?></h2>
<?php if (!$flagDisablePaymentAddressChange) { ?>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<?php } ?>
<address><?php echo zen_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'); ?></address>
<?php
$class =& $_SESSION['payment'];
?>
<h3 id="checkoutConfirmDefaultPayment"><?php echo HEADING_PAYMENT_METHOD; ?></h3>
<h4 id="checkoutConfirmDefaultPaymentTitle"><?php echo $GLOBALS[$class]->title; ?></h4>
<?php
if (is_array($payment_modules->modules)) {
if ($confirmation = $payment_modules->confirmation()) {
?>
<div class="important"><?php echo $confirmation['title']; ?></div>
<?php
}
?>
<div class="important">
<?php
for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
?>
<div class="back"><?php echo $confirmation['fields'][$i]['title']; ?></div>
<div ><?php echo $confirmation['fields'][$i]['field']; ?></div>
<?php
}
?>
</div>
<?php
}
?>
<br class="clearBoth" />
</div>
<?php
if ($_SESSION['sendto'] != false) {
?>
<div id="checkoutShipto" class="forward">
<h2 id="checkoutConfirmDefaultShippingAddress"><?php echo HEADING_DELIVERY_ADDRESS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . $editShippingButtonLink . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<address><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
<?php
if ($order->info['shipping_method']) {
?>
<h3 id="checkoutConfirmDefaultShipment"><?php echo HEADING_SHIPPING_METHOD; ?></h3>
<h4 id="checkoutConfirmDefaultShipmentTitle"><?php echo $order->info['shipping_method']; ?></h4>
<?php
}
?>
</div>
<?php
}
?>
<br class="clearBoth" />
<hr />
<h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<div><?php echo (empty($order->info['comments']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['comments'])) . zen_draw_hidden_field('comments', $order->info['comments'])); ?></div>
<br class="clearBoth" />
<hr />
<h2 id="checkoutConfirmDefaultHeadingCart"><?php echo HEADING_PRODUCTS; ?></h2>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
<br class="clearBoth" />
<?php if ($flagAnyOutOfStock) { ?>
<?php if (STOCK_ALLOW_CHECKOUT == 'true') { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
<?php } else { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
<?php } //endif STOCK_ALLOW_CHECKOUT ?>
<?php } //endif flagAnyOutOfStock ?>
<table id="cartContentsDisplay">
<tr class="cartTableHeading">
<th scope="col" id="ccQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
<th scope="col" id="ccProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
<?php
// If there are tax groups, display the tax columns for price breakdown
if (sizeof($order->info['tax_groups']) > 1) {
?>
<th scope="col" id="ccTaxHeading"><?php echo HEADING_TAX; ?></th>
<?php
}
?>
<th scope="col" id="ccTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
</tr>
<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
<tr class="<?php echo $order->products[$i]['rowClass']; ?>">
<td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
<td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
<?php if (!empty($stock_check[$i])) echo $stock_check[$i]; ?>
<?php // if there are attributes, loop thru them and display one per line
if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
echo '<ul class="cartAttribsList">';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
?>
<li>
<?php
echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
?>
</li>
<?php
} // end loop
echo '</ul>';
} // endif attribute-info
?>
</td>
<?php // display tax info if exists ?>
<?php if (sizeof($order->info['tax_groups']) > 1) { ?>
<td class="cartTotalDisplay">
<?php echo zen_display_tax_value($order->products[$i]['tax']); ?>%</td>
<?php } // endif tax info display ?>
<td class="cartTotalDisplay">
<?php echo $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
if ($order->products[$i]['onetime_charges'] != 0 ) echo '<br /> ' . $currencies->display_price($order->products[$i]['onetime_charges'], $order->products[$i]['tax'], 1);
?>
</td>
</tr>
<?php } // end for loopthru all products ?>
</table>
<hr />
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
?>
<div id="orderTotals"><?php $order_total_modules->output(); ?></div>
<?php
}
?>
<!--------stripe-------->
<!-- Display a payment form -->
<form id="payment-form">
<div id="payment-head" style="color: #2254dd; font-size: 24px; font-weight: bold; margin:24px 0 12px;">Stripe</div>
<div id="payment-element">
<!--Stripe.js injects the Payment Element-->
</div>
<div id="payment-message" class="hidden"></div>
<button id="submit">
<div class="spinner hidden" id="spinner"></div>
<span id="button-text"><?php echo BUTTON_CONFIRM_ORDER_ALT; ?></span>
</button>
</form>
<!--------end-stripe-------->
<?php
echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
if (is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
?>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"') ;?></div>
</form>
<div class="buttonRow back"><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '<br />' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>
</div>
<!--------stripe-------->
<script>
if (typeof clientS === 'undefined') {
document.getElementById('btn_submit').display ="block";
document.getElementById('checkout_confirmation').display ="block";
document.getElementById('payment-form','submit').style.display ="none";
}else{
document.getElementById('btn_submit').style.display ="none";
document.getElementById('checkout_confirmation').style.display ="none";
document.getElementById('payment-form','submit').display ="block";
}
</script>
<!--------end-stripe-------->
I just replaced the contents of tpl_checkout_confirmation_default.php with that which you posted, and the results were the same. PayPal good, Stripe Sub total, tax, total, duplicated
I'm using the Responsive Classic template.
Same result as using the 1.5.8 version. What was interesting about the 1.5.8 version was it seemed to function without throwing PHP errors. Would you expect the 1.5.8 version of tpl_checkout_confirmation_default.php to operate correctly on version 1.5.7c?
I just did a file compare of the contents you just posted against the original file in Stripe_module_zc157d. They are identical
So I'm now confused.
Download from github.com.
The moule for zen cart 1.5.7c is included.
zencart-stripe-module_217
Be careful "mysql_upgrade_to_2.1.7" should be install before over writing the files at Admin=>Tools=>Install SQL patches.
Niho Yokane corporation
I updated the files from github. It was not until I replaced the \includes\modules\payment\stripe.php, that both PayPal and Stripe now show the final checkout page correctly.
I'll need to do more testing to be sure.
However, in stripe test mode, at the stripe dashboard, orders were coming in $5 more than they should have
Checking the "low order fee" module, the low order fee was set to false, but the fee amount was set to $5. Setting this to $0 solved the additional $5 at the stripe dashboard
Attachment 20829
Thanks!!
Change the following code
www\includes\modules\payment\stripe.php line 150
from
toPHP Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
:blush:PHP Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
I've fixed the file.
zencart-stripe-module_218
Nihon Yokane corporation
is there any way you can spend a bit of time learning github?
posting a zip file with all of the files within it is not the best way to make use of a collaborative tool such as github.
all of the files should be up on a repo, and then you can do releases where git will automatically create a zip file for you.
i would suggest learning git on the terminal mode.
the limitation you are talking about is for the graphical interface.
https://docs.github.com/en/get-start...git/set-up-git
https://stackoverflow.com/questions/...once-in-github
Have been using PayPal for years...only. PayPal claims to charge 2.9% +.30, but its always about 4%. Then there are the customers that email and plead for something other than PayPal. We tried Zelle for a while, but too much hassle always dealing with customers that selected it, but did not know what to do next. PayPal's dispute resolution, never sides with the seller, unless its painfully obvious.
A customer can send an empty box back as part of a return, and PayPal will side with the customer. A customer could smash the product with a hammer and return the bits, and PayPal would side with the customer
Now with Stripe, we have several payment options, and I have been checking, it is 2.9% + .30. Damn, we should have switched long ago.
One warning, not all available payment options are 2.9%. Make sure you know what the fees are before enabling a payment option.
Stirpe has AI help, which is faster than a real person. Just ask the AI what the fees are for a particular payment option.
No disputes yet....we will see how that goes
I've made available for download.
https://github.com/Gozzandes/stripe_modules_218
Nihon Yokane corporation
We had a customer place an order with Visa. It is listed as "Succeeded" on Stripe, but no order in Zen. A few minutes later, the customer altered his order and then used Link to Pay, which was also "Succeeded". This 2nd order was received in Zen. The customer brought this to our attention claiming he was double charged....
How can a transaction succeed at Stripe but not show up in Zen?:excl:
Looking into it further, the Visa is listed as originating from South Africa. The Link transaction, is in USD and was shipped to a USA address.
I hesitate to refund the Visa order as it feels like it could be a Scam of some sort...some loophole in Stripe.
Payment succeeded information is sent from Stripe server after clicking "Confirmation" button.
and
includes/checkout.js receive the information and show payment succeeded message and click order confirmation page button.
line 48-50 and 69-71
It may be better to click first the order confirmation page button.
from
toCode:document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
Code:document.getElementById("btn_submit").click();
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
When I mentioned "It is listed as "Succeeded" on Stripe", I mean the Stripe website dashboard, not what the customer sees at checkout, though that may be an issue also.
I just received another duplicate on Stripe. According to the Stripe Dashboard, two exactly the same orders received 1 minute apart. Again, only one shows up in Zen, and its again the 2nd order shown on Stripe. So the 1st order shown on Stripe is the phantom....how can we stop this from happening?
The session may be disconnected after clicking confirmation button. and the customers are forced to log of from thier checkoutpage.
As a resut the last confirmation page is not displayed. and sometimes displayed.
The entire site is SSL. Please note that I have not implemented the potential change:
Waiting to hear that this change is confirmed and will solve the issuePHP Code:
document.getElementById("btn_submit").click();
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
Wouldn't it require an active session to move from checkout page 1 to 2 to 3?
I do see several successful transactions followed within 0 minutes with an "incomplete" transaction from the same customer. The 1st transaction is successful on Stripe dashboard, the 2nd is "incomplete". It is the 2nd incomplete transaction that is captured within Zen
i want to see your checkout.js.
i checked 218module. I found an incorrect code.
from /includes/checkout.js
Code:const stripe = Stripe (PublishableKey);
let elements;
initialize();
checkStatus();
document
.querySelector("#payment-form")
.addEventListener("submit", handleSubmit);
// Fetches a payment intent and captures the client secret
async function initialize(){
const { clientSecret } = await clientS;
// const { clientSecret } =await fetch("/create.php", {
// method: "POST",
// headers: { "Content-Type": "application/json" },
// body: JSON.stringify({ items }),
// }).then((r) => r.json());
elements = stripe.elements({ clientSecret });
const paymentElementOptions = {
layout: "tabs",
};
const paymentElement = elements.create("payment", paymentElementOptions);
paymentElement.mount("#payment-element");
}
async function handleSubmit(e) {
e.preventDefault();
setLoading(true);
const response = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: confirmationURL,
},
redirect: 'if_required'
}
)
if (response.error) {
showMessage(response.error.message);
} else {
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
}
setLoading(false);
}
// Fetches the payment intent status after payment submission
async function checkStatus() {
const clientSecret = new URLSearchParams(window.location.search).get(
"payment_intent_client_secret"
);
if (!clientSecret) {
return;
}
const { paymentIntent } = await stripe.retrievePaymentIntent(clientSecret);
switch (paymentIntent.status) {
case "succeeded":
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
break;
case "processing":
document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment is processing.';
showMessage("Your payment is processing.");
break;
case "requires_payment_method":
document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment was not successful, please try again.';
showMessage("Your payment was not successful, please try again.");
break;
default:
document.getElementById('checkoutConfirmDefaultHeading').textContent='Something went wrong.';
showMessage("Something went wrong.");
break;
}
}
// ------- UI helpers -------
function showMessage(messageText) {
const messageContainer = document.querySelector("#payment-message");
messageContainer.classList.remove("hidden");
messageContainer.textContent = messageText;
setTimeout(function () {
messageContainer.classList.add("hidden");
messageText.textContent = "";
}, 4000);
}
// Show a spinner on payment submission
function setLoading(isLoading) {
if (isLoading) {
// Disable the button and show a spinner
document.querySelector("#submit").disabled = true;
document.querySelector("#spinner").classList.remove("hidden");
document.querySelector("#button-text").classList.add("hidden");
} else {
document.querySelector("#submit").disabled = false;
document.querySelector("#spinner").classList.add("hidden");
document.querySelector("#button-text").classList.remove("hidden");
}
}
Can you erase line 39?
Nihon yokane corporationCode:return_url: confirmationURL,
Ok, I commented out line 39. In test mode I ran a few credit card transactions. They all went fine. Zen captured the orders and Strip dashboard showed successful.
After I click "Confirm Order" on the 3rd checkout page, I also then repeatedly clicked "Confirm Order", as I know my impatient customers do, it did not seem to create any problems
Hello, I have Zen Cart 2.1.0 installed and am trying to get the Stripe Payments Module up and running. I have it installed and connected to my Stripe account. Have it in "Test Mode" but keep gettting hung up going to step 3 of checkout.
I get a blank page with a "WARNING: an error has occured" message.
I have my test keys correctly applied to the module settings... not sure what is making this hang.
This is what the DeBug Log File says... not sure what it's trying to tell me... any input on where to look is appreciated, thanks
[30-Dec-2024 00:11:49 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.xx.x, Language id 1
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:733]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:678]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:307]
#4 queryFactory->Execute() called at [/includes/modules/payment/stripe.php:165]
#5 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#6 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#7 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Fatal error: MySQL error 1146: Table 'xxxx670_zenc936.zenen_stripe' doesn't exist :: SELECT stripe_customers_id FROM zenen_stripe WHERE customers_id = '2' order by id DESC LIMIT 1 ==> (as called by) /includes/modules/payment/stripe.php on line 165 <== in /includes/classes/db/mysql/query_factory.php on line 733.
Sql code is
Code:TRUNCATE `zenen_stripe `;
Hello Gozzandes, thank you for helping. I am having an issue trying to get this code to take. I am sending via the "Install SQL Patches" located in the "Tools" tab. I assume this is the correct location to add this?
I keep getting thes message:
WARNING: An Error occurred, please let us know! If you were entering information, press the BAo must be doing something wrong...CK button in your browser and re-check the information you had entered to be sure you entered valid data.
I must be doing something wrong...
'xxxx670_zenc936.zenen_stripe' doesn't exist.
Split63 pointed out.
www/includes/modules/payment/stirpe.php line215
from
toCode:$db-> execute("DROP TABLE IF EXISTS " . DB_PREFIX . "stripe ;");
once uninstall the module in the admin page and rewrite the php file.Code:$db-> execute("DROP TABLE IF EXISTS " . DB_PREFIX . "stripe ;");
and install the module.
You can Download stripe_modules_218https://github.com/Gozzandes/stripe_modules_218
I just wondered if Stripe is okay to use? It has so many bad reviews, mainly money being frozen for no reason and unable to withdraw. I did try Square and got through the validation procedure, but they suddenly stopped my account for no reason. Luckily no payment processing activated at that time, and no response to emails. So a bit wary, so using paypal and a credit card processing company which is fine, the Klarna and other options in Stripe does seem appealing however.
I myself don't use stripe or braintree but you should know that PayPal has had this "money being frozen" thing too (or even still has).
This seems to have fixed the problem. I appreciate your help in this matter.
I was able to make it through all stages of the checkout process in Stripe's test mode. I'll try a few more orders just to make sure the change sticks.
One thing that seems odd... there's no feilds to enter the faux CC #... it simply says Stripe Payment: Credit Card but there is no feilds to input the dummy info... Is this normal for stripe in test mode or is there something else I should address before moving further? Thanks
Here's a screenshot of what I mean... I'm still in "Test Mode" and Stripe is not providing any feilds to input Credit Card info. This can't be correct. I'm thinking there should be a radio button (or something similar) to select that would then provide fields to input the CC info?
API Key and Test API Key is switched by Stripe test mode.
Test Mode = Test mode API Key
Credit card number :4242424242424242
MM/YY :After today for example 01/25
Security code : Random 3 numbers
Attachment 20833
Copy the following folder and paste it to \includes\templates\responsive_classic folder.
Stripe_module_zc158\www\includes\templates\YOUR_TEMPLATE
I recommend to download the following module and upgrade.
github.com/stripe_module_218
My apologies for needing more direction with this whole thing. This is all new to me so I must ask questions...
When I go to the link... am I supposed to click on the green "CODE" button and download the zip file... unpack it and FTP it over to my Zen Cart install to "Upgrade" this module? I did download the latest version of this here at the Zen Cart website but, maybe I'm not using the latest version by doing this... this is a bit confusiong for me.
OK
You should copy following 3 files and paste it to your local disk.
The files are backup.
includes\checkout.js
includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.php
includes\modules\payment\stripe.php
and upload the above three files in the stripe-module_218 folder via FTP.
If it doesn't work, just overwrite the backup.
Zen: 1.5.7c
I had a customer claim the following today:
"Trying to pay with cash app and it's not launching the app"
We have received a few Cash App payments in the past, but not many. Not sure if this is a real problem or not. I have never used Cash App.
There does appear to be a problem cash app.
Here is the Strip checkout with an apparently configuration issue:
Attachment 20836
I know the reason of the problem and I am fixing the module.
In the case of PayPal, etc., this problem occurred because create.php is reloaded to redirect to the confirmation screen after the payment was completed.
But I resolved the problems.
and Now I'm checking.
Following files are fixed.
It may be fine.
1. checkout.js
2. includes\modules\pages\checkout_payment\javascript_stripe.php
3. includes\modules\payment\stripe.php
4. includes\templates\responsive_classic\templates\tpl_checkout_confirmation_defaul t.php
But today is 2025 new Year-day.
Could you wait 2days or 3days?
I have tried this.. unfortunately I'm still experiencing the same issue... there are no feilds showing to enter CC info during checkout. I have the site in "Test Mode" and my Stripe account is in Test Mode... the Stripe API test keys are entered in the module correctly.
I have the stripe_module_zc201 version installed on a Zen Cart 2.1.0 website.
Not sure what to do. Any other suggestions?
Stripe form is displayed after receiving client secret(clientS) from stripe server so far.
This is the problem.
Following code receive from stripe directly.
checkout.js Restoring line 39 OK
I'll upload revised module to github.com tomorrow as a version 219
checkout.js Restoring line 39 and
stripe.php line167
from
toPHP Code:
require_once 'stripepay/create.php' ;
PHP Code:
if ($_SESSION['paymentIntent'] == '' ){
require_once 'stripepay/create.php' ;
}
tpl_checkout_confirmation_default line194
tpl_checkout_one_confirmation_default line235
PHP Code:
<script>
if (typeof clientS === null) {
PHP Code:
<?php
$jason_stripe_select = json_encode($stripe_select);
?>
<script>
var stripe_select = JSON.parse('<?php echo $jason_stripe_select; ?>');
if (stripe_select === "True") {
and add a file in the following folder.
\includes\modules\pages\checkout_payment
file name is jscript_stripe.php
The contents of the file are as follows
PHP Code:
<?php
if ( isset($_SESSION['paymentIntent'])){
$_SESSION['paymentIntent'] = '';
}
?>
I've uploaded stripe module ver 219 to github.com.
You can download following link.
stripe module 219 for zen cart
When you upgrade your module, overwrite following 4 files and add jscript_stripe.php.
\includes\checkout.js
\includes\modules\payment\stripe.php
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
\includes\modules\pages\checkout_payment\jscript_stripe.php
I recommend
The module should be test using local computer with Xampp before uploading to live site.
I've uploaded stripe module ver 219 to github.com.
You can download following link.
Link of Previous message is different.
stripe module 219 for zen cart
When you upgrade your module, overwrite following 4 files and add jscript_stripe.php.
\includes\checkout.js
\includes\modules\payment\stripe.php
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
\includes\modules\pages\checkout_payment\jscript_stripe.php
I recommend
The module should be test using local computer with Xampp before uploading to live site.
Nihon yokane corporation
I build a demo shop in my computer and tested it.
First of all, the issue of the duplicate order issue had been resolved in version 218. Also, BigB's problem was caused by not overwriting checkout_confirmation_default.php for this module in the template folder.
split63's problem was double payments with PayPal etc.
It was caused by moving from checkout_confirmation page to Paypal payment page,
and then when returning to checkout_confirmation page, the browser re-loads the create.php(modules\stripepay\create.php) again.
The checkout_confirmation page (returning URL)is specified in includes\checkout.js return_url, the problem occurs when create.php is re-executed when returning to checkout_confirmation page.
so I fixed it that create.php is not executed when checkout_confirmation page is reloaded.
I was not able to actual test with PayPal, I checked it by reloading (F5 key) the checkout_confirmation page in my computer's browser.
2.1.9 Stripe_module_zc157c installed
Both Stripe and PayPal seem okay.
I ran a few test credit card orders thru stripe, all went okay. Once I hit the "continue" button on the 3rd checkout page, I then rapid clicked the "continue" button to see if I can create a duplicate order. It briefly displays "A processing error occurred." to the left of the "continue" button, but the order completes and there is no duplicate charge at stripe or at Zen.
However, directly after I click "continue" the first time, I see this text displayed to the left of the "continue" button: "TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED". That seems odd.
All this is on my duplicate test site. I have yet to role it into my live site. :cheers:
Everything seem to be OK without "TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED" message.
Open the page.
Admin page=>Tools=>SQL Query Executor
and paste following code to "Enter the query to be executed:" field and push "Send" button.
or upload mysql_upgrade_to_2.1.7.sql.PHP Code:
insert into configuration (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`, `val_function`) VALUES
('Payment Succeeded Message:', 'TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED', 'Payment succeeded. Please wait a few seconds!', 'The message will be displayed after payment succeeded. If you do not want to display it, leave it blank.', 6, 1, NULL, now(), NULL, NULL , NULL);
Go to Modules=>Payment Modules and select Stripe Payments.
Push "Edit" button.
Feel free to enter a message such as "Payment completed!" or "Zahlung erfolgreich!" or "お支払い完了しました!" in the field at the bottom.
When I rolled all this to the live site today, the low order fee issue got me again. I had to set the fee to 0.
It looks like the above did not make it into 2.1.9
I can confirm that the "TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED" message was resolved with the SQL patch
MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE is Allow Low Order Fee.
Translate the code into English.
If you set "Allow Low Order Fee" to true and customer's order under ## dollar.PHP Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
I will add ## dollar to total as a low order fee.
If you do not want to add low order fee, you should set "Allow Low Order Fee" to false.
With 2.1.9 installed for Zen 1.5.7c I just got another duplicate order.
This time it was a Link payment. The two orders are 3 minutes apart. Only the 2nd Link Payment shows in Zen as an order.
Attachment 20851
I contacted the customer to see if they had any insight into the Link Payment duplication
"I was called away while ordering and when I returned to finish the order the session had expired so I logged back in to finish"
How can the session expire in this situation in 3 minutes?
I have never used Link, so at checkout it does not show as an option. So I'm not clear what the customer sees or how a link payment can process without a Zen order being created
The customer claims he was called away for about 45 minutes. So the 1st and 2nd Stripe payments must have occurred when the customer returned, and the duplication was somehow put in motion by the Zen session timeout which perhaps occurred for Zen but not Stripe? :frusty:
Thank you for reporting the problem
When disconnected the Zen cart session, redirect to the time out page.
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p line 197 -216
from
PHP Code:
<!--------stripe-------->
<?php
$jason_stripe_select = json_encode($stripe_select);
?>
<script>
var stripe_select = JSON.parse('<?php echo $jason_stripe_select; ?>');
if (stripe_select === "True") {
document.getElementById('btn_submit').style.display ="none";
document.getElementById('checkout_confirmation').style.display ="none";
document.getElementById('payment-form','submit').display ="block";
}else{
document.getElementById('btn_submit').display ="block";
document.getElementById('checkout_confirmation').display ="block";
document.getElementById('payment-form','submit').style.display ="none";
}
</script>
<!--------end-stripe-------->
PHP Code:
<!--------stripe-------->
<?php
$jason_stripe_select = json_encode($stripe_select);
$jason_sess_life = json_encode($SESS_LIFE);
$timeoutURL = '"' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=time_out"';
?>
<script>
var stripe_select = JSON.parse('<?php echo $jason_stripe_select; ?>');
var sess_life = JSON.parse('<?php echo $jason_sess_life; ?>');
var timeoutURL = JSON.parse('<?php echo $timeoutURL; ?>');
if (stripe_select === "True") {
document.getElementById('btn_submit').style.display ="none";
document.getElementById('checkout_confirmation').style.display ="none";
document.getElementById('payment-form','submit').display ="block";
setTimeout(function(){window.location.href = timeoutURL;}, sess_life*1000);
}else{
document.getElementById('btn_submit').display ="block";
document.getElementById('checkout_confirmation').display ="block";
document.getElementById('payment-form','submit').style.display ="none";
}
</script>
<!--------end-stripe-------->
According to Stripe:
To automatically expire unused Checkout Sessions, you can set the expires_at parameter when creating a Checkout Session. This parameter determines the expiration time of the session and can be set to any time between 30 minutes and 24 hours after the session is created. Once a Checkout Session reaches its expiration time without completion, it becomes inaccessible
The default expiration time for Stripe Checkout Sessions is 24 hours
Perhaps the easy fix is to set this parameter to just less than whatever the session time out is for Zen?
I don't see where it is ever set in the stripe code