#Thibaud

1 messages · Page 1 of 1 (latest)

twilit voidBOT
carmine eagle
#

👋 happy to help

smoky vine
#

thanks to help

carmine eagle
#

what do you mean by "the plugin javascript v3"?

#

how are you integrating with Stripe?

smoky vine
#

i use the javascript plugin

#

who display the card field

#

but, i am sure that sometimes, the fields don't load.

worst a customer told me, that he had the field, but the button pay was spinning indefinitely

carmine eagle
smoky vine
#

this one, i use the checkout

carmine eagle
smoky vine
#

<form id="payment-form"><div id="payment-element"></div><button id="submit"><div class="spinner hidden" id="spinner"></div><span id="button-text">'.$sRLang[369].'</span></button><div id="payment-message" class="hidden"></div></form>

#

yes the checkout

#

i use the javascript plugin (for the PCI)

and when people click on the button, some php do the job with the javascript checkout to communicate with your server

#

but for me, some customer report me that :

the plugin don't display the field card

#

AND

carmine eagle
#

which integration doc are you following?

smoky vine
#

when i am on dashboard i can see a lot of attempt where people don't put their card.

but when people arrive on checkout page.

they pay or the left.

or in some case they try and try and try by refresh the page or do again the tunnel to go to checkout

#

(sorry for my english)

smoky vine
#

so it's working, but not at 100%

carmine eagle
#

@smoky vine please answer my question in order for me to be able to help you out

smoky vine
#

okay

#

i used your integration doc :

carmine eagle
#

we really can't know what happened on your page since we don't track that, but in all cases do you have any Payment Intent IDs (some examples) to see whether we have anything on record that might help with this

smoky vine
#

for me, the problem is

#

the plugin don't load and the customer don't see the fields

carmine eagle
#

this is really vague @smoky vine

smoky vine
#

pi_3MgEcwJigHIRTv190Vb9vWfV :: 27 fév - 22:52
pi_3MgOuuJigHIRTv190HqxGhHS :: 28 fév - 09:52
pi_3MgOvmJigHIRTv190VPiQc2f :: 28 fév - 09:53
pi_3MgOvzJigHIRTv190H0B6lPX :: 28 fév - 09:53

4x the same customer. weird behavior for me to refresh 3 times the same page.

he will finish by buy with pi_3MgP1AJigHIRTv190nDOCAsa at 09:59

#

there are no reason to refresh and restart the cart to try to buy the same product.

#

pi_3MgENSJigHIRTv190f3xuUmM :: 27 févr. à 22:36
pi_3MgENqJigHIRTv190ncrk6k1 :: 27 févr. à 22:37
pi_3MgOxKJigHIRTv191V6Hq0TH :: 28 févr. à 09:54
pi_3MgY4sJigHIRTv190spKFTfd :: 28 févr. à 19:39
pi_3MgY7NJigHIRTv190mCcqpUk :: 28 févr. à 19:41
pi_3MhC3SJigHIRTv191Hy6ausx :: 2 mars à 14:20

#

same customer, who came at different time, put the same product on cart

#

99,9% who can't pay, don't tell us.

the 0.01% we can't do nothing.

#

it's why i bother you today. i have the feeling that something don't work, and i would like to found a solution

carmine eagle
#

would you mind sharing your code please?

smoky vine
#

yes

#

which one you want ?

#

the checkout.html

#

the php part ?

carmine eagle
#

no

#

yes please

