#akshay-publishable-key

1 messages · Page 1 of 1 (latest)

deep seal
#

@glossy sun this is not a Stripe error as that as I know. You must be using a third-party that raises the error.
But it tells you your API key is invalid so you need to debug that part

glossy sun
#

I'm calling loadStripe("pk_test_XXX") using my Stripe Test key from the dashboard, but I haven't changed that API key anytime recently. My calls were working earlier today but suddenly stopped about an hour ago

deep seal
#

it's highly likely that you're passing an empty string or an invalid value. The first step is to debug this on your end, you can look at the code in the browser and figure out what exact key you are passing

glossy sun
#

Well the strange thing is that I'm able to retrieve payment intents, just not able to confirm them

#

i can see in the API Key request logs that both GET/POST were working til ~2:13pm PST, and since then I'm only able to GET

deep seal
#

I'm sorry, I know it's not working but I really need more specific details

#

retrieving a PaymentIntent happens with the Secret API key server-side, that's different right?

#

you said the problem is client-side with the publishable key

glossy sun
#

No I'm retrieving the paymentIntent client-side to generate the paymentRequest object

#

and that works

deep seal
#

Can you share some come, I don't understand what that means

glossy sun
#
stripe.retrievePaymentIntent(clientSecret).then(({ paymentIntent }) => {
  if (paymentIntent) {
    const pr = stripe.paymentRequest({
      country: "US",
      currency: "usd",
      total: {
        label: String(paymentIntent.description),
        amount: paymentIntent.amount
      },
      requestPayerName: true,
      requestPayerEmail: true,
      requestShipping: true
    });
    pr.canMakePayment().then(result => {
      if (result) {
        setPaymentRequest(pr);
      }
    });
  }
});
#

This call to the stripe API works

#

later on, when I try to do this, it seems to suddenly fail:

paymentRequest.on('paymentmethod', async (ev) => {
  // Confirm the PaymentIntent without handling potential next actions (yet).
  const {paymentIntent, error: confirmError} = await stripe.confirmCardPayment(
    clientSecret,
    {payment_method: ev.paymentMethod.id},
    {handleActions: false}
  );
}
deep seal
#

I've never seen anyone do this before 😅

#

but is there a page I can look at?

glossy sun
#

I actually need to sign off for the day and I can't send a link at the moment since it contains information we don't want to be externally visible yet

#

I can edit the page to only reveal non-sensitive information and send a link tomorrow mornign?

deep seal
#

@glossy sun as far as I can tell on that doc we never tell you to retrieve the payment intent right?