#plark_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1262365101114265630
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- plark_best-practices, 13 minutes ago, 17 messages
- plark_best-practices, 6 days ago, 12 messages
- plark_best-practices, 6 days ago, 16 messages
- plark_best-practices, 6 days ago, 15 messages
Can you share the code you're using the initialise Stripe.js and the Express Checkout Element
This is server-side:
const functions = require("firebase-functions/v1");
const stripe = require("stripe")(process.env.KEY3);
const express = require("express");
// const bodyParser = require('body-parser');
const cors = require("cors");
const app = express();
app.use(cors());
app.use(express.json());
app.post("/create-intent", async (req, res) => {
try {
const intent = await stripe.paymentIntents.create({
amount: (+req.body.quantity * +req.body.price * 100),
currency: req.body.currency,
});
res.json({client_secret: intent.client_secret});
catch (error) {
console.error("Error creating payment intent:", error);
res.status(500).json({error: "Failed to create payment intent"});
}
});
exports.app = functions.https.onRequest(app);
This is client-side:
const stripe = Stripe(pkTEST);
const appearance = { }
const options2 = {
buttonHeight: 50,
layout:{
overflow: 'never'
},
}
const elements = stripe.elements({
mode: 'payment',
amount: 250,
currency: 'aud',
appearance,
})
const expressCheckoutElement = elements.create('expressCheckout', options2)
is this useful?
Can you share a pi_xxx ID
It'll be in the intent response of this call:
amount: (+req.body.quantity * +req.body.price * 100),
currency: req.body.currency,
});```
The likelihood is that you haven't verified your domain for Apple Pay usage: https://docs.stripe.com/apple-pay?platform=web#verify-domain
Sorry for so response
You don't seem to be using Connect from what you've shared, so the original link you shared is irrelevant
const paymentMethodDomain = await stripe.paymentMethodDomains.create({
domain_name: 'example.com',
});
Is it this line?
Is my server side supposed to have that?
I thought i'd otherwise verified the domain for apple pay (e.g uploaded the merchant id)
That is the API call to register the domain yes, but you need to upload files to your server host specifically for Apple Pay verification as noted at the link
Not necessarily if you've done it via the Dashboard
(if you share some kind of object ID from your account I can check all of this)
Hm. OK, so assuming I have uploaded the apple-developer-merchantid-domain-association file and got the domain registered (I can share a screenshot of the verified page if helpful) - is there naything else it could be?
In the stripe dashboard, in the payment method domains, if I filter by 'verified' in Apple verification, my domain remains in the list
I may check it doesn't have anything to do with using a test key
thanks
As I said, if you can share an object ID or your account ID I can probably tell you the exact issue
Right now I'm just guessing based on limited info
here is the account id: acct_1PRBdZHbz90rWyEA
And the domain where Apple Pay doesn't load?
Looks like localhost based on the referrer for some of your intent confirmations? https://dashboard.stripe.com/test/logs/req_zh65IrTuaaTGtG
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
In which case you need to use a tunnel like ngrok so your localhost is actually accessible for Apple to verify and you can upload the files to that 'server'
Again, an example payment ID please or somewhere I can reproduce
I see no recent live API activity on acct_1PRBdZHbz90rWyEA
So I guess you have a different account in live mode or some kind of Connect setup
A different account in live mode. Damn, this is getting complicated
'complicated' may not be the right word
I'm just guessing, only you really know if that is the case
But as I said there's no live API requests on the account denoting activity on the 'live site' like you said