#user1352 - issue
1 messages · Page 1 of 1 (latest)
You'll have to be more specific. What technologies are you using?
Node js
Also you should always set prices on the server, it's more secure
How then my total be add to server if there amount
`
app.post('/create-payment-intent', async (req, res) => {
const {paymentMethodType, currency} = req.body;
// Each payment method type has support for different currencies. In order to
// support many payment method types and several currencies, this server
// endpoint accepts both the payment method type and the currency as
// parameters.
//
// Some example payment method types include card, ideal, and alipay.
const params = {
payment_method_types: [paymentMethodType],
amount: 1999,
currency: currency,
}
`
It in the parameters the amount
In a post function
How send Paramus or amount to server make test recharge
`
app.get('/config', (req, res) => {
res.send({
publishableKey: process.env.STRIPE_PUBLISHABLE_KEY,
});
});
`
Do I use get method in server ?
Hello, stepping in and catching up
You should always set your Price on server. What do you want to do exactly?
I have prise in crad.js how I send to the server to make test payment
The server have only 1999
That's not a good idea, because a tech-savy customer can intercept your request, and change the amount middle way
for example you were suppose to send 100$ to your server, they will intercept their network, change the request to 10$ to your server
they will pay you 10$, and use your 100$ service
I meant, you shouldn't send the price from client to server anyway
You know the total it change from one to another
So I have to change the amount in the server because it have only one prise
var totalprice = 10.00 ,
In card.js
How I make test by send the totalprice to the server
Or how Make the server use the totalprice in the card.js as test payment
?
I am not fully follow the reason, but to dynamically change price, you can always send it from client to server, correct?
Just send it as a parameter in POST request, then receive it in server
`
app.post('/create-payment-intent', async (req, res) => {
const {paymentMethodType, currency} = req.body;
// Each payment method type has support for different
`