#waleed.bin.khalid

1 messages ยท Page 1 of 1 (latest)

lost lichenBOT
stiff jasper
#

What's the issue?

deft ermine
#

I have created a standard connect account and do google pay using payment intent

#

it is saying imcomplete

stiff jasper
#

What payment UI are you using?

deft ermine
#

paymentRequest button

#

on react side

stiff jasper
#

Ok, and does the Google Pay button show?

deft ermine
#

yes

#

it shows because I have enabled apple google pay on plateform account

stiff jasper
#

Ok, so what happens when you click Google Pay?

deft ermine
#

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

stiff jasper
deft ermine
#

Yes I have done it

#

basically I am creating payment intent using the stripeAccount header

stiff jasper
#

Ok, and are there any errors in your browser console?

#

What is the pi_xxx ID?

deft ermine
#

shairng

#

pi_3O1oTJQltRoSK6G51eqJQuGS

#

no error in the console

stiff jasper
#

Is there somewhere I can reproduce this issue?

deft ermine
#

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

stiff jasper
#

Great, let me try it please

deft ermine
#

then add amount

#

confirm and it will show you the google pay on popup

stiff jasper
#

Thanks, will try soon

deft ermine
#

ok sure

#

it is saying this

stiff jasper
#

At what point in your UI should I see Google Pay? I don't see it

#

I got to the 'add a card' UI

deft ermine
#

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 ?

stiff jasper
#

I didn't see Google Pay no, let me check again

deft ermine
#

yeah please check

stiff jasper
deft ermine
#

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 ?

stiff jasper
deft ermine
#

but we are creating connect account for each customer

#

Each customer needs to add configuration manually ?

stiff jasper
#

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

deft ermine
#

I have enabled this domain under plateform account

#

and button is showing to me

stiff jasper
#

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?

lost lichenBOT
deft ermine
#

yes

#

hi

#

did you read above msgs or I need to explain again ?

rancid escarp
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

#

we;re still waiting for the code that you haven't shared

deft ermine
#

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

rancid escarp
#

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

deft ermine
#

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

rancid escarp
#

yes because the code isn't confirming the Payment

#

I'm looking at your source code

#

give me a minute please

deft ermine
#

yes please take your time

rancid escarp
#

ok I can see now

#

so basically you're not adding the auth header to your front-end Stripe instance

deft ermine
#

which one ?

#

const stripePromise = loadStripe(
"pk_test_51N3G7KH3CgfJQbH9UvRGNfeXUCzOLRTIpfmUH20uAEejjEIQGSJuQNMADI25hqwGMBMoGuWhwDtRw0dpdB4nEjer00lFEVhvvI"
);

rancid escarp
#

exactly

#

so your code is trying to look for a PI on the platform instead of the Connected Account

deft ermine
#

yes

#

I am also creating intent on connected acocunt

#

account

rancid escarp
#

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

deft ermine
#

while confirming payment

rancid escarp
#

no while initializing Stripe

#

with loadStripe

deft ermine
#

loadStripe is happening in stripe js

#

App.js*

#

file

rancid escarp
#

exactly

deft ermine
#

can I pass stripeAccount header in confirmPayment api ?

rancid escarp
#

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

deft ermine
#

so only problem is while confirm payment

#

I can create separate one and then call confirm payment api

rancid escarp
#

actually you need to change the one passed to the Elements tag in the App.js file

#

if I'm not mistaken

#

since you're doing a Direct Charge, you need to create a new Stripe Instance "before" you create your PaymentRequestButton

deft ermine
#

I have done this now but same thing happens

rancid escarp
#

is your code deployed?

#

can I test it?

deft ermine
#

yes

#

deployed

#

const sampleStripePromise = loadStripe(
"pk_test_51N3G7KH3CgfJQbH9UvRGNfeXUCzOLRTIpfmUH20uAEejjEIQGSJuQNMADI25hqwGMBMoGuWhwDtRw0dpdB4nEjer00lFEVhvvI", {stripeAccount: "acct_1O1nrKQltRoSK6G5"}
);

#

I have done this for now

#

added static connect id

rancid escarp
#

I don't see it

#

where did you put it?

deft ermine
rancid escarp
#

in which file I mean?

deft ermine
#

in CalculateTip file

rancid escarp
#

CalculateTip.jsx doesn't contain this

deft ermine
rancid escarp
#

that's not the file I'm seeing

#

are you sure you deployed on the environment/URL I'm checking?

deft ermine
#

are you loooking app.jsx

rancid escarp
#

I checked both

deft ermine
#

check now please

rancid escarp
#

you need to await the loadStripe, since it's a Promise

deft ermine
#

sure sure

rancid escarp
#

your code is crashing

deft ermine
#

updating

#

one sec please

rancid escarp
#

I think the better approach was to leave your code intact and just add the stripeAccount header in the App.js file

deft ermine
#

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

rancid escarp
#

let me know if you need any more help

deft ermine
#

sure I am implementing