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

Stripe.com payment integration module

Views: 233,168

Results 441 to 460 of 679
24 Dec 2024, 12:28 AM
#442
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

Have been using PayPal for years...only. PayPal claims to charge 2.9% +.30, but its always about 4%. Then there are the customers that email and plead for something other than PayPal. We tried Zelle for a while, but too much hassle always dealing with customers that selected it, but did not know what to do next. PayPal's dispute resolution, never sides with the seller, unless its painfully obvious.
A customer can send an empty box back as part of a return, and PayPal will side with the customer. A customer could smash the product with a hammer and return the bits, and PayPal would side with the customer

Now with Stripe, we have several payment options, and I have been checking, it is 2.9% + .30. Damn, we should have switched long ago.
One warning, not all available payment options are 2.9%. Make sure you know what the fees are before enabling a payment option.
Stirpe has AI help, which is faster than a real person. Just ask the AI what the fees are for a particular payment option.

No disputes yet....we will see how that goes

25 Dec 2024, 4:12 AM
#443
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

carlwhat:

i would suggest learning git on the terminal mode.

the limitation you are talking about is for the graphical interface.

https://docs.github.com/en/get-started/getting-started-with-git/set-up-git

https://stackoverflow.com/questions/43404202/how-to-upload-more-than-100-files-at-once-in-github

I've made available for download.
https://github.com/Gozzandes/stripe_modules_218

Nihon Yokane corporation

27 Dec 2024, 3:37 PM
#444
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

We had a customer place an order with Visa. It is listed as "Succeeded" on Stripe, but no order in Zen. A few minutes later, the customer altered his order and then used Link to Pay, which was also "Succeeded". This 2nd order was received in Zen. The customer brought this to our attention claiming he was double charged....
How can a transaction succeed at Stripe but not show up in Zen?:excl:

Looking into it further, the Visa is listed as originating from South Africa. The Link transaction, is in USD and was shipped to a USA address.
I hesitate to refund the Visa order as it feels like it could be a Scam of some sort...some loophole in Stripe.

28 Dec 2024, 1:27 PM
#445
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

split63:

We had a customer place an order with Visa. It is listed as "Succeeded" on Stripe, but no order in Zen. A few minutes later, the customer altered his order and then used Link to Pay, which was also "Succeeded". This 2nd order was received in Zen. The customer brought this to our attention claiming he was double charged....
How can a transaction succeed at Stripe but not show up in Zen?:excl:

Looking into it further, the Visa is listed as originating from South Africa. The Link transaction, is in USD and was shipped to a USA address.
I hesitate to refund the Visa order as it feels like it could be a Scam of some sort...some loophole in Stripe.

Payment succeeded information is sent from Stripe server after clicking "Confirmation" button.
and
includes/checkout.js receive the information and show payment succeeded message and click order confirmation page button.
line 48-50 and 69-71
It may be better to click first the order confirmation page button.
from

      document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
      showMessage(PaymentSuccess);
      document.getElementById("btn_submit").click();

to

      document.getElementById("btn_submit").click();
      document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
      showMessage(PaymentSuccess);
28 Dec 2024, 1:54 PM
#446
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

When I mentioned "It is listed as "Succeeded" on Stripe", I mean the Stripe website dashboard, not what the customer sees at checkout, though that may be an issue also.

28 Dec 2024, 2:59 PM
#447
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

I just received another duplicate on Stripe. According to the Stripe Dashboard, two exactly the same orders received 1 minute apart. Again, only one shows up in Zen, and its again the 2nd order shown on Stripe. So the 1st order shown on Stripe is the phantom....how can we stop this from happening?

29 Dec 2024, 8:29 AM
#448
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 just received another duplicate on Stripe. According to the Stripe Dashboard, two exactly the same orders received 1 minute apart. Again, only one shows up in Zen, and its again the 2nd order shown on Stripe. So the 1st order shown on Stripe is the phantom....how can we stop this from happening?

I guess it may be SSL problem.i highly recommend entire site SSL.
Could you check it?

29 Dec 2024, 9:10 AM
#449
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

The session may be disconnected after clicking confirmation button. and the customers are forced to log of from thier checkoutpage.
As a resut the last confirmation page is not displayed. and sometimes displayed.

29 Dec 2024, 10:17 AM
#450
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

The entire site is SSL. Please note that I have not implemented the potential change:

      document.getElementById("btn_submit").click();
      document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
      showMessage(PaymentSuccess);

Waiting to hear that this change is confirmed and will solve the issue

Wouldn't it require an active session to move from checkout page 1 to 2 to 3?

29 Dec 2024, 10:57 AM
#451
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

I do see several successful transactions followed within 0 minutes with an "incomplete" transaction from the same customer. The 1st transaction is successful on Stripe dashboard, the 2nd is "incomplete". It is the 2nd incomplete transaction that is captured within Zen

