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

Stripe.com payment integration module

Views: 233,186

Results 361 to 380 of 679
31 Jul 2024, 1:29 AM
#361
jmsnyder23 avatar

jmsnyder23

Zen Follower

Join Date:
Jan 2010
Location:
Richmond, Virginia, United States
Posts:
122
Plugin Contributions:
0

Stripe.com payment integration module

I'm having an issue when customers use the reward points or a gift certificate to check out. For some reason, these values show up on the page but do NOT feed to Stripe, so they're charged full price. However, the points are deducted from their account, and the gift card is marked as spent. But they're also charged for the full amount.

Has this happened to anyone else?

31 Jul 2024, 1:37 AM
#362
oj_simon avatar

oj_simon

Zen Follower

Join Date:
Nov 2023
Location:
Hounslow
Posts:
129
Plugin Contributions:
0

Re: Stripe.com payment integration module

jmsnyder23:

I'm having an issue when customers use the reward points or a gift certificate to check out. For some reason, these values show up on the page but do NOT feed to Stripe, so they're charged full price. However, the points are deducted from their account, and the gift card is marked as spent. But they're also charged for the full amount.

Has this happened to anyone else?
Have you updated to the latest version of the plugin as I think this has been fixed.

31 Jul 2024, 1:39 AM
#363
oj_simon avatar

oj_simon

Zen Follower

Join Date:
Nov 2023
Location:
Hounslow
Posts:
129
Plugin Contributions:
0

Re: Stripe.com payment integration module

jmsnyder23:

I'm having an issue when customers use the reward points or a gift certificate to check out. For some reason, these values show up on the page but do NOT feed to Stripe, so they're charged full price. However, the points are deducted from their account, and the gift card is marked as spent. But they're also charged for the full amount.

Has this happened to anyone else?
Also what version of Zen Cart and PHP are you running

7 Aug 2024, 6:20 AM
#364
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

jmsnyder23:

I'm having an issue when customers use the reward points or a gift certificate to check out. For some reason, these values show up on the page but do NOT feed to Stripe, so they're charged full price. However, the points are deducted from their account, and the gift card is marked as spent. But they're also charged for the full amount.

Has this happened to anyone else?

Ver 2.0.4 and later of this module should have resolved this issue.
What is your module version?

16 Sep 2024, 6:20 PM
#365
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

just installed this and credit card payments work fine but when i try to use klarna or clearpay it goes straight to the order success page without visiting either payment provider and in stripe dashboard i see a failure that mentions i must specify a return url for klarna/clearpay. Did I miss a step that the dev who helped me get it loading has also not spotted or maybe a crucial file edit somewhere that's being missed by a bad merge?

18 Sep 2024, 2:35 PM
#366
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

flappingfish:

just installed this and credit card payments work fine but when i try to use klarna or clearpay it goes straight to the order success page without visiting either payment provider and in stripe dashboard i see a failure that mentions i must specify a return url for klarna/clearpay. Did I miss a step that the dev who helped me get it loading has also not spotted or maybe a crucial file edit somewhere that's being missed by a bad merge?

Following file should be fixed.
\www\includes\checkout.js
It's rice harvesting season now and I can't do anything.

19 Sep 2024, 3:34 PM
#367
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

i see the following section but no instructions on how it should be edited, is this what you are refering too?

const { error } = await stripe.confirmPayment({
    elements,
    confirmParams: {
      // Make sure to change this to your payment completion page
      return_url: confirmationURL,
    },
   });
19 Sep 2024, 3:55 PM
#368
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

flappingfish:

i see the following section but no instructions on how it should be edited, is this what you are refering too?

const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: confirmationURL,
},
});


whoops, looking at older checout.js on another site there, is this a known fault with module or just something site specific? i have quite a few modules that required a file merge or 2
26 Sep 2024, 6:39 AM
#369
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

flappingfish:

whoops, looking at older checout.js on another site there, is this a known fault with module or just something site specific? i have quite a few modules that required a file merge or 2

\includes\checkout.js
Cange the line 75 of this file from

  document.getElementById('checkoutConfirmDefaultHeading').textContent = PaymentSuccess;
  document.getElementById('payment-form').style.visibility = 'hidden';  
  document.getElementById('submit').style.visibility = 'hidden';  
  document.getElementById("btn_submit").click();

to
document.getElementById('checkoutConfirmDefaultHeading').textContent = 'Payment succeeded!.';

Delete the line 76, 77, 78.
*After taking action, please reply with the results.

26 Sep 2024, 6:53 AM
#370
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

I don't actually use this payment module.
Created just for fun. As a result, problem discovery is delayed.
sorry.

Stripe module ver2.1.3 has already been uploaded.
Please wait until it is published.

26 Sep 2024, 3:10 PM
#371
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

Gozzandes:

I don't actually use this payment module.
Created just for fun. As a result, problem discovery is delayed.
sorry.

Stripe module ver2.1.3 has already been uploaded.
Please wait until it is published.

Thankyou Gozzandes, That edit you specified earlier worked, klarna and clearpay now load, assuming i followed your instructions correctly and did not get slightly confused on deleting items, i do notice the following seems to appear on checkout page flow on my site...

int(9589) string(1) "0"

unsure if that is stripe module or something site specific but worth mentioning incase you missed it on your test run?

i will keep an eye out for updated module version being published and compare my checkout.js to that to make sure it isn't me getting it wrong and update you if that turns out to be the case

