#morbe-connect-directcharges

1 messages · Page 1 of 1 (latest)

pearl jacinthBOT
unreal badger
#

@warm iron do you have a lot more specific details than just this? Exact integration, exact code, what triggers this error, what you see in the UI, etc

warm iron
#

I'm using Stripe Connect; this is being triggered when I load into the payment page (not sure on which step though).

Could this be because the company has another domain registered?

unreal badger
#

I'm sorry I need much more information than "Stripe connect" or "payment page". There are dozens of ways to use our many products and APIs. Can you try and give me a clear and detailed summary of your exact integration, your real code an the context of the error?

warm iron
#

Okay, i'm sorry.

Lets start off where I'm getting an error.

While attempting to pay a payment intent; i'm receiving the followign response:

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such payment_intent: 'pi_3Ojs5lR8kFqDyjaM0akxYRoo'",
    "param": "intent",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_H3L02r4B83EaaG?t=1707954203",
    "type": "invalid_request_error"
  }
}

This is my code in my frontend

const handleSubmitRequest = async (data: IPaymentFormInterface) => {
        try {
            if (!stripe || !elements) return;

            const cardElement = elements.getElement(CardElement);

            if(!cardElement) return;
            if(!paymentIntent.client_secret) return;

            const { error } = await stripe.confirmCardPayment(
                paymentIntent.client_secret,
                {
                    payment_method: {
                        card: cardElement!,
                        billing_details: {
                            name: data.Name,
                        },
                    },
                }
            );

            if (error) {
                console.log(error)
                toast.error(error.message);
                return;
            }
            toast.success('Payment successful!');
        } catch (error) {
            toast.error('An error occurred. Please try again.');
        }
    };

This payment should be on behalf of a customer while using stripe connect.

unreal badger
#

Okay perfect! Let me have a look

#

The PaymentIntent you shared you created it on the connected account. This means that you are using our Direct Charges flow of funds https://stripe.com/docs/connect/direct-charges where server-side you pass the Stripe-Account header/option on the PaymentIntent creation.

But client-side in your Javascript, you forgot to do the same thing, so we're looking for the PaymentIntent in your own platform account where it does not exist, hence the error.

You missed this step: https://docs.stripe.com/connect/authentication#adding-the-connected-account-id-to-a-client-side-application

#

morbe-connect-directcharges

warm iron
#

Thank you! I just added the stripeAccountId and it worked.

unreal badger
#

awesome!

warm iron
#

One more question. Why am i not seeing the apple pay option with my stripe element component?

#

I remember that i had to like register a domain to the company?

#

I believe i do have it registered but still is not displaying on my frontend

unreal badger
warm iron
#

I actually do it on my onboard method.


            var options = new PaymentMethodDomainCreateOptions { DomainName = _configuration["WEB_DOMAIN"]};
            var requestOptions = new RequestOptions
            {
                StripeAccount = stripeAccount.Id,
            };
            var service = new PaymentMethodDomainService(stripeClient);
            await service.CreateAsync(options, requestOptions);

            return await onboardstripe(companyId, user.Id);```
#

Is the domain name case sensitive?

unreal badger
#

what is the exact connected account you are looking at?

#

And can you share the exact pmd_123 for that domain you say you registered? Is Apple Pay active on it?

warm iron
#

Each acccount has to activate it or i can activate it for them acct_1OjrySR8kFqDyjaM?

I don't think is active yet

unreal badger
#

You are the platform. You control everything for them

#

So right now you have a problem, you don't seem to have configured ApplePay properly on your server and that's the issue

#

Right now it looks like you have a weird redirect to that domain. You tried to add govalet.app but your server redirects to www.govalet.app. So you should add www.govalet.app instead

warm iron
unreal badger
#

You are the platform. You control everything for them

warm iron
#

But these companies get an option on their onboard to add their "business website"; this does not affect applepay at all, right? Only the ones i register.