#waleed.bin.khalid
1 messages · Page 1 of 1 (latest)
hi
previously I was just creating payment intent and confirming payment from react side
while before I was not using stripeAccount header while creating pyament intent but Now I am adding this header
and it is saying pyament method required
I am doing apple pay/ google pay to connect account
Hi, let me help you with this.
great
Could you please share the PaymentIntent ID?
Looking...
oh sorry
Why are you not confirming the PaymentIntent?
I am confirming the payment from frontend
lemme show you
const pr = stripe.paymentRequest({
countryCode,
country: "US",
currency: currencyCode === "" ? "usd" : currencyCode.toLowerCase(),
total: {
label: "Total tip amount",
amount: Number((tipAmount ? tipAmount * 100 : 0).toFixed(2)),
},
requestPayerName: true,
requestPayerEmail: true,
disableWallets: ["link"],
});
pr.canMakePayment().then((result) => {
if (result) {
setPaymentRequest(pr);
if (!result?.applePay) {
setIsApplePayDisabled(true);
}
}
});
First I am creating payment request like this
then this is how I am creating payment-intent through backend api
and confirming that payment as well on react side
Do you see any errors?
this on stripe
on frontend while making payment it is showing error in payment just
Sorry I don't understand.
on frontend while making payment through wallet
it is just showing this message "there is some error with your payment just"
When I go to stripe connect account to track that erorr it is showing me payment method required in pyament intent
Could you please show me the whole error message?
i guess this is the error message. It is occuring while confirm the payment
pyament intent id exists on connect account only not on merchant account
but I believe after creating payment intent on stripe connect account. It is trying to confirm payment on stripe merchant account not on connect account
Thanks, this is very helpful.
This seems like a typical error when using Stripe-Account headers.
Could you please paste the pi_xxx here?
This PaymentIntent was created on the Connected Account, therefore you'll need to use Stripe-Account header to confirm it: https://stripe.com/docs/connect/authentication?client=create-client-react#adding-the-connected-account-id-to-a-client-side-application
How are you doing this exactly?
can we add stripeAccount header in
const {
error: stripeError,
paymentIntent,
} = await stripe.confirmCardPayment(
clientSecret,
{
payment_method: e.paymentMethod.id,
},
{ handleActions: false }
);
api
How are you doing this now?
Please remove the keys from your message.
@regal rampart
const checkConnectId = () => {
if (connectAccountId !== "") {
stripePromise = loadStripe(
"pk_test_...",
{ stripeAccount: connectAccountId }
);
} else {
stripePromise = loadStripe(
"pk_test_..."
);
}
};
Did that for you.
Are you sure your code picks the first path here?
I am storing connect account id in reduc store
redux, I have card payments and wallet payments. For cards it is fine without that stripeAccount header
in wallet payment I do need that
thats why
Could you please validate if it actually adds the stripeAccount header? Because it seems like the most obvious place.
how can i confirm that ?
Look at the call and make sure the Stripe account's ID is getting passed in to the call as shown in this doc https://stripe.com/docs/api/connected_accounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can we add stripeAcccount header while confirmPayment
const {
error: stripeError,
paymentIntent,
} = await stripe.confirmCardPayment(
clientSecret,
{
payment_method: e.paymentMethod.id,
},
{ handleActions: false }
);
in this api?
Yes, that is how you confirm a direct charge payment intent
Keep in mind that the intent needs to be created using the same stripeAccount header for the confirm call to work
yes yes, intent is creating using stripeAccount header
how can I add stripeAccount in this confirm payment aoi
api*
there ?
What client side library are you using?
Like what library is making that confirm call?
stripe js
react is on frontend
in my case I have multiple connect account. Which will be getting from backend afterward but not when react app loads in dom
that is why I want to add stripeAccount header in confirm api instead of loadStripe api
what you say
When.you initialize Stripe.js you will want to pass the stripeAccount header https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
At the time of initialization, what if I dont have connect account id
?
becasue there is scenario iin our application, payment giver select any user to pay. when that user selected then we can get connect id from backend related to that selected user
?
I actually don't think that you can dynamically change the stripeAccount header after initializing it at first