Zen Cart Logo
Forums / Addon Payment Modules / Stripe.com payment integration module

Stripe.com payment integration module

Views: 233,180

Results 481 to 500 of 679
2 Jan 2025, 7:03 AM
#481
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Stripe.com payment integration module

BigB:

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

require_once 'stripepay/create.php' ;

to

if ($_SESSION['paymentIntent'] == '' ){
require_once 'stripepay/create.php' ;
}

tpl_checkout_confirmation_default line194
tpl_checkout_one_confirmation_default line235

<script>
if (typeof clientS === null) {
<?php
$jason_stripe_select = json_encode($stripe_select);
?>
<script>
var stripe_select = JSON.parse('<?php echo $jason_stripe_select; ?>'); 
if (stripe_select === "True") {
2 Jan 2025, 7:12 AM
#482
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

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 
if ( isset($_SESSION['paymentIntent'])){
    $_SESSION['paymentIntent'] = '';
  }
?>
2 Jan 2025, 11:54 AM
#483
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

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.php
\includes\templates\YOUR_TEMPLATE\templates\tpl_checkout_one_confirmation_default.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.

2 Jan 2025, 12:50 PM
#484
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

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

2 Jan 2025, 3:55 PM
#485
bigb avatar

bigb

New Zenner

Join Date:
Jun 2024
Posts:
91
Plugin Contributions:
0

Re: Stripe.com payment integration module

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

Ok, Thank you very much. I'll give it a go

2 Jan 2025, 5:42 PM
#486
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

I've uploaded stripe module ver 219 to github.com.

Does this 219 version address both BigB issues as well as the duplicate order issue?

3 Jan 2025, 1:41 AM
#487
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

Does this 219 version address both BigB issues as well as the duplicate order issue?

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.

3 Jan 2025, 2:06 AM
#488
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

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.

I must have missed this, I thought commenting out line 39 of the \includes\checkout.js was the fix.

3 Jan 2025, 3:42 AM
#489
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

I must have missed this, I thought commenting out line 39 of the \includes\checkout.js was the fix.

\includes\checkout.js line 39
return_url: confirmationURL,

This code is needed here.
Customers will return to this is the page after PayPal payment page.
I didn't take this into consideration.
Sorry.

3 Jan 2025, 5:57 PM
#490
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

\includes\checkout.js line 39
return_url: confirmationURL,

This code is needed here.
Customers will return to this is the page after PayPal payment page.
I didn't take this into consideration.
Sorry.

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:

4 Jan 2025, 5:12 AM
#491
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

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.

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);

or upload mysql_upgrade_to_2.1.7.sql.

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.

4 Jan 2025, 5:03 PM
#492
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

Everything seem to be OK without "TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED" message.

Open the page.
Admin page=>Tools=>SQL Query Executor

You mean login to Zen Admin and Select: Tools => Install SQL Patches

5 Jan 2025, 3:00 AM
#493
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

You mean login to Zen Admin and Select: Tools => Install SQL Patches

Yes.
TEXT_PAYMENT_STRIPE_PAYMENTSUCCEEDED is not installed in your database.

5 Jan 2025, 6:53 PM
#494
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

Thanks!!
Change the following code
www\includes\modules\payment\stripe.php line 150
from

 if (MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {
> 
> to
>  ```php
     if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {

:blush:

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

6 Jan 2025, 5:03 AM
#495
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

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 (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' && MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER >= $order->info['total']) {

If you set "Allow Low Order Fee" to true and customer's order under ## dollar.
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.

6 Jan 2025, 4:16 PM
#496
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

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

6 Jan 2025, 5:27 PM
#497
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

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

6 Jan 2025, 6:15 PM
#498
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

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?

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:

7 Jan 2025, 4:36 AM
#499
gozzandes avatar

gozzandes

Zen Follower

Join Date:
Jul 2021
Location:
Fukuoka Japan
Posts:
131
Plugin Contributions:
0

Re: Stripe.com payment integration module

split63:

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.php line 197 -216
from

<!--------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-------->  
<!--------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-------->  
7 Jan 2025, 6:42 PM
#500
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: Stripe.com payment integration module

Gozzandes:

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.php line 197 -216

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