#pratik-zinzala_code
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/1265643926275231867
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
can you share a PaymentIntent ID (pi_xxx) that should have saved the card but didn't?
pi_3Pg4EgFkorCYEiZC0NwGQlv7
thanks! give me a few minutes to look into this.
ok
here's the request to create that PaymentIntent: https://dashboard.stripe.com/test/logs/req_7Tnduz4tfJcQsk
there you can see there's no setup_future_usage set or any customer, so it's expected that this card isn't savec on the Customer.
are you using the PaymentSheet with iOS, Android, React Native, or something else?
i am using PaymentSheet in android
I think you are missing this step: https://docs.stripe.com/payments/accept-a-payment?platform=android#add-server-endpoint
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;
}
and do you see a checkox on the app to save the payment for later? if so, can you share a screenshot?
can you try making a new test payment, and checking the box? and then share the PaymentIntent (pi_xxx)?
that PaymentIntent was created but never confirmed
can you enter the payment details in the PaymentSheet, click on the checbox, and then click "pay"?
yes now i have completed payment can you please try again
using same id
pi_3Pg4fDFkorCYEiZC11VQhITC
well that card can be reused
the PaymentIntent has setup_future_usage: "off_session",
I don't understand the question sorry
i am not getting this
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
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?
I want to save my card defaulty as i click the checkbox to save for further payments and it wasnt saved
how could it be saved? you didn't pass a customer when creating the PaymentIntent, so there's nothing to save it to.
after clicking its not showing the card which i have added and it was showing the to add the card details again
how can i do it from backend or frontend
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
sure, look at the code samples at https://docs.stripe.com/payments/save-during-payment?platform=android&mobile-ui=payment-element#add-server-endpoint and adapt into your existing backend code.