#sapient_api
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/1295336697550077953
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! sorry I can't understand what these words mean:
but when this process is done that time when i redirect ???
in website i pass success url but for application ??
yes
Hey! Taking over for my colleague.
Could you please share more details about your ask ?
this is my code
addProductPriceSessionInStripe: async (
stripe_product_price_id,
stripe_customer_id,
existUser,
client_medical_info_id
) => {
try {
const session = await stripe.checkout.sessions.create({
mode: "payment",
billing_address_collection: "required",
phone_number_collection: {
enabled: true,
},
line_items: [
{
price: stripe_product_price_id,
quantity: 1,
},
],
invoice_creation: {
enabled: true,
},
customer: stripe_customer_id,
metadata: {
client_id: existUser[0].client_id,
client_full_name: existUser[0].client_full_name,
client_email: existUser[0].client_email,
client_medical_info_id: client_medical_info_id,
},
// Redirect to the client
success_url: ${USER_FRONTEND_URL}payment-success,
cancel_url: ${USER_FRONTEND_URL}payment-failed,
});
return session;
} catch (error) {
console.error("Error creating Stripe session:", error);
throw error; // This will allow the caller to handle the error appropriately
}
},
it is working very well in my website
but when i implement this code in application that time which url put in succes and faild
// Redirect to the client
success_url: ${USER_FRONTEND_URL}payment-success,
cancel_url: ${USER_FRONTEND_URL}payment-failed,
but when i implement this code in application that time which url put in succes and faild
Could you please elaborate more about this ?
in simple word which url is put instead of success and failed when i implement in applicaiton side
You need to put your frontend url
that handles the success/failure post-payment status
you can implement a success/failure page for example
in website it is possible but in appliaction it is posssible ??
In application, you mean like mobile app ?
yes
You shouldn't be using Checkout Seesion
in that case
You should be using PaymentSheet
If you want strongly to use Checkout Session with mobile app
then you can configure deep links
For example on Android you should be following this:
https://developer.android.com/training/app-links/deep-linking
ok