#udzhin_dev

1 messages · Page 1 of 1 (latest)

full egretBOT
ripe stone
#

Can you link the doc you are following?

#

I don't reccognize the above code snippet

ripe stone
#

If you're using stripe you shouldn't need to integrate google pay directly with google

plucky rose
#

Google's documentation states that you can make a button using their code and the MerchantId of a service provider such as Stripe

ripe stone
#

Where does it say you can do that for Stripe?

plucky rose
#

I realize that I can use Stripe directly, but my host does not allow me to deploy Stripe and make payments

ripe stone
#

Yeah but that's through our integration

plucky rose
ripe stone
#

We don't support just using Stripe as the gateway

#

You'd need to integrate fully with us + google pay

plucky rose
#

I tried, but I keep getting an error.

ripe stone
#

Which integration guide did you try?

plucky rose
#

I even tried contacting the host provider, but I couldn't find a sensible answer for this error.
If it plays an important role, the site is written using pure JS and PHP, without using React and NodeJS

#

Learn the front end steps for accepting a payment with Google Pay from your customers using a custom form with HTML and JavaScript. You'll learn how to use the payment request button and how to use the confirmCardPayment method from Stripe.js to securely confirm a PaymentIntent client-side. This method handles 3D Secure and Secure Customer Authe...

▶ Play video
#

In addition to all this, I now have a link button on my website instead of gPay.

ripe stone
plucky rose
ripe stone
#

That's a 404 when trying to reach your /create-payment-intent endpoint

#

That's an integration error on your end

#

The route doesn't exist on that domain

plucky rose
#

But I did everything as shown in the video and it didn't say /create-payment-intent endpoint

#

And I have one more question, how exactly do you need to set up Google Pay in Stripe Dashboard. I have this method enabled, but maybe I can customize it in more detail?

ripe stone
#

That's your code calling /create-payment-intent though...

#

What do you need to customize?

plucky rose
#

Let's go in order, how do I solve the endpoint problem? The video I used to integrate Stripe didn't say anything about it

ripe stone
#

I don't know what your code is doing. You do

#

If you can share your code I can help

#

You need to figure out why you call /create-payment-intent

#

That's 404ing because that endpoint doesn't exist on that domain

#

Do you have that endpoint set up?

#

If so, you need to figure out where it's being served from

plucky rose
#

No problem, here is my code and I don't have the endpoint configured and I don't have it on the server because I have no idea how to configure it or where to get it from

ripe stone
#

You call it right here:

            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                paymentMethodType: 'card',
                currency: 'chf'
            }),
        }).then(r => r.json());
        console.log('Client secret returned');```
#

I don't have the endpoint configured and I don't have it on the server
That's the issue. That's why you're getting the error

#

You need to add an endpoint on your server that creates and returns a payment intent

plucky rose
#

I roughly understand what I need to do, but here's one thing, how do I refer to the endpoint file?
There is a main client side file "google_pay.js", but what should be the extension of the server file for example "gpay_server.?" and how do I access it?

ripe stone
#

That depends on which language and framework you want for the server

#

Are you a developer?

full egretBOT
plucky rose
#

Yes, I am a developer, just encountering Stripe connectivity for the first time, is it possible to use php for this?

ripe stone
#

Yes you can use php

#

We have a php sdk

#

Refer to the guide I linked above

#

You can toggle php for the snippets

plucky rose
#

So this is where I need to put the location of the php file?
const {clientSecret} = await fetch('/create-payment-intent.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
paymentMethodType: 'card',
currency: 'chf'
}),
}).then(r => r.json());
console.log('Client secret returned');

vapid glen
#

Hi 👋 I"m stepping in as @ripe stone needs to go.