#waleed.bin.khalid
1 messages ยท Page 1 of 1 (latest)
What's the issue?
I have created a standard connect account and do google pay using payment intent
it is saying imcomplete
What payment UI are you using?
Ok, and does the Google Pay button show?
Ok, so what happens when you click Google Pay?
it goes to the iframe
like google pay iframe and shows button Pay
when I am clicking on pay button it is loading and doing nothing after that
just request timeout
Have you implemented the confirmation step after the Google Pay dialog closes? https://stripe.com/docs/stripe-js/elements/payment-request-button?client=react#react-complete-payment
Yes I have done it
basically I am creating payment intent using the stripeAccount header
Is there somewhere I can reproduce this issue?
basically I am adding stripeAccount header in create payment intent api becayse I wanted to send payment to connect account. And when I am confirming, I am also passing the stripeAccount header
yes
Great, let me try it please
https://easytipping.com/tipConfirmation go to this page and enter this id 86343984
Eazy Tipping - Tips made easier
then add amount
confirm and it will show you the google pay on popup
Thanks, will try soon
At what point in your UI should I see Google Pay? I don't see it
I got to the 'add a card' UI
when you enter amount and click on confirm
again confirm
and then you will got this popup
where there are 2 options google and via card
did you get it ?
I didn't see Google Pay no, let me check again
yeah please check
your browser is not supported for google pay i guess
I guess on stripe connect account we need to add apple pay and google pay configurations
bcz it is a standard account ?
is it ?
It is, I see Google Pay everywhere else (like https://stripe.com/docs/stripe-js/elements/payment-request-button)
but we are creating connect account for each customer
Each customer needs to add configuration manually ?
Yes, you'll need to register all domains where the wallets will be displayed on each connected account
We're not enforcing that yet (but will be soon)
That's not the issue here, to be clear
domain is same easytipping.com
I have enabled this domain under plateform account
and button is showing to me
As I said, the domain isn't the issue (we're not enforcing domain registration yet) as the button wouldn't even show
Still isn't for me
Can you share your Payment Request Button code?
๐ taking over for my colleague. Let me catch up.
we;re still waiting for the code that you haven't shared
const pr = stripe.paymentRequest({
country: stripeCountry,
currency: stripeCurrency,
total: {
label: "Total tip amount",
amount: Number((tipAmount ? tipAmount * 100 : 0).toFixed(0)),
},
requestPayerName: true,
requestPayerEmail: true,
disableWallets: ["link"],
});
payment request
const createPaymentIntent = async (
paymentMethodType,
currency,
amount,
stripeConnectedAccountId,
finalFee = null
) => {
const params = {
// payment_method_types:
// paymentMethodType === "link" ? ["link", "card"] : [paymentMethodType],
amount: amount * 100,
currency: currency,
automatic_payment_methods: {
enabled: true,
},
// transfer_data: {
// destination: stripeConnectedAccountId, // Connected account ID
// amount: finalFee * 100
// }
};
console.log('params=========>', params)
const stripeAccount = { stripeAccount: stripeConnectedAccountId };
const paymentIntent = await stripe.paymentIntents.create(params, stripeAccount);
// console.log(paymentIntent);
return paymentIntent;
};
create payment intent
const {
error: stripeError,
paymentIntent,
} = await stripe.confirmCardPayment(
clientSecret,
{
payment_method: e.paymentMethod.id,
},
{ handleActions: false }
);
confirm payment
I guess my colleague shared this before https://stripe.com/docs/stripe-js/elements/payment-request-button?client=react#react-complete-payment
but I don't see it in your code
you're not completing the payment with your code
....
ev.complete('success');
...
I tried your website and I was able to go through the Google Pay and yes your code is not handling the event completion and the confrimation of the payment
lemme show you
if (stripeError) {
return;
}
if (paymentIntent && paymentIntent.status === "succeeded") {
e.complete("success");
} else {
toast.error("Next something went wrong with the payment");
}
this is what I have done in my code
you have done 10$ transaction and see it is saying incomplete
yes because the code isn't confirming the Payment
I'm looking at your source code
give me a minute please
yes please take your time
ok I can see now
so basically you're not adding the auth header to your front-end Stripe instance
which one ?
const stripePromise = loadStripe(
"pk_test_51N3G7KH3CgfJQbH9UvRGNfeXUCzOLRTIpfmUH20uAEejjEIQGSJuQNMADI25hqwGMBMoGuWhwDtRw0dpdB4nEjer00lFEVhvvI"
);
exactly
so your code is trying to look for a PI on the platform instead of the Connected Account
yes this is why it's not working
your front-end Stripe object should take into account that this is a Destination Charge
so you need to pass in the StripeAccount header
as explained here
while confirming payment
exactly
can I pass stripeAccount header in confirmPayment api ?
if the StripeAccount is dynamic and you don't want to put in the App.js file, then you would have to create one each time
so only problem is while confirm payment
I can create separate one and then call confirm payment api
actually you need to change the one passed to the Elements tag in the App.js file
if I'm not mistaken
basically it's explained here https://stripe.com/docs/stripe-js/elements/payment-request-button?client=react#react-using-with-connect
since you're doing a Direct Charge, you need to create a new Stripe Instance "before" you create your PaymentRequestButton
it's also explained here https://stripe.com/docs/connect/authentication?client=create-client-react#adding-the-connected-account-id-to-a-client-side-application
I have done this now but same thing happens
yes
deployed
const sampleStripePromise = loadStripe(
"pk_test_51N3G7KH3CgfJQbH9UvRGNfeXUCzOLRTIpfmUH20uAEejjEIQGSJuQNMADI25hqwGMBMoGuWhwDtRw0dpdB4nEjer00lFEVhvvI", {stripeAccount: "acct_1O1nrKQltRoSK6G5"}
);
I have done this for now
added static connect id
in which file I mean?
please check this file
that's not the file I'm seeing
are you sure you deployed on the environment/URL I'm checking?
are you loooking app.jsx
I checked both
check now please
you need to await the loadStripe, since it's a Promise
sure sure
your code is crashing
I think the better approach was to leave your code intact and just add the stripeAccount header in the App.js file
yes you are right But In our app there are 2 users guest and app users
I will change it further if it works here
let me know if you need any more help
sure I am implementing