#asdfghi-save_and_reuse

1 messages · Page 1 of 1 (latest)

silent thunder
#

hi there! can you share more on what you're comparing to? i.e. you say that on server site for creating charges should I create another route or same rout we can use? - what's the same route which you're referring to?

fickle gull
#

after 2 days I am running this server

#

Charge is not happening.
Am I missing anything here?

silent thunder
fickle gull
#

Hi. Backend code is saying errors

silent thunder
fickle gull
#

Would this help? req_bkzj5dYG6kEgaX

silent thunder
#

i'm not seeing any errors from the request itself. Which line of your code is throwing an error?

fickle gull
#

this route I am using the charge.create but I am not seeing logs of this charge API

silent thunder
#

If I look at the requests made to Stripe in your Dashboard logs [0] , I'm only seeing requests to create SetupIntents.

There're no requests to create a PaymentIntent. I'm guessing that your application never makes the request to the route that creates a PaymentIntent.

You're going to need to walk through your application code step by step to verify where it's making the request to create a PaymentIntent / where the issue is

[0] https://dashboard.stripe.com/test/logs?method[]=post&method[]=delete&direction[]=connect_in&direction[]=self,

fickle gull
#

I am now saving the card from the client app.

As I want to charge later which is after 2days. How should I write the server?

silent thunder
#

ah okay, sorry, i forgot that you wanted to charge after 2 days. You need to implement your server logic to create the PaymentIntent after 2 days. How you do that is entirely up to you e.g. you may want to run a cron job to run at a certain time or at intervals once a day

fickle gull
#

Thanks! which stripe APIs that I should call in side the program?

#

app.post('/payNow', async (req, res) => {
try {
const paymentMethods = await stripe.paymentMethods.list({
customer: customer.id,
type: 'card',
});

const paymentIntent = await stripe.paymentIntents.create({
amount: 8000,
description: 'professor react-native',
payment_method_types: ['card'],
currency: 'inr',
customer: customer.id,
off_session: true,
confirm: true,
});
} catch (err) {
// Error code will be authentication_required if authentication is needed
console.log('Error code is: ', err.code);
}
});
this is my current server app. But I dont think it is correct at all

silent thunder
#

a cron job isn't related to Stripe APIs, you may want to search online for how to implement cron jobs

south bay
#

Hi @fickle gull I'm taking over this thread, let me know if you have any questions