29 Dec 2024, 11:50 AM
#452
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

i want to see your checkout.js.

29 Dec 2024, 11:58 AM
#453
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

i checked 218module. I found an incorrect code.

29 Dec 2024, 12:02 PM
#454
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

Gozzandes:

i want to see your checkout.js.

from /includes/checkout.js

const stripe = Stripe (PublishableKey);

let elements;

initialize();
checkStatus();

document
  .querySelector("#payment-form")
  .addEventListener("submit", handleSubmit);

// Fetches a payment intent and captures the client secret
async function initialize(){
  const { clientSecret } = await clientS; 
  //   const { clientSecret } =await fetch("/create.php", {
  //   method: "POST",
  //   headers: { "Content-Type": "application/json" },
  //   body: JSON.stringify({ items }),
  // }).then((r) => r.json());

  
  elements = stripe.elements({ clientSecret });

  const paymentElementOptions = {
    layout: "tabs",
  };

  const paymentElement = elements.create("payment", paymentElementOptions);
  paymentElement.mount("#payment-element");
}

async function handleSubmit(e) {
  e.preventDefault();
  setLoading(true);

  const response = await stripe.confirmPayment({
    elements,
    confirmParams: {
      return_url: confirmationURL,
     },
    redirect: 'if_required'
   }
  )
  
   if (response.error) {
    showMessage(response.error.message);
   } else {
    document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
    showMessage(PaymentSuccess);
    document.getElementById("btn_submit").click();
}
  setLoading(false);
}

// Fetches the payment intent status after payment submission
async function checkStatus() {
  const clientSecret = new URLSearchParams(window.location.search).get(
    "payment_intent_client_secret"
  );

  if (!clientSecret) {
    return;
  }

  const { paymentIntent } = await stripe.retrievePaymentIntent(clientSecret);

  switch (paymentIntent.status) {
    case "succeeded":
      document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
      showMessage(PaymentSuccess);
      document.getElementById("btn_submit").click();
      break;
    case "processing":
      document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment is processing.';
      showMessage("Your payment is processing.");
      break;
    case "requires_payment_method":
      document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment was not successful, please try again.';
      showMessage("Your payment was not successful, please try again.");
      break;
    default:
      document.getElementById('checkoutConfirmDefaultHeading').textContent='Something went wrong.';
      showMessage("Something went wrong.");
      break;
  }
}

// ------- UI helpers -------

function showMessage(messageText) {
  const messageContainer = document.querySelector("#payment-message");

  messageContainer.classList.remove("hidden");
  messageContainer.textContent = messageText;

  setTimeout(function () {
    messageContainer.classList.add("hidden");
    messageText.textContent = "";
  }, 4000);
}

// Show a spinner on payment submission
function setLoading(isLoading) {
  if (isLoading) {
    // Disable the button and show a spinner
    document.querySelector("#submit").disabled = true;
    document.querySelector("#spinner").classList.remove("hidden");
    document.querySelector("#button-text").classList.add("hidden");
  } else {
    document.querySelector("#submit").disabled = false;
    document.querySelector("#spinner").classList.add("hidden");
    document.querySelector("#button-text").classList.remove("hidden");
  }
}
29 Dec 2024, 2:04 PM
#455
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

split63:

from /includes/checkout.js

const stripe = Stripe (PublishableKey);

let elements;

initialize();
checkStatus();

document
.querySelector("#payment-form")
.addEventListener("submit", handleSubmit);

// Fetches a payment intent and captures the client secret
async function initialize(){
const { clientSecret } = await clientS;
// const { clientSecret } =await fetch("/create.php", {
// method: "POST",
// headers: { "Content-Type": "application/json" },
// body: JSON.stringify({ items }),
// }).then((r) => r.json());

elements = stripe.elements({ clientSecret });

const paymentElementOptions = {
layout: "tabs",
};

const paymentElement = elements.create("payment", paymentElementOptions);
paymentElement.mount("#payment-element");
}

async function handleSubmit(e) {
e.preventDefault();
setLoading(true);

const response = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: confirmationURL,
},
redirect: 'if_required'
}
)

if (response.error) {
showMessage(response.error.message);
} else {
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
}
setLoading(false);
}

// Fetches the payment intent status after payment submission
async function checkStatus() {
const clientSecret = new URLSearchParams(window.location.search).get(
"payment_intent_client_secret"
);

if (!clientSecret) {
return;
}

const { paymentIntent } = await stripe.retrievePaymentIntent(clientSecret);

switch (paymentIntent.status) {
case "succeeded":
document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
showMessage(PaymentSuccess);
document.getElementById("btn_submit").click();
break;
case "processing":
document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment is processing.';
showMessage("Your payment is processing.");
break;
case "requires_payment_method":
document.getElementById('checkoutConfirmDefaultHeading').textContent='Your payment was not successful, please try again.';
showMessage("Your payment was not successful, please try again.");
break;
default:
document.getElementById('checkoutConfirmDefaultHeading').textContent='Something went wrong.';
showMessage("Something went wrong.");
break;
}
}