smoky vine
#
\Stripe\Stripe::setApiKey(STRIPE_SK);
    header('Content-Type: application/json');
    try {
        $paymentIntent = \Stripe\PaymentIntent::create(array(
            'amount' => $nPrixStripe,
            'currency' => 'eur',
            'automatic_payment_methods' => array('enabled' => true),
            'description' => 'Order '.$_SESSION['Connected']['Achat']['KeyGen'],
            'metadata' => array(
                'order_id' => $_SESSION['Connected']['Achat']['KeyGen'],
                'idEvent' => $sR['idEvent'],
                'idMatch' => $sR['id'],
                'idAnnonce' => $_SESSION['Connected']['Achat']['idAnnonce'],
                'Quantite' => $_SESSION['Connected']['Achat']['Quantite'],
                'idMbr' => $oUser['id'],
                'PrixParBillet' => $sRDetail['PrixVente'],
                'PrixBillets' => $nPrixBillets,
                'TaxeParBillet' => $oUser['PourcentageDossierAchat'],
                'PrixDossierParBillet' => $nPrixDossierParBillet,
                'PrixDossier' => $nPrixDossier,
                'PrixHT' => $nPrixHT,
                'TaxeTVA' => $sR['Tva'],
                'PrixTVA' => $nPrixTVA,
                'PrixTotal' => $nPrixTotal,
            ),
        ));
        $output = array('clientSecret' => $paymentIntent->client_secret);
        echo json_encode($output);
        $_SESSION['Connected']['Achat']['idStripe'] = $paymentIntent->id;
    }
    catch(Error $e) {
        http_response_code(500);
        echo json_encode(array('error' => $e->getMessage()));
    }
    exit;
#

$nPrixStripe => price in cents without . or ,

#

$_SESSION['Connected']['Achat']['KeyGen'] => my command reference => AABBCCC

carmine eagle
#

ok

#

the front-end part?

smoky vine
#

the checkout.js ?

#

who communicate with this php part ?

carmine eagle
#

yes

smoky vine
#

here or pastebin ?

carmine eagle
#

doesn't really matter

smoky vine
#

pastebin because i am limited on char here

#

const { clientSecret } = await fetch("checkout.php?getStripe=1", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ items }),}).then((r) => r.json());

this call the php part i just copy paste

carmine eagle
#

you're not handling the errors

#

you're not catching the 500s

smoky vine
#

where i can found the missing part to handle the 500s ?

#

i just download the zip on this page : https://stripe.com/docs/payments/quickstart

and it's the one i use on my website for the checkout.js

without this :

let emailAddress = '';

and

 const linkAuthenticationElement = elements.create("linkAuthentication");
  linkAuthenticationElement.mount("#link-authentication-element");

  const paymentElementOptions = {
    layout: "tabs",
  };
spark topaz
#

Hi there 👋 jumping in as my teammate needs to step away, please bear with me a moment while I catch up on the context here.

smoky vine
#

i complain about the fact that i am sure the javascript plugin not load each time.

i use the checkout system and i follow this doc https://stripe.com/docs/payments/card-element


i give some Payment Intent IDs with date. Because the customer behavior is anormal. Let met think clearly that the plugin don't load.


Your teammate ask me my code and told me i don't handle the 500s error. but I used the .zip shared on the documentation

spark topaz
#

Alright, let's take a step back. Are you able to reproduce the behavior that you're worried about?

smoky vine
#

me : no. i am not impacted by the bug

99.9% of customer never complain or report the bug.

and the 0.01% when they do, i can't do nothing.

the behavior by some customer is totaly anormal, it's why i am sure there are a problem

#
pi_3MgENSJigHIRTv190f3xuUmM :: 27 févr. à 22:36
pi_3MgENqJigHIRTv190ncrk6k1 :: 27 févr. à 22:37
pi_3MgOxKJigHIRTv191V6Hq0TH :: 28 févr. à 09:54
pi_3MgY4sJigHIRTv190spKFTfd :: 28 févr. à 19:39
pi_3MgY7NJigHIRTv190mCcqpUk ::  28 févr. à 19:41
pi_3MhC3SJigHIRTv191Hy6ausx :: 2 mars à 14:20

why came multiple times, restart the cart to put the same product, and never pay ? those who don't have bug came, and they pay or not.

spark topaz
#

Just to be clear, it sounds like at this point you're guessing that there is a bug, have any of your customers reached out to report it to you?

