#pratik-zinzala_code

1 messages ¡ Page 1 of 1 (latest)

gilded hornetBOT
#

👋 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/1265643926275231867

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sinful ferry
#

hi there!

#

can you share a PaymentIntent ID (pi_xxx) that should have saved the card but didn't?

quiet wadi
#

pi_3Pg4EgFkorCYEiZC0NwGQlv7

sinful ferry
#

thanks! give me a few minutes to look into this.

quiet wadi
#

ok

sinful ferry
#

are you using the PaymentSheet with iOS, Android, React Native, or something else?

quiet wadi
#

i am using PaymentSheet in android

sinful ferry
quiet wadi
#

we are doing this at backend

#

public Customer createStripeCustomer(User user) {
// TODO Auto-generated method stub
Stripe.apiKey = StripeKey;
try {
CustomerCreateParams params = CustomerCreateParams.builder().setName(user.getCallName())
.setEmail(user.getEmail()).build();
Customer customer = Customer.create(params);
System.out.println(customer.getId());
return customer;

    } catch (StripeException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return null;
}
#

public PaymentIntent createPaymentIntenet(Long finalamount) {
Stripe.apiKey = StripeKey;
PaymentIntentCreateParams params = PaymentIntentCreateParams.builder()
.setAmount(finalamount)
.setCurrency("usd")
.addPaymentMethodType("card").
setCaptureMethod(PaymentIntentCreateParams.
CaptureMethod.MANUAL).
build();

    try {
        PaymentIntent paymentIntent = PaymentIntent.create(params);
        return paymentIntent;
    } catch (StripeException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return null;
}
sinful ferry
#

and do you see a checkox on the app to save the payment for later? if so, can you share a screenshot?

quiet wadi
#

we are saving card by checking checkbox but it is not working

sinful ferry
#

can you try making a new test payment, and checking the box? and then share the PaymentIntent (pi_xxx)?

quiet wadi
#

pi_3Pg4fDFkorCYEiZC11VQhITC

#

use this

sinful ferry
#

that PaymentIntent was created but never confirmed

#

can you enter the payment details in the PaymentSheet, click on the checbox, and then click "pay"?

quiet wadi
#

yes now i have completed payment can you please try again

#

using same id

#

pi_3Pg4fDFkorCYEiZC11VQhITC

sinful ferry
#

well that card can be reused

#

the PaymentIntent has setup_future_usage: "off_session",

quiet wadi
#

where i have to implement this in dash board or in backend

#

??

sinful ferry
#

I don't understand the question sorry

quiet wadi
gilded hornetBOT
quiet wadi
#

what should i do for setup_future_usage ,did i need to change something in my backend code or change in dashboard as you already have my code

upbeat tide
#

not sure what you mean, what specifically is the problem ,what do you expect to happen/what do you expect to see versus what actually happens?

quiet wadi
#

I want to save my card defaulty as i click the checkbox to save for further payments and it wasnt saved

upbeat tide
#

how could it be saved? you didn't pass a customer when creating the PaymentIntent, so there's nothing to save it to.

quiet wadi
#

after clicking its not showing the card which i have added and it was showing the to add the card details again

quiet wadi
quiet wadi
#

so can you give me the code reference in backend for spring boot code and take the help of code which i have given you before

upbeat tide