#noor_gpay-react-native
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/1237782762480599091
๐ 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.
- noor_code, 1 day ago, 22 messages
hi
`// This example sets up an endpoint using the Express framework.
// Watch this video to get started: https://youtu.be/rPR2aJ6XnAc.
const http = require('http')
const express = require('express')
const app = express()
app.use(express.json())
const stripe = require('stripe')('sk_test_51P8pFGJez7Un1YiNlK93NNXYDWfmxQqGEVIXJmYdCO8A0L6PyJaB3DOBnx9efMXL7jSR01vUm5OacVs2pEQphfEA00TDo6huja');
app.post('/paymentsheet', async (req, res) => {
const amount = req.body?.amount
console.log("amount ", amount);
if (!amount || amount <= 0.5) {
return res.status(400).json({ message: "the amount is insufficient :" + amount });
} else if (amount > 10000) {
return res.status(400).json({ message: "Amount must be at most โฌ10,000.00 EUR"});
}
const customer = await stripe.customers.create();
const ephemeralKey = await stripe.ephemeralKeys.create(
{ customer: customer.id },
{ apiVersion: '2024-04-10' }
);
const paymentIntent = await stripe.paymentIntents.create({
amount: amount*100,
currency: 'eur',
customer: customer.id,
payment_method_types: ['bancontact', 'card', 'ideal', 'klarna', 'sepa_debit'],
});
res.status(200).json({
paymentIntent: paymentIntent.client_secret,
ephemeralKey: ephemeralKey.secret,
customer: customer.id,
publishableKey: 'pk_test_51P8pFGJez7Un1YiNs5HFPM02R2m9AQzqVq5Y0jWyCFqxn56str9fzJ44mJ3gKpScDlViFaxOPSEBGh7RU4VI2arA00Hap7qfJQ'
});
});
const port = process.env.PORT || 3000; // Use environment variable for port or default to 3000
const server = http.createServer(app)
app.listen(port, () => {
console.log(Server listening on port ${port});
});`
Hi ๐ our guide for adding Google Pay to a React Native integration can be found here:
https://docs.stripe.com/google-pay?platform=react-native
noor_gpay-react-native
<application>
...
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
</application>
add this here?
?
That seems to align with the instructions
AndroidManifest.xml
The manifest file for your app
this file inside
Is that your app?
yes
Then that sounds like the right spot
I didn't understand
Yes, it sounds like you're looking at the right manifest file then
oo ok
can you do this code here:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactnativestripesdk">
</manifest>
Because I'm afraid the app will crash
?
.
What do you mean do the code here? I'm not terribly familiar with the React Native environment, I'd suggest folloiwng the instructions as written to start.
ok ok
dont close chat
stay here for if me need help
do you have a person learned React Native?
What is the problem you're running into?
I don't know the file path where the code should be placed
The same one we already talked about? Or a different chunk of code?
Please do not try to tag our team members directly
same one we already talked about
We are not all always available.
ok
So what's the question if we already discussed the answer? Did not work, are you encountering an error of some sort?
I am facing a problem: what is the file path and how do I write it?
You have the file path, we discussed it above. If you're not familiar with making adjustments to your React Native app, you may want to work with a team member who is.
ok,, transfer me to person learn react native and he knows abou it
I have a team member who will come look when they have a minute, but their tied with something else currently.
๐