// ------- UI helpers -------

function showMessage(messageText) {
const messageContainer = document.querySelector("#payment-message");

messageContainer.classList.remove("hidden");
messageContainer.textContent = messageText;

setTimeout(function () {
messageContainer.classList.add("hidden");
messageText.textContent = "";
}, 4000);
}

// Show a spinner on payment submission
function setLoading(isLoading) {
if (isLoading) {
// Disable the button and show a spinner
document.querySelector("#submit").disabled = true;
document.querySelector("#spinner").classList.remove("hidden");
document.querySelector("#button-text").classList.add("hidden");
} else {
document.querySelector("#submit").disabled = false;
document.querySelector("#spinner").classList.add("hidden");
document.querySelector("#button-text").classList.remove("hidden");
}
}


Can you erase line 39?

return_url: confirmationURL,


[Nihon yokane corporation](https://www.yokane.co.jp)
29 Dec 2024, 2:10 PM
#456
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

Gozzandes:

Can you erase line 39?

return_url: confirmationURL,

> 
> [Nihon yokane corporation](https://www.yokane.co.jp)

This is a live site.....is this safe?

```php
      confirmParams: {
    //  return_url: confirmationURL,
     },
29 Dec 2024, 2:22 PM
#457
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

split63:

This is a live site.....is this safe?

  confirmParams: {
//  return_url: confirmationURL,
 },

I've check it using xampp.
it works without any problem.
29 Dec 2024, 2:44 PM
#458
split63 avatar

split63

Totally Zenned

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

Re: Stripe.com payment integration module

Ok, I commented out line 39. In test mode I ran a few credit card transactions. They all went fine. Zen captured the orders and Strip dashboard showed successful.
After I click "Confirm Order" on the 3rd checkout page, I also then repeatedly clicked "Confirm Order", as I know my impatient customers do, it did not seem to create any problems

30 Dec 2024, 12:24 AM
#459
bigb avatar

bigb

New Zenner

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

Re: Stripe.com payment integration module

Hello, I have Zen Cart 2.1.0 installed and am trying to get the Stripe Payments Module up and running. I have it installed and connected to my Stripe account. Have it in "Test Mode" but keep gettting hung up going to step 3 of checkout.
I get a blank page with a "WARNING: an error has occured" message.
I have my test keys correctly applied to the module settings... not sure what is making this hang.
This is what the DeBug Log File says... not sure what it's trying to tell me... any input on where to look is appreciated, thanks

[30-Dec-2024 00:11:49 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.xx.x, Language id 1
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:733]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:678]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:307]
#4 queryFactory->Execute() called at [/includes/modules/payment/stripe.php:165]
#5 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#6 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#7 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Fatal error: MySQL error 1146: Table 'xxxx670_zenc936.zenen_stripe' doesn't exist :: SELECT stripe_customers_id FROM zenen_stripe WHERE customers_id = '2' order by id DESC LIMIT 1 ==> (as called by) /includes/modules/payment/stripe.php on line 165 <== in /includes/classes/db/mysql/query_factory.php on line 733.

30 Dec 2024, 2:20 AM
#460
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

BigB:

Hello, I have Zen Cart 2.1.0 installed and am trying to get the Stripe Payments Module up and running. I have it installed and connected to my Stripe account. Have it in "Test Mode" but keep gettting hung up going to step 3 of checkout.
I get a blank page with a "WARNING: an error has occured" message.
I have my test keys correctly applied to the module settings... not sure what is making this hang.
This is what the DeBug Log File says... not sure what it's trying to tell me... any input on where to look is appreciated, thanks

[30-Dec-2024 00:11:49 UTC] Request URI: /index.php?main_page=checkout_confirmation, IP address: 35.140.xx.x, Language id 1
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:733]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:678]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:307]
#4 queryFactory->Execute() called at [/includes/modules/payment/stripe.php:165]
#5 stripe->pre_confirmation_check() called at [/includes/classes/payment.php:309]
#6 payment->pre_confirmation_check() called at [/includes/modules/pages/checkout_confirmation/header_php.php:92]
#7 require(/includes/modules/pages/checkout_confirmation/header_php.php) called at [/index.php:35]
--> PHP Fatal error: MySQL error 1146: Table 'xxxx670_zenc936.zenen_stripe' doesn't exist :: SELECT stripe_customers_id FROM zenen_stripe WHERE customers_id = '2' order by id DESC LIMIT 1 ==> (as called by) /includes/modules/payment/stripe.php on line 165 <== in /includes/classes/db/mysql/query_factory.php on line 733.

Upload following sql code from the admin page.

[CODE]
TRUNCATE zenen_stripe ;
[/CODE]