#kbb_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/1225600363323850903
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, what's the checkout session ID?
To clarify on "I would like to check who the payer is before capturing", you mean you want to do a manual capture with checkout sessions? https://docs.stripe.com/payments/place-a-hold-on-a-payment-method#authorize-only
i have this ID pi_3P20WkEktYhcBqrK0hRvlVea, does it help?
yes i think that is what i want
currently
- payer clicks buy
- redirect to stripe.com, payer provides funding details
- return to
success_url, and funds already "transferred" to me
what i want
- payer clicks buy
- redirect to stripe.com, payer provides funding details
- return to
success_url, but funds not "transferred" to me yet - based on details now provided by stripe, i will decide whether to accept the funds from this payer
Ok, if I understand you correctly, you want to block certain transactions based on your criteria?
https://docs.stripe.com/radar/rules/reference#rule-processing-and-ordering you can achieve it through a custom radar rule
waittt
i don't want to be passing these rules to stripe, it is going to complicate matters
is what i want possible?
Or maybe you can tell me what criteria you'll use to decide whether to pass or block a payment?
it varies from project to project, i just want to give my PHP library the ability to reject an incoming payment
sometimes, if there is heavy traffic trying to grab tickets
i also need this in order to see if the ticket is still available
before capturing the payment
if the ticket is no longer avilable, i need to reject the payment
how do i perform the next step to capture payment if i do this?
Ok, here's my suggestion,
- You should check your inventory before creating a checkout session.
- Or refund the payment if your inventory can't satisfy the order
- Or you can do manual capture (refer to the link I sent earlier), and only capture the payment if your inventory can satisfy the order.
i tried this and it did not work.. any idea?
$params['payment_method_types'] = ['card'];
$params['payment_intent_data'] = [
'capture_method' => 'manual',
];
$checkout_session = $this->getClient()
->checkout
->sessions
->create($params);
return $checkout_session->url;
it says: You can not pass payment_intent_data in subscription mode.
That's expected. you can't use capture_method in a subscription mode subscription.
ok, what can i do?
i mean, subscription/payment etc, kind of means the same thing to me, i want to ensure i can fulfil the customer b4 capturing the funds
No, payments and subscriptions are two different things, and the scenario that you described earlier doesn't look like a subscription to me.
i only want to "ensure" at the last moment, and then capture the funds, otherwise payers can hog the inventory by taking their own sweet time to complete the stripe portion
have you checked pi_3P20WkEktYhcBqrK0hRvlVea? there is a payment of SGD233+ also, correct??
Ok, for recurring payments, you can listen to invoice.created webhook events. If your inventory is low and can't support the order, you can pause the subscription https://docs.stripe.com/billing/subscriptions/pause-payment so that your customer won't be charged
What do you want me to check?
an amount of about SGD233+ was collected, which to me is a payment, not subscription
how do i manually capture that SGD233+?
A subscription will create invoices, and invoice will create payment_intent for collecting payments.
Are you asking if you can manually capture payments created by subscription invoices? No.
You can implement your own logic to determine if a customer is eligible for subscription before creating subscription mode checkout session.
i meant after the checkout URL
because i rely on stripe to reliably establish the identity of the payer's email address
No, Stripe won't validate your customer's email address
not that per se
nevermind
despite the API being so big, it is so restrictive when it comes to subscriptions
let me rephrase my problem:
on stripe's checkout session, there is GPay and Pay with Link, so i rely on the payer choosing GPay as a means to validate who the payer really is
if this payer has misbehaved in the past, i would like to prevent them from subscribing
You mean you want to limit the subscriptions to customer who have Link or Google Pay accounts ?
yes that would be ideal, but also more importantly, preventing subscription AFTER returning from stripe.com
Can you help me understand this part: "preventing subscription AFTER returning from stripe.com" ? Walk me through an example please.
ok, let's use GPay example
- user tells me they are good@b.com, so they click subscribe with stripe and gets redirected to stripe.com
- then they click
GPayand returns to us, but stripe now tells me it is bad@b.com who has subscribed and paid SGD233+ - what I want is: after they click
GPayand returns to us, i now know it is actually bad@b.com, so i can stop there and prevent bad@b.com from subscribing and having paid the SGD233+ - you can imagine my nightmare today of having to cancel the subscription, refund the SGD233+ and paying the transaction fees
my problem is #4 and i like a solution for it please
Then you implement your own email validation. As I said earlier, Stripe doesn't validate customer's email.
i can validate good@b.com but it doesn't change a thing
stripe will still tell me hey, bad@b.com just subscribed to you and paid SGD233+, good luck!
what i'm asking for is for stripe to ASK me: hey, bad@b.com wants to subscribe and pay SGD233+, can?
which i can reply: CANNOT or CAN
Here's how you can fix this problem
- Collect the email address from your customer, and validate it
- When you create a checkout session, specify the validated email address in the
email_addressfield (https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer_email) - Stripe chcekout will pre-fill this email and your customer won't be able to change it on the checkout page.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
does this also work if payer picks GPay?
Yes
are you certain GPay will return a user specified email address instead of the one that was used to create the GPay account?
Please try it out, feel free to reach out again with relevant request IDs if you have further questions.
i want to stop the session AFTER stripe returns to my website, but instead, you turned it into a email validation process which still doesn't allow me to stop the session
so maybe let me rephrase the problem once again:
can i STOP/TERMINATE completion of the session AFTER stripe returns to my website? Or is there no way this can be achieved?
There's no need to shout
shouting is all caps, i'm merely highlighting the keywords that i think you missed
I'm trying my best to help you here, and I do hope I can have some respect. I really hope it can be a misunderstanding in a way that you choose to communicate with people.
The session is already complete when your customer returns from Stripe checkout page to your website.
So to answer your question, there's no way to stop/terminate completions of the checkout session after your customer returns to your website/
Is there anything else I can help with?
nothing else thanks, but you do seem very sensitive to caps, which was in no way shouting as i explained.