#zaid_alam_
1 messages · Page 1 of 1 (latest)
hi, what's the question?
after hitting at pay now getting errors
was there a 3D Secure(authentication) popup shown?
Also, please share your full code so we can have a look, and the PaymentIntent ID pi_xxxx you might be using on that payment form
Hi! I'm taking over this thread.
Can you share the PaymentIntent ID (pi_xxxx) as mentioned earlier?
The code you shared is for handling webhook event, so it's unrelated to the error you shared. Can you share your frontend code that use the Payment Element?
import React, { useState, useEffect } from "react";
import { loadStripe } from "@stripe/stripe-js";
import { Elements } from "@stripe/react-stripe-js";
import CheckoutForm from "./CheckoutForm";
import "./App.css";
// Make sure to call loadStripe outside of a component’s render to avoid
// recreating the Stripe object on every render.
// This is a public sample test API key.
// Don’t submit any personally identifiable information in requests made with this key.
// Sign in to see your own test API key embedded in code samples.
const stripePromise = loadStripe("pk_test_51Lkh0ySCNi2p6XlULbqYoTrcSzThWufaVSvEc2oJP3VABk6rHfDJx69nMldBloQ8vkS1A5BCKELBXs1yvArZrch000Hk0PCh3E");
var amount = null;
export default function App() {
const [clientSecret, setClientSecret] = useState("");
useEffect(() => {
// Create PaymentIntent as soon as the page loads
fetch("/create-payment-intent", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ amount: amount }),
})
.then((res) => res.json())
.then((data) => setClientSecret(data.clientSecret));
}, []);
const appearance = {
theme: 'stripe',
};
const options = {
clientSecret,
appearance,
};
return (
<div className="App">
{clientSecret && (
<Elements options={options} stripe={stripePromise}>
<CheckoutForm />
</Elements>
)}
</div>
);
}
where can i found pi_xxxx
where can i found pi_xxxx
You could log the ID from your backend server, or you could console.log thedata.clientSecreton the frontend
fine ??
No, I'm looking for a PaymentIntent ID, it looks like this: pi_xxx. But I'll try to find it myself by checking your account.
Also I recommend you to delete your sk_test_ key above. You should not share it online.
Actually I just deleted it for you.
You may want to roll your secret key from the Stripe dashboard now https://dashboard.stripe.com/test/apikeys
I think I found one: pi_3LmclNSCNi2p6XlU1gIneLqL Looking...
I see your account is in India, so you have some additional steps to do to process a payment, as mentioned here https://stripe.com/docs/india-accept-international-payments
In this specific case, it looks like you need to add a description to your PaymentIntent for things to work. This is mentioned here: https://stripe.com/docs/india-accept-international-payments#international-payments-for-services
Happy to help 🙂
Your account is in India, and you are creating a PaymentIntent in USD. So as mentioned on the previous link I shared:
Every international payment for services is required to have the buyer’s name, billing address and a description of the service being exported.
So when creating the PaymentIntent, make sure to include adescriptionhttps://stripe.com/docs/api/payment_intents/create#create_payment_intent-description
For US accounts it's simpler: no need to set description or create a customer.
okk got u
do u have the ready made code
now i have to create customer then do the payment intent
or any modification ??
Can you try what I suggested earlier?
So when creating the PaymentIntent, make sure to include a
descriptionhttps://stripe.com/docs/api/payment_intents/create#create_payment_intent-description
Hi there 👋 I'm jumping in as my teammate needs to step away soon. I've read through the thread to get an idea of what you're working on, but if you are still having troubles then please let me know.
hi @upper stream , then I need to create , update, retrieve customer right ??
but i dont want this details of customer , what its the other then ?
Yes, for this scenario maintaining a Customer object is required. Will you be owning/operating the Stripe account forever, or will your client take over after the development has been completed?
right now its under me but after implementation my company will purchase it and company will be owning the account
And is that a US based company?
Gotcha, so in that case I would recommend trying to change the country of the Stripe account that you're using to reflect the country of that company. Some regions, India in particular, have different rules and regulations which we must follow that makes implementing for those regions a bit harder. If the account is not going to be an India-based account, then I don't think it makes much sense to go through the hassle of setting your integration up to accept payments for an India-based company.
I don't recall offhand if you can change the country of your account via the Stripe dashboard, but if not, then I would recommend reaching out to our Support team to see if they can assist with that change.
https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Ah, sorry, I was hoping that wasn't the case (we don't know account rules as well as our colleagues on the Support team)
I would recommend going ahead and creating a new account then, and basing that account in the country of the company that will eventually own/operate it.
okk thank you
Any time!