26 Sep 2024, 5:43 PM
#372
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

flappingfish:

Thankyou Gozzandes, That edit you specified earlier worked, klarna and clearpay now load, assuming i followed your instructions correctly and did not get slightly confused on deleting items, i do notice the following seems to appear on checkout page flow on my site...

int(9589) string(1) "0"

> 
> 
> unsure if that is stripe module or something site specific but worth mentioning incase you missed it on your test run? 
> 
> i will keep an eye out for updated module version being published and compare my checkout.js to that to make sure it isn't me getting it wrong and update you if that turns out to be the case

It was actually site specific that other issue, I was trying to get a surcharge on items for I store collection based on value of v_dropship and messed up with syntax it seems lol. Thankyou for the fix :cool:
28 Sep 2024, 12:49 AM
#373
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

Still not seeing the published update and i've encountered an issue, not sure if i made a mistake or?? current fault, payment is taken from customers bank account, website displays "payment success!" instead of confirmation order page and order is not registered

28 Sep 2024, 2:28 AM
#374
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

flappingfish:

Still not seeing the published update and i've encountered an issue, not sure if i made a mistake or?? current fault, payment is taken from customers bank account, website displays "payment success!" instead of confirmation order page and order is not registered

Please rewrite all the contents of checkout.js to the code below.

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: {
     },
    redirect: 'if_required'
   }
  )
  
   if (response.error) {
    showMessage(response.error.message);
   } else {
    showMessage(`Payment Succeeded: ${response.paymentIntent.id}`);
    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 = 'Payment succeeded!.';
      showMessage("Payment succeeded!");
      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");
  }
}
28 Sep 2024, 3:28 AM
#375
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

Card payments now work but klarna and clearpay ar eback to the same error but this time no confirmed order without a klarna or clearpay pop up but instead a verbose output that says "
You must provide a return_url when confirming a PaymentIntent with the payment method type klarna." (same with clearpay)
Also when you do make a card payment the succesful payment id comes up as a verbose above the confirm button, i thought i had to click confirm again there and it let me and then said "unregecognised error" and then loaded the order confirmation page, everything processed as expected though on the card tests in live mode. i'm using 1.58 atm, not sure if that makes a difference to checkout.js file for my site?

28 Sep 2024, 8:08 AM
#376
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

flappingfish:

Card payments now work but klarna and clearpay ar eback to the same error but this time no confirmed order without a klarna or clearpay pop up but instead a verbose output that says "
You must provide a return_url when confirming a PaymentIntent with the payment method type klarna." (same with clearpay)
Also when you do make a card payment the succesful payment id comes up as a verbose above the confirm button, i thought i had to click confirm again there and it let me and then said "unregecognised error" and then loaded the order confirmation page, everything processed as expected though on the card tests in live mode. i'm using 1.58 atm, not sure if that makes a difference to checkout.js file for my site?

Setting of the return_url is line 44.Could you add "return_url: confirmationURL," before redirect?

    return_url: confirmationURL,
    redirect: 'if_required'
29 Sep 2024, 1:25 PM
#377
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

Gozzandes:

Setting of the return_url is line 44.Could you add "return_url: confirmationURL," before redirect?

return_url: confirmationURL,
redirect: 'if_required'

assuming i added that correctly, it did not work and still states i must provide a return url, provided that section so you can confirm if its me...

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 {
showMessage(Payment Succeeded: ${response.paymentIntent.id});
document.getElementById("btn_submit").click();
}
setLoading(false);
}

29 Sep 2024, 11:23 PM
#378
gozzandes avatar

gozzandes

Zen Follower

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

Re: Stripe.com payment integration module

[QUOTE=flappingfish;1403574]assuming i added that correctly, it did not work and still states i must provide a return url, provided that section so you can confirm if its me...

I'm sorry I made a mistake.
and I cannot check klarna and clearpay payment.

  const response = await stripe.confirmPayment({
    elements,
    confirmParams: {
      return_url: confirmationURL,
     },
    redirect: 'if_required'
   }
  )
30 Sep 2024, 12:20 PM
#379
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

[QUOTE=Gozzandes;1403575]> flappingfish:

assuming i added that correctly, it did not work and still states i must provide a return url, provided that section so you can confirm if its me...

I'm sorry I made a mistake.
and I cannot check klarna and clearpay payment.

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


That did the trick nicely, all working as expected as far as I can test, klarna and clearpay are loading as expected and card payments are working. Will have to wait until someone uses klarna or clearpay to confirm it indeed processes the order correctly upon successful finance application. It has made a big difference to sales already though, every man and his dog knows the name stripe, i think people distrusted the takepayments branded payment module i was using :)
30 Sep 2024, 4:51 PM
#380
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
312
Plugin Contributions:
2

Re: Stripe.com payment integration module

[QUOTE=flappingfish;1403577]> Gozzandes:

That did the trick nicely, all working as expected as far as I can test, klarna and clearpay are loading as expected and card payments are working. Will have to wait until someone uses klarna or clearpay to confirm it indeed processes the order correctly upon successful finance application. It has made a big difference to sales already though, every man and his dog knows the name stripe, i think people distrusted the takepayments branded payment module i was using :)

just had a pair of customers come in and use klarna for instore collection and the payment plans where setup and payment succeeded but it did not then register the payment success and directed to the "payment success" message above the payment form but pressing confirm demands fresh payment, no way to confirm the order after payment success :/