-
Re: Stripe payment module - Duplicate order
Quote:
Originally Posted by
split63
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
Zen Cart's session timeout is 1440 seconds by default. This is 24 minutes.
Stripe's timeout is between 30 minutes and 24 hours, so the same issue will occur during these 6 minutes.
For this reason, the tpl_checkout_comfirm########.php script is set up to redirect to the time_out page as soon as the Zen Cart session timeout occurs.
If you want to set it on the Stripe side, you can insert "expires_at:" and the timeout time line 37 of checkout.js. (I haven't check this though)
$timeoutURL is Zen cart session time
-
Re: Stripe payment module - Duplicate order
Sorry
$timeoutURL is not Zen cart session expired time.
$SESS_LIFE is Zen cart session expired time.
-
1 Attachment(s)
Re: Stripe payment module -Duplicate orders
Quote:
Originally Posted by
Gozzandes
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
Hi Gozzandes, I have performed this procedure... I am in TEST MODE... have the proper test credentials configured in the module's admin section (admin login area of Zen Cart install)... still have no feilds to enter CC info at Step 2 of 3... or at Step 3 of 3.
It's the same as before and simply states "Payment Type: Credit Card" and nothing more.
Should I FTP the entire 2.1.9 module and simply have it "overwrite" any and all duplicate files? Perhaps this will fix the issue?
Here is a "Debug Log" that was generated after I tried this test order FWIW..
[10-Jan-2025 21:13:56 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.26.5, Language id 1
#1 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#2 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#3 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "paymentIntent" in /includes/modules/payment/stripe.php on line 169.
Attachment 20857
-
2 Attachment(s)
Re: Stripe payment module -Duplicate orders
[QUOTE=BigB;1405241]Hi Gozzandes, I have performed this procedure... I am in TEST MODE... have the proper test credentials configured in the module's admin section (admin login area of Zen Cart install)... still have no feilds to enter CC info at Step 2 of 3... or at Step 3 of 3.
It's the same as before and simply states "Payment Type: Credit Card" and nothing more.
Should I FTP the entire 2.1.9 module and simply have it "overwrite" any and all duplicate files? Perhaps this will fix the issue?
Here is a "Debug Log" that was generated after I tried this test order FWIW..
[10-Jan-2025 21:13:56 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.26.5, Language id 1
#1 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#2 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#3 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "paymentIntent" in /includes/modules/payment/stripe.php on line 169.
Here's an up close pic of what I mean.... I don't get any feilds to enter CC info...
Attachment 20859
-
Re: Stripe payment module -Duplicate orders
[QUOTE=BigB;1405244]
Quote:
Originally Posted by
BigB
Hi Gozzandes, I have performed this procedure... I am in TEST MODE... have the proper test credentials configured in the module's admin section (admin login area of Zen Cart install)... still have no feilds to enter CC info at Step 2 of 3... or at Step 3 of 3.
It's the same as before and simply states "Payment Type: Credit Card" and nothing more.
Should I FTP the entire 2.1.9 module and simply have it "overwrite" any and all duplicate files? Perhaps this will fix the issue?
Here is a "Debug Log" that was generated after I tried this test order FWIW..
[10-Jan-2025 21:13:56 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.26.5, Language id 1
#1 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#2 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#3 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "paymentIntent" in /includes/modules/payment/stripe.php on line 169.
Here's an up close pic of what I mean.... I don't get any feilds to enter CC info...
Attachment 20859
Copy the following files.
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
and paste/overwrite it to
\includes\templates\responsive_classic\templates\tpl_checkout_confirmation_defau lt.ph p
\includes\templates\responsive_classic\templates\tpl_checkout_one_confirmation_d efaul t.php
-
Re: Stripe payment module -Duplicate orders
[QUOTE=Gozzandes;1405246]
Quote:
Originally Posted by
BigB
Copy the following files.
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
and paste/overwrite it to
\includes\templates\responsive_classic\templates\tpl_checkout_confirmation_defau lt.ph p
\includes\templates\responsive_classic\templates\tpl_checkout_one_confirmation_d efaul t.php
OK... will give it a go. Thank you
-
Re: Stripe payment module -Duplicate orders
[QUOTE=Gozzandes;1405246]
Quote:
Originally Posted by
BigB
Copy the following files.
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
and paste/overwrite it to
\includes\templates\responsive_classic\templates\tpl_checkout_confirmation_defau lt.ph p
\includes\templates\responsive_classic\templates\tpl_checkout_one_confirmation_d efaul t.php
This seems to have worked. Now the fields show to enter the faux CC info. I did a test order and everything was showing as it should. Thank you very much for helping. Greatly appreciated :bigups:
I did get this in a Debug Log after doing the test order... not sure if it's a big problem or not:
[11-Jan-2025 19:37:38 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.26.5, Language id 1
#1 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#2 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#3 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "paymentIntent" in /includes/modules/payment/stripe.php on line 169.
-
1 Attachment(s)
Re: Stripe payment module - Triplicate orders
Zen: 1.5.7c
I had to disable Stripe.
Not sure what happened, many stripe payments with no Zen order. And one Triplicate order
I have numbered the failed orders below. Here is the feedback from the customers for each
1. Order changed from $98.94 to $102.24; changed shipping method. notification from cash app for the charge but after I submitted the order it just took me back to the main page
2. Selected Cash App pay, clicked confirm order, says the payment went through, but the items I selected were still in my cart and there was a button saying “confirm order”
3. I remember seeing it pop up on my phone as a charge to my account so I assumed it went thru.
4. No feedback yet
Attachment 20860
-
Re: Stripe payment module - Triplicate orders
[QUOTE=Gozzandes;1405246]
Quote:
Originally Posted by
BigB
Copy the following files.
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_confirmation_default.ph p
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_defaul t.php
and paste/overwrite it to
\includes\templates\responsive_classic\templates\tpl_checkout_confirmation_defau lt.ph p
\includes\templates\responsive_classic\templates\tpl_checkout_one_confirmation_d efaul t.php
[QUOTE=BigB;1405256]
Quote:
Originally Posted by
Gozzandes
This seems to have worked. Now the fields show to enter the faux CC info. I did a test order and everything was showing as it should. Thank you very much for helping. Greatly appreciated :bigups:
I did get this in a Debug Log after doing the test order... not sure if it's a big problem or not:
[11-Jan-2025 19:37:38 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.26.5, Language id 1
#1 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#2 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#3 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "paymentIntent" in /includes/modules/payment/stripe.php on line 169.
I have noticed that on the two test orders I have tried that the payments show as "Pending"... I'm offering digital download products and there is a message that states "NOTE: Downloads are not available until payment has been confirmed".
I would think that payments would be "confirmed" while using test mode but, I don't know for certain. Perhaps there is a setting I need to configure or maybe the Debug Log is pointing to this issue? Any insight or suggestions is greatly appreciated, thanks
-
Re: Stripe payment module - Triplicate orders
#4 just provided this info:
"I kept getting redirected back to the cart after I selected the Amazon Pay without receiving any notice at all. there was no information about if the order payment was denied or anything else.
So, after 2 Amazon attempts, I decided to try my credit card, and I was able to complete the order."
Its as if something changed at Stripe and now Payments other than credit cards, fail to create an order in Zen
-
Re: Stripe payment module - Triplicate orders
[QUOTE=BigB;1405258][QUOTE=Gozzandes;1405246]
Quote:
Originally Posted by
BigB
I have noticed that on the two test orders I have tried that the payments show as "Pending"... I'm offering digital download products and there is a message that states "NOTE: Downloads are not available until payment has been confirmed".
I would think that payments would be "confirmed" while using test mode but, I don't know for certain. Perhaps there is a setting I need to configure or maybe the Debug Log is pointing to this issue? Any insight or suggestions is greatly appreciated, thanks
Following 2 files should be changed
www\includes\modules\pages\checkout_one\jscript_stripe.php
\www\includes\modules\pages\checkout_payment\jscript_stripe.php
from
PHP Code:
<?php
if ( isset($_SESSION['paymentIntent'])){
$_SESSION['paymentIntent'] = '';
}
?>
to
PHP Code:
<?php
$_SESSION['paymentIntent'] = '';
?>
could you check it and reply?
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
split63
#4 just provided this info:
"I kept getting redirected back to the cart after I selected the Amazon Pay without receiving any notice at all. there was no information about if the order payment was denied or anything else.
So, after 2 Amazon attempts, I decided to try my credit card, and I was able to complete the order."
Its as if something changed at Stripe and now Payments other than credit cards, fail to create an order in Zen
When Zen cart session end and Stripe session sill alive.
Stripe payment:Pass
Zen cart: Not pass
When Stripe session end and Zen cart session still alive.
Stripe payment:Not Pass
Zen cart: pass
Even if Zen cart session ended and Stripe session also ended, Stripe "Confirm button" displayed.
and the customers redirect to the front page after pushing the button.
You can check your Zen cart session time in inculdes/functions/sessions.php
line15-31
$SESS_LIFE
Did you rewrite following codes to bottom of the tpl_checkout _confirmation_default.php?
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-------->
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
Gozzandes
Did you rewrite following codes to bottom of the tpl_checkout _confirmation_default.php?
The stripe module is the 2.1.9 release, no changes. This module was essentially working until Jan 10th, then all non credit card payments there after failed to create a Zen Order.
I had not messed with the session issue yet.
inculdes/functions/sessions.php should be that from 1.5.7c unaltered:
PHP Code:
if (IS_ADMIN_FLAG === true) {
$SESS_LIFE = (int)SESSION_TIMEOUT_ADMIN;
// if strict is enabled, must be a max of 900
if (PADSS_ADMIN_SESSION_TIMEOUT_ENFORCED != 0 && $SESS_LIFE > 900) {
$SESS_LIFE = 900;
}
} else {
// read PHP config
$SESS_LIFE = get_cfg_var('session.gc_maxlifetime');
// override if set
if (defined('SESSION_TIMEOUT_CATALOG') && (int)SESSION_TIMEOUT_CATALOG > 120) {
$SESS_LIFE = (int)SESSION_TIMEOUT_CATALOG;
}
// if set toooo short, reset to default
if ((int)$SESS_LIFE < 120) {
$SESS_LIFE = 1440;
This is the code at the bottom of /responsive_classic/templates/tpl_checkout_confirmation_default.php
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-------->
-
Re: Stripe payment module - Triplicate orders
[QUOTE=Gozzandes;1405263][QUOTE=BigB;1405258]
Quote:
Originally Posted by
Gozzandes
Following 2 files should be changed
www\includes\modules\pages\checkout_one\jscript_stripe.php
\www\includes\modules\pages\checkout_payment\jscript_stripe.php
from
PHP Code:
<?php
if ( isset($_SESSION['paymentIntent'])){
$_SESSION['paymentIntent'] = '';
}
?>
to
PHP Code:
<?php
$_SESSION['paymentIntent'] = '';
?>
could you check it and reply?
Ok, I will give it a try and post results when done. Thank you
-
1 Attachment(s)
Re: Stripe payment module - Triplicate orders
[QUOTE=Gozzandes;1405263][QUOTE=BigB;1405258]
Quote:
Originally Posted by
Gozzandes
Following 2 files should be changed
www\includes\modules\pages\checkout_one\jscript_stripe.php
\www\includes\modules\pages\checkout_payment\jscript_stripe.php
from
PHP Code:
<?php
if ( isset($_SESSION['paymentIntent'])){
$_SESSION['paymentIntent'] = '';
}
?>
to
PHP Code:
<?php
$_SESSION['paymentIntent'] = '';
?>
could you check it and reply?
Ok, I was able to change the php file for \www\includes\modules\pages\checkout_payment\jscript_stripe.php
However, I do not have a folder for www\includes\modules\pages\checkout_one
with a jscript_stripe.php file for me to modify.
Is this a folder with files I need to FTP over into my ZC installation?
I did try a test order all the same after making the modifuaction in \www\includes\modules\pages\checkout_payment\jscript_stripe.php
and still get the same message "NOTE: Downloads are not available until payment has been confirmed"
Attachment 20861
-
Re: Stripe payment module - Triplicate orders
[QUOTE=BigB;1405272][QUOTE=Gozzandes;1405263]
Quote:
Originally Posted by
BigB
Ok, I was able to change the php file for
\www\includes\modules\pages\checkout_payment\jscript_stripe.php
However, I do not have a folder for
www\includes\modules\pages\checkout_one
with a
jscript_stripe.php file for me to modify.
Is this a folder with files I need to FTP over into my ZC installation?
I did try a test order all the same after making the modifuaction in
\www\includes\modules\pages\checkout_payment\jscript_stripe.php
and still get the same message "NOTE: Downloads are not available until payment has been confirmed"
Attachment 20861
download ver 2.1.11and overwrite all files.
-
Re: Stripe payment module - Triplicate orders
[QUOTE=Gozzandes;1405275][QUOTE=BigB;1405272]
Quote:
Originally Posted by
Gozzandes
download ver 2.1.11and overwrite all files.
OK, I downloaded version 2.1.11... I'll give it a go. Thank you
-
Re: Stripe payment module - Triplicate orders
you should change the status.
-
Re: Stripe payment module - Triplicate orders
You should change the status after cheking the payment in the admin page.
or change the default order value of setting.
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
Gozzandes
You should change the status after cheking the payment in the admin page.
or change the default order value of setting.
OK... Right now all test orders are "pending". Not sure what they should be changed to... the other choices are processing, delivered or update.
Should this be done before I update the stripe module to version 2.1.11 or after I update the module?
-
Re: Stripe payment module - Triplicate orders
Gozzandes, Sorry that BigB and I are tugging you back and forth, but I wanted to mention that I re-enabled Stripe, but with only Credit Cards enabled....no other changes. So far, every order received has resulted in a Zen Order and a successful stripe payment. Whereas starting on the 10th, none of the non-CC orders had a Zen order, which prompted the initial disabling of Stripe.
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
BigB
OK... Right now all test orders are "pending". Not sure what they should be changed to... the other choices are processing, delivered or update.
Should this be done before I update the stripe module to version 2.1.11 or after I update the module?
Go to admin=>Payment Modules => Stripe Payments => Set Order Status
Change the Set Order Status "default" to "Delivered".
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
Gozzandes
Go to admin=>Payment Modules => Stripe Payments => Set Order Status
Change the Set Order Status "default" to "Delivered".
OK, completed the tasks of updating the module as per your guidance... I then un-installed the module in ZC admin and re-installed it... set the status of the module's admin settings from "default" to "delivered" and added the stripe test credentials.
The entire checkout process worked smooth and flawlessly.
All steps of checkout were seemless with ability to download a digital product after CC info entered and order confirmed during checkout.
Thank you Gozzandes. All of your difection and instruction has been spot on. I greatly appreciate your assistance :cheers:
-
Re: Stripe payment module - Triplicate orders
Something odd that's been happening..when I check on the orders at Stripe every transaction has an additional $5.00 USD charge added to it.
For example: I have a $10.00 test product in the Zen Cart store... when purchasing the product it shows the correct price of $10.00 to be charged in checkout however, when I check the completed transactions back at my Stripe account it is a $15.00 transaction... every test order has this $5.00 added to it. Has anyone else had this issue or know why this may be happening?
I don't knpw if the charge is occuring at Stripe or in Zen Cart.
I have disabled Flat Rate shippping module and there is no shipping/handling fee being applied in the product listing. I'm trying to track down why/how this charge is occuring but have not been able to figure it out yet. Any input or suggestion on where to look and/or what to do is greatly appreciated, thanks
-
1 Attachment(s)
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
BigB
Something odd that's been happening..when I check on the orders at Stripe every transaction has an additional $5.00 USD charge added to it.
For example: I have a $10.00 test product in the Zen Cart store... when purchasing the product it shows the correct price of $10.00 to be charged in checkout however, when I check the completed transactions back at my Stripe account it is a $15.00 transaction... every test order has this $5.00 added to it. Has anyone else had this issue or know why this may be happening?
I don't knpw if the charge is occuring at Stripe or in Zen Cart.
I have disabled Flat Rate shippping module and there is no shipping/handling fee being applied in the product listing. I'm trying to track down why/how this charge is occuring but have not been able to figure it out yet. Any input or suggestion on where to look and/or what to do is greatly appreciated, thanks
This was an issue recently discussed. Its the "Low Order Fee"
Go here and set the "order fee" to $0:
Login to Admin, then Modules --> Order Total , then select "Low Order Fee"
Attachment 20867
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
split63
This was an issue recently discussed. Its the "Low Order Fee"
Go here and set the "order fee" to $0:
Login to Admin, then Modules --> Order Total , then select "Low Order Fee"
Attachment 20867
Thank you split63.This fixed the issue. I don't know how long this would have taken me to find. I greatly appreciate your assistance :bigups:
-
Re: Stripe payment module - Triplicate orders
Gozzandes,
Are you still believing that the issue with non-CC transaction is a session issue?
If so, why are the CC transactions not affected?
I have not had an issue since I turned off all the non-CC payment methods
-
Re: Stripe payment module - Triplicate orders
Quote:
Originally Posted by
split63
Gozzandes,
Are you still believing that the issue with non-CC transaction is a session issue?
If so, why are the CC transactions not affected?
I have not had an issue since I turned off all the non-CC payment methods
I've read stripe documents for developers.
Following code are external payment page for devido.
the codes are redirect to devido page and back to the confirmation page.
if you want to use gcash, following code will be change from extermal_divido to external_gcash.
I have to check it but I do not use Stripe payment in my EC shop.
Code:
elements = stripe.elements({ clientSecret });
Code:
elements = stripe.elements({
clientSecret: clientSecret,
externalPaymentMethodTypes: ['external_divido']
});
Code:
paymentElement.mount("#payment-element");
Code:
paymentElement.mount("#payment-element");
// Track selected payment method
let selectedPaymentMethod;
paymentElement.on('change', (event) => {
selectedPaymentMethod = event?.value?.type;
});
Code:
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);
}
Code:
async function handleSubmit(e) {
if (selectedPaymentMethod === 'external_divido') {
// Redirect customer to the Divido checkout page to complete the transaction
const dividoRedirectUrl = "<< fill the Divido redirect URL here >>";
window.location.href = dividoRedirectUrl;
} else {
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);
}
}
-
Re: Stripe payment module - Duplicate charges, no order
V1.5.7c
Over a week ago, I added the session timeout php changes at the end of the tpl_checkout _confirmation_default.php file.
I tested it and it worked great. While on the 3rd checkout page, when the session expired, the page automatically redirected to the session time out page....which by the way, had some generic text statement which did not apply to my site....so it was good I saw that
I then re-enabled Amazon Pay, Cash App, etc...all the non CC payment options.
Then something strange happened. Everyone was paying with CC. No non-CC payments were coming in. Don't know why.
Finally we got an Amazon Pay today. And it caused a duplicate transaction at Stripe and no order at Zen.
The customer claimed the following:
I was on the 3rd checkout page.
Selected Amazon Pay, and then hit “edit” button, to change my address.
This charged me the first time..
Then when i edited the address and I hit “confirm order” it charged me for second time.
Despite the two charges, no Zen Order was received
-
Re: Stripe payment module - Duplicate charges, no order
The customer goes to the amazon page.
And the customer back to the zen cart page using following code.
But I guess they cannot come back from the amazon page to the zen cart page.
checkout.js 39
Code:
return_url: confirmationURL,
confirmationURL is redirect URL address.
The URL comes from create.php 62
PHP Code:
$confirmationURL = '"' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=checkout_confirmation"';
Can you try following code?
checkout.js 39
Code:
return_url: https://YOUR DOMEIN/index.php?main_page=checkout_confirmation,
-
Re: Stripe payment module - Duplicate charges, no order
Return url is not json encoded.
So script cannot read the PHP return URL
\www\includes\modules\payment\stripepay\create.php line 63
add following code
PHP Code:
$jason_confirmationULR = json_encode($confirmationURL);
and rewrite from
Code:
var confirmationURL = JSON.parse('<?php echo $confirmationURL; ?>');
to
Code:
var confirmationURL = JSON.parse('<?php echo $jason_confirmationULR; ?>');
if it's OK.
could you reply the post?
-
Re: Stripe payment module - Duplicate charges, no order
The customer further clarified, that when the first charge occurred, he never was directed to Amazon, it was if the "Edit" button for address had a similar effect as the "Confirm order" button. He said that after changing the address and clicking "Confirm Order", he was then redirected to Amazon; that's when the 2nd charge occurred.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
Return url is not json encoded.
So script cannot read the PHP return URL
I put the changes on my mirrored test site, which operates in Stripe test mode.
Tried an Amazon Payment
Pressed the "Confirm Order" button and to the left of it appeared this message:
You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.
The transaction appeared on Stripe as "Incomplete"
On Zen, the message disappeared and I remained on the 3rd checkout page as if the "confirm order" button was never pressed
-
1 Attachment(s)
Re: Stripe payment module - Duplicate charges, no order
if you rewrite checkout.jp return_url: confirmationURL, to return_url: https://YOUR DOMEIN/index.php?main_page=checkout_confirmation,
Please revert this code to return_url: confirmationURL,.
I've checked live site using Googlepay.
Payment was made twice, 1st payment is failed and 2nd is succeeded.
And zen cart was also succeeded.
It works everything.
Attachment 20875
-
Re: Stripe payment module - Duplicate charges, no order
Here's the revised create.php code:
PHP Code:
<?php
require 'vendor/autoload.php';
\Stripe\Stripe::setApiKey($secret_key);
try {
global $db,$output,$param_json;
if ($registered_customer == false && $test_mode == false){
$customer = \Stripe\Customer::create([
'email' => $email,
'name' => $fullname,
]);
$stripeCustomerID = $customer->id;
$sql = "INSERT INTO " . TABLE_STRIPE . " (id,customers_id,Stripe_Customers_id) VALUES (NULL,:custID, :stripeCID )";
$sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');
$sql = $db->bindVars($sql, ':stripeCID', $stripeCustomerID, 'string');
$db->Execute($sql);
}elseif ($test_mode == false){
$stripeCustomerID = $stripe_customer->fields['stripe_customers_id'];
}
// Create a PaymentIntent with amount and currency
if ($test_mode == false){
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $amount_total,
'currency' => $payment_currency,
'customer' => $stripeCustomerID,
'automatic_payment_methods' => [
'enabled' => true,
],
]);
}else{
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $amount_total,
'currency' => $payment_currency,
'automatic_payment_methods' => [
'enabled' => true,
],
]);
}
$output = [
'clientSecret' => $paymentIntent->client_secret,
];
$clientS_json = json_encode($output);
} catch (Error $e) {
http_response_code(500);
$clientS_json =json_encode(['error' => $e->getMessage()]);
}
$jason_publishable_key = json_encode($publishable_key);
$jason_PaymentSuccess = json_encode(TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED);
$confirmationURL = '"' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=checkout_confirmation"';
$jason_confirmationURL = json_encode($confirmationURL);
//---comments---
if($order->info['comments']!=""){
$order_add_comment = $order->info['comments'];
$_SESSION['order_add_comment'] = $order_add_comment;
}else{
$_SESSION['order_add_comment'] = "";
}
$_SESSION['paymentIntent'] = $paymentIntent['id'];
//echo $paymentIntent['id'];
//------------
?>
<script>
'use strict';
var clientS = JSON.parse('<?php echo $clientS_json; ?>');
var PublishableKey = JSON.parse('<?php echo $jason_publishable_key; ?>');
var confirmationURL = JSON.parse('<?php echo $jason_confirmationURL; ?>');
var PaymentSuccess = JSON.parse('<?php echo $jason_PaymentSuccess; ?>');
</script>
-
Re: Stripe payment module - Duplicate charges, no order
The first pi number is created through create.php.
The second pi number is created without going through create.php, so I think it is automatically generated by the Stripe server.
Perhaps the first one was for credit card payment, and the second one was created again to redirect to an external site.
Well, that's just my guess.
-
Re: Stripe payment module - Duplicate charges, no order
I'm not clear what changes are needed. Does checkout.jp and create.php need to change?
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
Here's the revised create.php code:
I replaced the contents of create.php with the code you just posted and tried it with Amazon Pay. I did not mess with checkout.jp.
Same issue as before,
I see the message:
You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I'm not clear what changes are needed. Does checkout.jp and create.php need to change?
checkout.js should not be changed, it's should be original line 39 return_url: confirmationURL,.
creat.php line 60 - should be changed
PHP Code:
$jason_publishable_key = json_encode($publishable_key);
$jason_PaymentSuccess = json_encode(TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED);
$confirmationURL = '"' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=checkout_confirmation"';
$jason_confirmationURL = json_encode($confirmationURL);
//---comments---
if($order->info['comments']!=""){
$order_add_comment = $order->info['comments'];
$_SESSION['order_add_comment'] = $order_add_comment;
}else{
$_SESSION['order_add_comment'] = "";
}
$_SESSION['paymentIntent'] = $paymentIntent['id'];
//echo $paymentIntent['id'];
//------------
?>
<script>
'use strict';
var clientS = JSON.parse('<?php echo $clientS_json; ?>');
var PublishableKey = JSON.parse('<?php echo $jason_publishable_key; ?>');
var confirmationURL = JSON.parse('<?php echo $jason_confirmationURL; ?>');
var PaymentSuccess = JSON.parse('<?php echo $jason_PaymentSuccess; ?>');
</script>
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I replaced the contents of create.php with the code you just posted and tried it with Amazon Pay. I did not mess with checkout.jp.
Same issue as before,
I see the message:
You must provide a `return_url` when confirming a PaymentIntent with the payment method type amazon_pay.
following codes are for Amazonpay.
create.php line 34-36 and 42-44
from
PHP Code:
'automatic_payment_methods' => [
'enabled' => true,
],
to
PHP Code:
payment_method_types: ['card', 'amazon_pay'],
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
checkout.js should not be changed, it's should be original line 39 return_url: confirmationURL,.
I compared the source 2.1.9 checkout.js to the file on the test site, they are identical.
Line 39: return_url: confirmationURL,
Quote:
Originally Posted by
Gozzandes
creat.php line 60 - should be changed
The code in the above post #539 is identical to that of post #535. Its what I already have on the test site
-
Re: Stripe payment module - Duplicate charges, no order
post again
following codes are for Amazonpay.
create.php line 34-36 and 42-44
from
PHP Code:
'automatic_payment_methods' => [
'enabled' => true,
],
to
PHP Code:
'payment_method_types' => ['card', 'amazon_pay'],
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
post again
following codes are for Amazonpay.
create.php line 34-36 and 42-44
from
PHP Code:
'automatic_payment_methods' => [
'enabled' => true,
],
to
PHP Code:
'payment_method_types' => ['card', 'amazon_pay'],
Gozzandes, Unfortunately, there is no change. Still the same error message
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Gozzandes, Unfortunately, there is no change. Still the same error message
hmm..
Sorry.
Could you take me time?
-
Re: Stripe payment module - Duplicate charges, no order
Yes, please take your time. I noticed that on the last change, only Amazon now shows up as an payment option other than Credit Cards
-
Re: Stripe payment module - Duplicate charges, no order
Gozzandes,
For clarity, I want you to know that we are still able to receive successful payments via Amazon Pay, Cash App, and others. Issues only seem to occur when they are on the 3rd checkout page and decide to update something about the order.
We don't see this with Credit Card orders.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Gozzandes,
For clarity, I want you to know that we are still able to receive successful payments via Amazon Pay, Cash App, and others. Issues only seem to occur when they are on the 3rd checkout page and decide to update something about the order.
We don't see this with Credit Card orders.
Can you request the log data to the Stripe support?
They have all your transaction log data.
Stripe support
-
1 Attachment(s)
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
Can you request the log data to the Stripe support?
They have all your transaction log data.
I see the log entries for the Amazon Pay that resulted in two charges, but no Zen Order. What specifically are you interested in seeing?
Attachment 20879
-
Re: Stripe payment module - Duplicate charges, no order
Here is the Confirm log for the 1st transaction:
Code:
OST/v1/payment_intents/pi_3QjOvoGCPflMGg4a /confirm
Request ID
HTTP status code
200
Time
Jan 20, 2025, 9:39:36 AM
IP address
181.197.42.233
API version
2024-11-20.acacia
Default
Origin
https://js.stripe.com/
Idempotency key
8669f2fe-6bc9-4cd7-b098xxxxxxxxxxxx
User agent
Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1
API key
Response body
{
"id":
,"object": "payment_intent","amount": 11130,
"amount_details": {
"tip": {},
},
"automatic_payment_methods": {
"allow_redirects": "always","enabled": true,
},"canceled_at": null,"cancellation_reason": null,"capture_method": "automatic_async","client_secret": "pi_3Q**********************_******_*********************bURO","confirmation_method": "automatic","created": 1737394716,"currency": "usd","description": null,"last_payment_error": null,"livemode": true,
"next_action": {
"redirect_to_url": {
"return_url": "https://mysite.com/ZC/index.php?main_page=checkout_confirmation","url": "https://pm-redirects.stripe.com/authorize/acct_1QVctOGCPflM/pa_nonce_RceFloowK3BiBMR6JqjPzTJK ",
},"type": "redirect_to_url",
},"payment_method": ,
"payment_method_configuration_details": {
"id":
,"parent": null,
},
"payment_method_types": [
"card","link","cashapp","amazon_pay",
],"processing": null,"receipt_email": null,"setup_future_usage": null,"shipping": null,"source": null,"status": "requires_action",
}
Request POST body
{
"client_secret": "************************************************************","expected_payment_method_type": "amazon_pay","key": "pk_live_*********************************************************************************************A5jjC3",
"mandate_data": {
"customer_acceptance": {
"online": {
"infer_from_client": "true",
},"type": "online",
},
},
"payment_method_data": {… 8 items},
"radar_options": {
"hcaptcha_token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwY.lNnZUOWtETDdGYVBMZElpcTVYT012LzdRV0ZaQmxBdmQwdnNzREpJY2xpcmszZ...WjhDb2M5Nmt0YnlGYXl3aDVEOGl2aGdFTnpFRFF1K0NZOFFWWHYzR1FWL3Q4Y09hL3B6RHRlUlFJTjFsS0tYUHkrRERaUjZyQy91d3o4aTFBYVp2M083VGlCRUxYbVUxb0xHZWRRTk1BemZHU2lqY3hSTEZ2VUNaM1hTa282a2xoSW1DR2FtQ2Y0RiJ9.maZ__KerJ0R2zIj_WxicBu-foO66iWISHRoQQpWdRr8",
},"return_url": "https://mysite.com/ZC/index.php?main_page=checkout_confirmation",
}
-
Re: Stripe payment module - Duplicate charges, no order
Here is the intent log entry 1st transaction
Code:
POST/v1/payment_intents
Request ID
HTTP status code
200
Time
Jan 20, 2025, 9:38:36 AM
IP address
89.117.9.xxx
API version
2024-11-20.acacia
Default
Idempotency key
a2a726bc-7c30-4cd5-955c-6bec392d30ee
User agent
Stripe/v1 PhpBindings/10.0.0
API key
Response body
{
"id":
,"object": "payment_intent","amount": 11130,"amount_capturable": 0,
"amount_details": {
"tip": {},
},"amount_received": 0,"application": null,"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always","enabled": true,
},"canceled_at": null,"cancellation_reason": null,"capture_method": "automatic_async","client_secret": "pi_3Q**********************_******_*********************bURO","confirmation_method": "automatic","created": 1737394716,"currency": "usd","customer": ,"description": null,"invoice": null,"last_payment_error": null,"latest_charge": null,"livemode": true,"metadata": {},"next_action": null,"on_behalf_of": null,"payment_method": null,
"payment_method_configuration_details": {
"id":
,"parent": null,
},
"payment_method_options": {
"amazon_pay": {
"express_checkout_element_session_id": null,
},
"card": {
"installments": null,"mandate_options": null,"network": null,"request_three_d_secure": "automatic",
},"cashapp": {},
"link": {
"persistent_token": null,
},
},
"payment_method_types": [
"card","link","cashapp","amazon_pay",
],"processing": null,"receipt_email": null,"review": null,"setup_future_usage": null,"shipping": null,"source": null,"statement_descriptor": null,"statement_descriptor_suffix": null,"status": "requires_payment_method","transfer_data": null,"transfer_group": null,
}
Request POST body
{
"amount": "11130",
"automatic_payment_methods": {
"enabled": "true",
},"currency": "USD",
-
Re: Stripe payment module - Duplicate charges, no order
I've received from Stripe staff.
She is requesting me to submit my dashboard screenshot.
'Could you share the screenshot of the dashboard with us via the secure link? I appreciate your efforts in advance.'
Stripe Amazon pay is only USA.
Could you ask about your situation for Stripe staff instead of me?
-
Re: Stripe payment module - Duplicate charges, no order
What part of the dashboard? The home screen? What are they trying to see/confirm?
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
What part of the dashboard? The home screen? What are they trying to see/confirm?
The Stripe staff probably thinks I'm using amazon_pay even though I live in Japan.
That's probably why they're asking for a copy of the dashboard.
Please make some changes to checkout.js.
Could you please put ; on line 43 of checkout.js?
from
Code:
redirect: 'if_required'
}
)
to
Code:
redirect: 'if_required'
}
);
-
Re: Stripe payment module - Duplicate charges, no order
Ever since the 4 duplicate and failed Zen orders, its seems all we get now are credit card orders. Once in a while, we will get a cash app or Amazon, or the like and as long as they hit the 3rd checkout page and actually checkout, there is no issue.
I have tried replicating the failure, but no luck. I suspect it may have something to do with people with cell phones that have cookies which allow them directly into the payment, such as Amazon, without logging in. Just speculating, as I can't replicate their experience.
If the added semicolon corrects the issue, why would we not have seen a syntax error previously ?
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Ever since the 4 duplicate and failed Zen orders, its seems all we get now are credit card orders. Once in a while, we will get a cash app or Amazon, or the like and as long as they hit the 3rd checkout page and actually checkout, there is no issue.
I have tried replicating the failure, but no luck. I suspect it may have something to do with people with cell phones that have cookies which allow them directly into the payment, such as Amazon, without logging in. Just speculating, as I can't replicate their experience.
If the added semicolon corrects the issue, why would we not have seen a syntax error previously ?
The pi number (PaymentIntent) is one for one payment, so even if there are duplicate transactions, there should be only one payment. The first time is pi_3QjO...in the image and the second time is also pi_3QjO these are the same number.
Green [200] is OK.
-
Re: Stripe payment module - Duplicate charges, no order
Life would sure be more interesting and more help/testing could be provided if this were a github repository.:frusty:
-
Re: Stripe payment module - Duplicate charges, no order
We just got a dispute from a customer that ordered using Amazon pay on 1/23. They hit the final checkout page once, and nothing odd about the successful stripe payment. But no order was received in Zen.
We have turned off Amazon Payment. Its used so infrequently, its just not worth it.
-
1 Attachment(s)
Re: Stripe payment module - Duplicate charges, no order
Just discovered a Cash App payment from 2 weeks ago, that shows successful on Stripe, but no order received on Zen. Hit the final check out page only once. Nothing unusual about it...simply no Zen order.
What's even more odd, is it came to my attention, because the customer came back today after never receiving an order notification, and tried the order again. This time, we got the Zen Order, but his Cash App Payment attempt shows "Incomplete" and "Action Required"
But we will now use his previous payment combined with his now successful Zen order to complete his order.
We have now disabled both Cash App and Amazon Pay, just can't trust either.
This is the stripe screen capture of the Action required message"
Attachment 20902
-
Re: Stripe payment module - Duplicate charges, no order
I'm really sorry.
As expected, Amazon payment is only available in the US, so even when I contacted Stripe, I couldn't find any information for me in Japan.
-
Re: Stripe payment module - Duplicate charges, no order
Can't you just use a VPN and select a US server?
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Can't you just use a VPN and select a US server?
If the DOM is not fully loaded at the time when the payment is completed, the btn_submit button may not be fully available in the DOM, causing the click() method to not trigger. This happens when the JavaScript executes too early, before the button has been added to the page.
Can you check the following codes?
checkout.js line 48
PHP Code:
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
to
PHP Code:
const interval = setInterval(function() {
const btnSubmit = document.getElementById("btn_submit");
if (btnSubmit) {
btnSubmit.click();
clearInterval(interval);
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
}
}, 100); // 100ms
-
Re: Stripe payment module - Duplicate charges, no order
I do not quote follow. Are you saying you found the issue?
What is "DOM"?
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I do not quote follow. Are you saying you found the issue?
What is "DOM"?
There are two buttons on the checkout confirmation screen:
The Zen Cart "Confirm" button.(Hidden when Stripe payment is selected)
The Stripe "Confirm" button (displayed only if Stripe is selected as the payment method).
For Amazon Pay, the user is redirected to another screen, which causes the checkout confirmation display to disappear. When they return, the checkout confirmation screen is reloaded, and checkout.js executes the click() command to press the Zen Cart "Confirm" button.
Issue
If the click() command runs before the Zen Cart "Confirm" button appears, the purchase process cannot proceed.
Fix
This update ensures that the click() command waits until the Zen Cart "Confirm" button is displayed before executing.
At this stage, we are not 100% certain that this is the root cause, but it is a highly probable and common issue.
-
Re: Stripe payment module - Duplicate charges, no order
It's been a week, and there haven't been any issues, right? So, I guess 'no news is good news'?:blush:
-
Re: Stripe payment module - Duplicate charges, no order
Sorry, I have been consumed on another effort.
I just put the code in place.
Enabled Cash App on Stripe.
Went to the Zen checkout page. Selected Cash App, which I have never used. Clicked "confirm"
The page changed, it was overall darkened, as if a pop up blocker was at work. No QR code was displayed
After a few seconds, I got the Zen Order Confirmation page.
On Stripe is shows the order was incomplete
I reverted the code back and disabled Cash App.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
Sorry, I have been consumed on another effort.
I just put the code in place.
Enabled Cash App on Stripe.
Went to the Zen checkout page. Selected Cash App, which I have never used. Clicked "confirm"
The page changed, it was overall darkened, as if a pop up blocker was at work. No QR code was displayed
After a few seconds, I got the Zen Order Confirmation page.
On Stripe is shows the order was incomplete
I reverted the code back and disabled Cash App.
If that's the case, the issue might be on Stripe's side.
It is just a possibility, but...
File: includes/modules/payment/stripepay/create.php (Line 34)
Even if automatic_payment_methods is set to true, there are cases where Cash App is not included as an available payment method.
Therefore, it is necessary to explicitly specify payment_method_types.
PHP Code:
'automatic_payment_methods' => [
'enabled' => true,
],
to
PHP Code:
'payment_method_types' => ['card', 'cashapp'],
'automatic_payment_methods' => [
'enabled' => true,
],
File: checkout.js (Line 41)
When using if_required, Stripe may determine that a redirect is not necessary, which could cause the QR code to be skipped.
PHP Code:
redirect: 'if_required'
to
PHP Code:
redirect: 'always'
I apologize for making you try multiple times. Creating code is a process of trial and error, and since I can't see the results directly myself, it's making it even more challenging.:frusty:
-
Re: Stripe payment module - Duplicate charges, no order
I appreciate all you effort, but I'm going to say Credit cards are good enough.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
split63
I appreciate all you effort, but I'm going to say Credit cards are good enough.
OK
I understand.
but I'll put this code 'payment_method_types' => ['card', 'cashapp'], in the checkout.js next update.
-
Re: Stripe payment module - Duplicate charges, no order
I have obtained Stripe support, and I'll modify checkout.js in the next update."
-
Re: Stripe payment module - Duplicate charges, no order
I have never used Cash App. When I go to checkout its shown as an option, which is why I was able to click on it and induce and error.
If you are in Japan and you use a VPN with a US location, you should be able to see and induce the error I saw.
-
Re: Stripe payment module - Successful Strip, but no order
And the saga continues.
In the last week we had two events, both were successful Stripe credit card purchases, but both resulted in no Zen order. One customer said "the website showed an error so I thought it didn't go through. However, my bank statement shows that I was charged". No further details.
In stripe, both were uneventful. They hit the final check out page only once, and no errors of any kind were reported by stripe.
-
Re: Stripe payment module - Successful Strip, but no order
More from the customer with the successful charge, but no order:
Quote:
So I went to get my debit card and got distracted. I finally came back to my phone to put in the payment information. The webpage was still loaded. After I submitted, I got an error probably bc the webpage should've timed out. But it still charged the debit card
-
Re: Stripe payment module - Successful Strip, but no order
I understand the issue.
It is caused by the difference between Zen Cart's session timeout of 24 minutes and Stripe's session timeout of 24 hours.
This can be resolved by using a webhook or the expire_at parameter.
-
Re: Stripe payment module - Successful Strip, but no order
some time back you put in a fix which times the Zen Session out and sends them to a timeout page. That worked on a PC. But this persons describes a phone. So the fix must not be universal across all browsers.
-
Re: Stripe payment module - Duplicate charges, no order
Hello,
I have read the readme like 3 times and I continue having issues. I have searched the thread without finding my problems (with the errors exactly). I've tried with testing mode, with responsive classic template, with OPC on and off. When I get to the checkout and I select Stripe as payment the form to input the numbers does not come up and I disabled all the adblocks possible. If I'm in testing mode as soon as I click on "confirm order" it goes to successful page and gives me a transaction number (even though I don't see the transaction on Stripe). The order goes through (but I never entered any number).
On the error log I've seen errors from guest checkout disabled, timeouts, and others. Here's the latest one:
Code:
[08-May-2025 16:36:49 America/Puerto_Rico] Request URI: /index.php?main_page=login, IP address: 24.***.185, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /includes/modules/pages/login/header_php_login_guest.php(92): trigger_error()
#2 /index.php(35): require('/home/***/p...')
--> PHP Warning: Invalid value(s) found in CHECKOUT_ONE_LOGIN_LAYOUT (C;L). Guest-checkout is disabled. in /includes/modules/pages/login/header_php_login_guest.php on line 92.
I also don't understand an instruction on another document included in the pack related to OPC that says:
Quote:
After the module installation, One-page checkout settings must be changed.
1. Open admin page =>Configuration => One-Page Checkout Settings =>One-Page Checkout Settings
2. Add "Stripe" and push Update button.
Which of all the settings? It doesn't say which one specific.
-
Re: Stripe payment module - Duplicate charges, no order
I believe you'll need to add stripepay to Payment Methods Requiring Confirmation.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
dbltoe
I believe you'll need to add stripepay to Payment Methods Requiring Confirmation.
Yes, that's there.
HTML Code:
eway_rapid,stripepay,gps
Not sure what's eway_rapid.
-
Re: Stripe payment module - Duplicate charges, no order
That says login to admin, click configuration, then in the dropdown look for one page checkout settings. Then click one page checkout settings again on the page that loads up. That will then show you the option "add stripe" which you can execute. You should then be able to checkout because the value it expects to see is "add stripe: True" i would guess
-
Re: Stripe.com payment integration module
Has anyone managed to use stripes appearance api to edit the payment form appearance whilst I'm here actually? I am wanting to enable dark mode but the one time I managed to actually get it to load with white text and dark colours for my project with black background stopped the payment form from working with no error log to resolve i had to revert the change on checkout template file
-
Re: Stripe.com payment integration module
Is there anyone out there who can give me a hand with this? It will be appreciated. I can't get the Stripe form to show up after selecting Stripe as the payment.
-
Re: Stripe.com payment integration module
Most common problems will be not copying the files correctly, maybe you did not rename "YOUR_TEMPLATE" folder before upload so the payment forms are not actually in your template??
Do you have any error logs you could share, that would help people to pinpoint exactly what you may be missing or have not done.
Did you add stripe to opc in the options you mentioned?
-
Re: Stripe.com payment integration module
Yes, sir. I even downloaded the version from GitHub since it seemed that the version was more up-to-date. I posted the error given before (previous post). All the files are loaded /and reloaded/ within the correct directories. I also did the patch, which was giving me errors before, but I noticed it was because it didn't have the prefix. I thought it was going to be resolved, but I'm getting the same error.
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
ideasgirl
Yes, sir. I even downloaded the version from GitHub since it seemed that the version was more up-to-date. I posted the error given before (previous post). All the files are loaded /and reloaded/ within the correct directories. I also did the patch, which was giving me errors before, but I noticed it was because it didn't have the prefix. I thought it was going to be resolved, but I'm getting the same error.
here is an idea:
- turn OFF one page checkout
- try again
- post the full debug log if you have one
- if you have no debug logs look at the dev console for any errors there
- post those errors here.
the last errors i saw said something with CHECKOUT_ONE_LOGIN_LAYOUT. we want to isolate stripe from OPC to see we can get you working with the standard 3 page checkout. once that is working, we can then see why you are failing with OPC.
best.
-
Re: Stripe.com payment integration module
I think I may have an idea of what the issue may be from your most recent response. You downloaded the github version. I believe there are slight nuances that need to be taken into consideration between versions. If you notice I had issues a few pages ago on this very thread with my setup. Admittedly I do not use one page checkout and have extensive customisations to my site responsible for the decision to stick to a 3 page checkout.
I'd say do what Carl says first, if you cannot get running then compare your version against the zencart repository ensuring that you use the correct version for your version of zencart you are working on. Sharing an error log also helps if there is one.
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
carlwhat
here is an idea:
- turn OFF one page checkout
- try again
- post the full debug log if you have one
- if you have no debug logs look at the dev console for any errors there
- post those errors here.
the last errors i saw said something with CHECKOUT_ONE_LOGIN_LAYOUT. we want to isolate stripe from OPC to see we can get you working with the standard 3 page checkout. once that is working, we can then see why you are failing with OPC.
best.
Alright, I got it to work with OPC off; which wasn't working previously. With OPC on it doesn't show the input form. These are the errors:
Code:
[13-May-2025 10:39:10 America/Puerto_Rico] Request URI: /index.php?main_page=checkout_one_confirmation, IP address: 24.171.194.185, Language id 1
#0 /includes/modules/pages/checkout_one_confirmation/jscript_stripe.php(1): zen_debug_error_handler()
#1 /includes/templates/template_default/common/html_header_js_loader.php(54): require('/home/***/p...')
#2 /includes/templates/abyss_cobalt/common/html_header.php(107): require('/home/***/p...')
#3 /index.php(42): require('/home/***/p...')
--> PHP Warning: Undefined variable $stripe_select in /includes/modules/pages/checkout_one_confirmation/jscript_stripe.php on line 1.
[13-May-2025 10:39:10 America/Puerto_Rico] Request URI: /index.php?main_page=checkout_one_confirmation, IP address: 24.171.194.185, Language id 1
#0 /includes/templates/abyss_cobalt/templates/tpl_checkout_one_confirmation_default.php(238): zen_debug_error_handler()
#1 /includes/templates/abyss_cobalt/common/tpl_main_page.php(181): require('/home/***/p...')
#2 /index.php(94): require('/home/***/p...')
--> PHP Warning: Undefined variable $stripe_select in /includes/templates/abyss_cobalt/templates/tpl_checkout_one_confirmation_default.php on line 238.
But that's obvious because I never got to input the numbers.
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
ideasgirl
...
But that's obvious because I never got to input the numbers.
the only thing that is obvious to me is that the payment module works in standard ZC 3 page checkout and does not work in OPC.
what version of ZC did you say you were running?
-
Re: Stripe.com payment integration module
ZC v2.1.0
Quote:
the only thing that is obvious to me is that the payment module works in standard ZC 3 page checkout
Yes, and that was after making some changes to the Stripe module (it continue giving me issue with the lowfee line but I fixed it).
Quote:
and does not work in OPC
It doesn't? I thought it did work with OPC since those files were included.
-
Re: Stripe.com payment integration module
my guess is that you are running v2.x.x.
my further guess is that you are having a javascript collision, which is preventing some code from running. you can check that by looking at the dev console on your browser.
best.
-
Re: Stripe.com payment integration module
I have seen the undefined strip select issue before.. I would suggest checking your settings and that you have added the opc to stripe like it stated in the instructions. Other possible solutions include swapping files from different versions of the module until you get it working or give up and restore what you originally had and stick with 3 page checkout. I tried 4 versions before I got mine remedied with an issue that resulted in payments but no orders :)
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
flappingfish
I have seen the undefined strip select issue before.. I would suggest checking your settings and that you have added the opc to stripe like it stated in the instructions. Other possible solutions include swapping files from different versions of the module until you get it working or give up and restore what you originally had and stick with 3 page checkout. I tried 4 versions before I got mine remedied with an issue that resulted in payments but no orders :)
With the heavy customisation and big bills i was given to do them i made use of chatgpt to do alot of the heavy work and pay for the monthly subscription plan, i threw your error codes at it and it gave quite a helpful response (sometimes it can be way off the mark) and this seems like the solution is in the settings for stripe where it asks if you are using OPC not being selected, if it is selected and still giving you issues then follow the chatbots guidance....
Code:
You’re seeing the “Undefined variable $stripe_select” warnings because neither your one-page checkout controller nor your template ever actually set that variable before including your Stripe JavaScript snippets. You have two choices:
1) Define $stripe_select before you use it
If you really need the variable (for example you’re injecting a dynamic element ID into your JS), then at the very top of
swift
Copy
Edit
includes/modules/pages/checkout_one_confirmation/jscript_stripe.php
(and in your tpl at the top of
bash
Copy
Edit
templates/abyss_cobalt/templates/tpl_checkout_one_confirmation_default.php
) add:
php
Copy
Edit
<?php
// make sure we always have *something* in $stripe_select
if ( !isset($stripe_select) || !strlen($stripe_select) ) {
// this should be the ID of your Stripe wrapper element—
// change it if you’re mounting to a different DIV
$stripe_select = 'payment-element';
}
?>
That will stop the notices and give your JS something to target:
php
Copy
Edit
<script>
// before: document.getElementById('<?php echo $stripe_select;?>')…
// now $stripe_select is guaranteed to exist
const paymentEl = document.getElementById('<?php echo $stripe_select;?>');
…
</script>
2) Remove the variable altogether
If your Stripe integration no longer needs a PHP-injected element ID (for example you hard-coded #payment-element in your JS), simply delete every reference to $stripe_select:
In jscript_stripe.php remove or comment out any lines using $stripe_select.
In your template (around line 238), replace
php
Copy
Edit
document.getElementById('<?php echo $stripe_select;?>').…
with
js
Copy
Edit
document.getElementById('payment-element').…
Why it happened
Zen Cart’s one-page checkout stashes almost everything in $POST and in the $payment_modules object—you have to explicitly assign template-scope variables if you intend to echo them later. Since $stripe_select was never set in the controller, PHP correctly warned that it didn’t exist.
Pick one of the above strategies and those warnings will go away.
Sounds like a credible solution... take file and database backups first and thoroughly test if all seems to show up, ie make sure you can submit an order and it get recorded by zencart
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
flappingfish
With the heavy customisation and big bills i was given to do them i made use of chatgpt to do alot of the heavy work
That's how I've been working and ironing all the issues in this update. What you gave is the same I got here, I added those and now it's suggesting to not have 2 submit buttons and to eliminate the ZC one, which I don't want to, I'm going to read a post that I saw talking about this. I'll continue with tests and will report.
@CarlWhat, I thought so too and checked before, it doesn't seem to be that but I will have it in my mind while I continue working with it.
So I guess, no one is using it with OPC?
-
Re: Stripe.com payment integration module
So you have OPC working now but have 2 confirm buttons? Perhaps wrap the zen one in a conditional statement so it does not appear if stripe is active??
If i had OPC myself I'd have most likely known of and resolved the issue but I'd break my site adding opc I think 🙃
For my customisations it relies on 3 step checkout, step 1 is normal, step 2 had a "physical ticket" option if one of the items is a ticket. Step 3 loads like usual but if customer has ticket and selected physical ticket it adds calculations before step 3 where we see the payment form for the ticket surcharge. I think I would be faced with fatal errors and white screen of death if I tried OPC without further customisations
-
Re: Stripe.com payment integration module
Quote:
Originally Posted by
flappingfish
So you have OPC working now but have 2 confirm buttons? Perhaps wrap the zen one in a conditional statement so it does not appear if stripe is active??
If i had OPC myself I'd have most likely known of and resolved the issue but I'd break my site adding opc I think
For my customisations it relies on 3 step checkout, step 1 is normal, step 2 had a "physical ticket" option if one of the items is a ticket. Step 3 loads like usual but if customer has ticket and selected physical ticket it adds calculations before step 3 where we see the payment form for the ticket surcharge. I think I would be faced with fatal errors and white screen of death if I tried OPC without further customisations
No, it never worked, that's what ChatGPT said.
I got it working on default checkout but trying to make it work on OPC, I made a doodoo and now it's not working at all. :blush: I guess I will have to start all over again.
What I noticed (and I might be wrong) is that the form is not appearing on OPC maybe because it's not being inserted in tpl_modules_opc_payment_choices.php, nor credit_selections, so maybe that's why it's not working with OPC.
-
Re: Stripe payment module - Duplicate charges, no order
@Gozzandes (or anyone that made it work and wants to help)
Please, when you get a chance, I need help with this module.
I have installed 3 versions, the latest being 2.1.9, and I'm still without the cc form. It doesn't work at all in any of the 2 ways (default or OPC). I've been 3 days with this and not getting anywhere :frusty:
Right now, there are no errors, but OPC hangs there without throwing errors when I stop.
I got it working with a mix of 2.1.4 and 2.1.8, but only for default checkout but trying to make it work with OPC I messed something up and don't know which files are which. I can check my references but there were so many changes that I decided to start all over again with the latest version. Also, there are so many changes and editions in this thread that it's difficult to follow.
Thanks in advance.
-
Re: Stripe payment module - Duplicate charges, no order
In Zen Cart's Stripe payment integration module, the CC form is embedded in tpl_checkout_confirmation_default.php.
Therefore, it must be placed inside the correct folder:
includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php
If this file is missing or incorrectly placed, the credit card input form will not appear during checkout.
Alternatively, if you delete includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php,
Zen Cart will automatically fall back to the default template, which might resolve the issue.
To troubleshoot further:
- Ensure the correct file exists in the right directory.
- Try using the default template by deleting the custom one.
- Check for JavaScript errors or missing Stripe scripts in the browser console.
- Clear the cache (both Zen Cart and browser) to ensure changes take effect.
I just noticed your post now. I’ve been busy with rice planting for the past month and haven’t been able to check. I’m really sorry about that!
This should help clarify things! Let me know if you'd like any refinements.
You're really getting to the bottom of this issue!
This should capture everything you wanted! Let me know if you'd like any tweaks.
Hope the rice planting went well—sounds like a busy month!
-
Re: Stripe payment module - Duplicate charges, no order
To ensure the correct template is used in Zen Cart's Stripe payment integration module, follow these steps:
- Check your active template:
- Go to Admin => Tools => Template Selection to find out which template is currently in use.
- For example, let's say your active template is "flowers".
- Place the necessary files in the correct directory:
- Move all files from includes/templates/YOUR_TEMPLATE/ into includes/templates/flowers/templates/.
- This ensures that the checkout confirmation page correctly loads the Stripe CC form.
- Alternative method:
- If you want to use the default template instead, delete includes/templates/flowers/templates/tpl_checkout_confirmation_default.php.
- When this file is removed, Zen Cart will automatically fall back to the default template located at:
includes/templates/default_template/tpl_checkout_confirmation_default.php.
-
Re: Stripe payment module - Duplicate charges, no order
To ensure the correct template is used in Zen Cart's Stripe payment integration module, follow these steps:
- Check your active template:
- Go to Admin => Tools => Template Selection to find out which template is currently in use.
- For example, let's say your active template is "flowers".
- Place the necessary files in the correct directory:
- Move all files from includes/templates/YOUR_TEMPLATE/ into includes/templates/flowers/templates/.
- This ensures that the checkout confirmation page correctly loads the Stripe CC form.
- Alternative method:
- If you want to use the default template instead, delete includes/templates/flowers/templates/tpl_checkout_confirmation_default.php.
- When this file is removed, Zen Cart will automatically fall back to the default template located at:
includes/templates/default_template/tpl_checkout_confirmation_default.php.
-
Re: Stripe payment module - Duplicate charges, no order
Quote:
Originally Posted by
Gozzandes
To ensure the correct template is used in Zen Cart's Stripe payment integration module, follow these steps:
....
I have done all that troubleshooting, and the form didn't appear in any of the templates. Even uploading the files to those templates' custom folders. The form doesn't appear on checkout. Right now, I'm not sure if the testing was going through or not at the end, but for sure, I couldn't enter the testing numbers; it just went through without form, the times it did.
I stopped the day of that post. I'll check if this coming weekend I can work on it again.
-
Re: Stripe payment module - Duplicate charges, no order
### **Stripe Module Process Flow in Zen Cart**
1. **Stripe API Key Loading**
- The system loads the **Live Key** and **Secret Key** from the Zen Cart admin settings.
- Without these keys, the Stripe module cannot generate the **Client Secret**, and the payment form will not appear.
2. **Price Validation**
- The module verifies the minimum transaction amount required by Stripe.
- For USD, the minimum amount is **$5** (this value may vary depending on currency and Stripe settings).
3. **Generating Client Secret**
- Once the Stripe keys are verified, the module uses the **Secret Key** to request a **Client Secret** from Stripe’s API.
- This Client Secret is essential for processing payments securely.
4. **Checkout.js Receives the Client Secret**
- The **checkout.js** script takes the Client Secret and initializes Stripe’s payment form.
- The payment form is dynamically injected into `tpl_checkout_confirmation_default.php`.
- If the form does not appear, possible issues include missing API keys, JavaScript errors, or conflicts with OPC (One Page Checkout).
### **Ensuring the Correct Template is Used**
To properly integrate Stripe's payment form, follow these steps:
1. **Check your active template:**
- Go to `Admin => Tools => Template Selection` to find out which template is currently in use.
- For example, let's say your active template is **"flowers"**.
2. **Place the necessary files in the correct directory:**
- Move all files from `includes/templates/YOUR_TEMPLATE/` into `includes/templates/flowers/templates/`.
- This ensures that the checkout confirmation page correctly loads the Stripe CC form.
3. **Alternative method:**
- If you want to use the default template instead, delete `includes/templates/flowers/templates/tpl_checkout_confirmation_default.php`.
- When this file is removed, Zen Cart will automatically **fall back to the default template** located at:
`includes/templates/default_template/tpl_checkout_confirmation_default.php`.
### **Debugging and Troubleshooting**
1. **Check PHP Error Logs**
- Zen Cart logs system errors, so reviewing the logs (`/logs/` directory) can provide insights into potential problems.
2. **Use Browser Developer Tools**
- Open the developer console (`F12`) and check for JavaScript errors related to Stripe.
- If the Stripe scripts aren’t loading properly, the payment form won’t appear.
3. **Verify Stripe API Settings**
- Ensure that the **Live Key** and **Secret Key** are correctly set in the admin panel.
- Without these, the system cannot generate the **Client Secret**, which is needed to display the payment form.
4. **Confirm Test Mode Behavior**
- If the transaction is processing **without entering card details**, it could indicate an issue with test mode or a missing Client Secret.
- Check if Stripe’s dashboard logs any transaction details to confirm whether payments are actually being processed.
-
Re: Stripe payment module - Duplicate charges, no order
When using the Stripe module with OPC, go to the Admin page => One-Page Checkout Settings => Payment Methods Requiring Confirmation, then push the edit button. Rewrite eway_rapid,stripepay,gps to eway_rapid,stripe,gps.