#udzhin_dev
1 messages · Page 1 of 1 (latest)
If you're using stripe you shouldn't need to integrate google pay directly with google
You should use https://stripe.com/docs/stripe-js/elements/payment-request-button or https://stripe.com/docs/elements/express-checkout-element
Google's documentation states that you can make a button using their code and the MerchantId of a service provider such as Stripe
Where does it say you can do that for Stripe?
I realize that I can use Stripe directly, but my host does not allow me to deploy Stripe and make payments
Yeah but that's through our integration
We don't support just using Stripe as the gateway
You'd need to integrate fully with us + google pay
I tried, but I keep getting an error.
Which integration guide did you try?
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...
In addition to all this, I now have a link button on my website instead of gPay.
Which error are you referring to?
This
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
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?
That's your code calling /create-payment-intent though...
What do you need to customize?
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
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
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
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
I'm not familiar with the guide you're following, but if you want to use the payment request button, I recomend following our docs, which walk you through this: https://stripe.com/docs/stripe-js/elements/payment-request-button
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?
That depends on which language and framework you want for the server
Are you a developer?
Yes, I am a developer, just encountering Stripe connectivity for the first time, is it possible to use php for this?
Yes you can use php
We have a php sdk
Refer to the guide I linked above
You can toggle php for the snippets
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');
Hi 👋 I"m stepping in as @ripe stone needs to go.