smoky vine
#

only one reported it (and not recently). i finish by offer him the product after spent 10 minutes in phone with him and ask him to donwlaod chrome

#

so yes, i am guessing there are a problem, but nobody report it recently

#

because the behavior to create multiple cart / basket with the same product without buy is anormal. on my business people do the cart once. they pay it, or they leave. they don't do it multiple time

spark topaz
#

So have you reached out to the customers to ask why the behaved this way?

smoky vine
#

i know, i am the worst customer. "hey there are a bug" but i have no element to help or proove it

spark topaz
#

Nope, not a bad customer, it's just not going to be possible for us to dig in without having an understanding of what we should be looking at or for.

smoky vine
smoky vine
spark topaz
#

You mean the Payment Element?

smoky vine
#

yes

spark topaz
#

It's probably possible, did your code catch any errors when trying to create the instance of Stripe or the Payment Element, or did an error get raised when trying to mount the Payment Element?

smoky vine
#

on my php log i have 0 error

#

and i dont log the javascript one

#

tarzan told me before you came : you don't handle the 500s

#

but i use your code, if you can told me how to handle the 500s i will be happy to do it and try to track eventually problem when the plugin don't display

spark topaz
#

I took a quick look through the stock javascript file that we provide there, and it does seem to check for errors when confirming payments. If you believe there is another part of the process that is causing problems, then you'll want to add logging for those, and possibly wrap them in try/catch blocks if you think those functions are erroring.

smoky vine
#

why "you" didnt add this functionality ( check for errors when confirming payments ) on the checkout.js that you share to help dev to integrate your system ?

smoky vine
spark topaz
smoky vine
#

"I took a quick look through the stock javascript file that we provide there, and it does seem to check for errors when confirming payments. "

"To clarify, the provided code does check for errors being returned when confirming a payment"

i use the javascript provide by stripe.

did i understand not correctly or you said the opposite ?

#

for me the problem can be 2 solutions :

  1. the plugin (the card input) are not display on my page
    OR
  2. the pay button #payment-element who generate a spinner and send a request to stripe server put the spinner but nothing happen (it's what happen to my customer who report me the bug few months ago)

I'm clearly speculating. which may be wrong.

and I thought that maybe other people would complain of the same problem and that you would have answers for me.

spark topaz
#

There is error handling for confirming a payment, as seen in the example code:

    elements,
    confirmParams: {
      // Make sure to change this to your payment completion page
      return_url: "http://localhost:4242/checkout.html",
      receipt_email: emailAddress,
    },
  });

  // This point will only be reached if there is an immediate error when
  // confirming the payment. Otherwise, your customer will be redirected to
  // your `return_url`. For some payment methods like iDEAL, your customer will
  // be redirected to an intermediate site first to authorize the payment, then
  // redirected to the `return_url`.
  if (error.type === "card_error" || error.type === "validation_error") {
    showMessage(error.message);
  } else {
    showMessage("An unexpected error occurred.");
  }```
smoky vine
#

i have this on my code too

spark topaz
#

Yup, so your code will catch errors raised when confirming the payment.

smoky vine
#

because i used your checkout.js download on your zip

#

but never a stripe customer report you that plugin don't display ?

#

or that the pay button create a spinning indefinitely ?

spark topaz
#

I've heard it before, and then we need to get details on how to reproduce so we can get an idea of what is happening. Right now the problem is very vague, it's really not even clear what the problem is (element not loading, a payment button spinning indefinitely, or something else).

smoky vine
#

for me, the customer came on checkout page, and the input card don't show up

#

but i have no element to recreate the bug

#

maybe it's related to the phone / nav / os / security settings

#

i will try to track it

spark topaz
#

Yup, it very well could be that the customer was using an unsupported browser.

smoky vine
#

i will try to track/log that

#

and come back to you

#

thanks for you time

spark topaz
#

Any time!