#ujwal_webhooks
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ujwal_webhooks, 3 days ago, 34 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253316126134505562
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Can you explain further? You want to restrict trials based on card details?
I mean let say x enrolled free trial. his free trial expired. He can again enroll using different email. But I can restrict that. I want to restrict x's free trial with their payment card's or ids as well. How can I achieve that using webhooks.
Got it. You'd need to implement this manually, by looking at the fingerprint/last4 on the card associated with the trial sign up: https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am capturing customer.subscription.created event on my webhook. What info in this packet can be used to retrieve the fingerprint/last4 on the card associated with the trial sign up
Do you have an example evt_xxx?
Yes evt_1PTjPpGCrUuSimJTlkcZZd58
evt_1PTP5dGCrUuSimJT5sA2x4ce
Hmm, that's an invoice.paid event. In any case, you're using Checkout so we'll set default_payment_method on the Subscription with the card details used. You can then lookup that field via the API: https://docs.stripe.com/api/payment_methods/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That will have the card[last4] and card[fingerprint] fields
Please refer this
Yep, see default_payment_method field on that
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
You're looking at save_default_payment_method. But you should look at default_payment_method instead
Okay I have got this
pm_1PTjPhGCrUuSimJTnJQkzTnX
Just a question here. is this ID same if say someone else is trying to use the same card or payment method or different.
No, it's unique. As my colleague suggested, you should use fingerprint or last4 property of this PaymentMethod. You can retrieve it by ID via API: https://docs.stripe.com/api/payment_methods/retrieve
Okay so Card Fingerprint is unique for a payment method. Like if they use Gpay, or apple pay. Even then Card Fingerprint is 1 for one payment method? Am I right?
I mean can we just check card fingerprint and be sure that it can be used once for the free trial. Is it true?
Correct.
Thanks a ton,
Here is another one.
User signs up for the 7 day free trial.
He/she cancells on the 3rd day.
Even 'x' is fired. Still 4 days are left.
After 4 days event 'y' is fired. So I can remove his/her access.
Basically 'y' is a confirmation that the subscription is cancelled and you should remove the access.
Can you help with which events are these on 'x' and 'y'
๐ stepping in as vanya needs to step away
The two Events you want are customer.subscription.updated and customer.subscription.deleted
Really the best thing to do here is to test this end-to-end using a Test Clock: https://docs.stripe.com/billing/testing/test-clocks
customer.subscription.updated is x
customer.subscription.deleted is y
Correct?
Yes
Can we use subscription_schedule.canceled in place of x
That depends on your integration
I mean will it be fired in case of event like x
That depends on if you are canceling the Subscription Schedule, but generally no.
evt_1PTjPqGCrUuSimJTmfnZr639
I have a First name field in the subscription payment page. How to retrieve that in the from webhooks and how. I am not finding that field anywhere
You want to retrieve the PaymentMethod and look at its billing_details: https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details
The billing details are taking the Name on Card field as name field. I am not finding my Added First name field in the billing details.
{
"id": "pm_1PTlFyGCrUuSimJTehYcLv01",
"object": "payment_method",
"allow_redisplay": "limited",
"billing_details": {
"address": {
"city": "",
"country": "IN",
"line1": "",
"line2": "",
"postal_code": "",
"state": ""
},
"email": "kumar.ujwalit@gmail.com",
"name": "Ujwal2",
"phone": ""
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": "",
"address_postal_code_check": "",
"cvc_check": "pass"
},
"country": "US",
"display_brand": "visa",
"exp_month": "2",
"exp_year": "2035",
"fingerprint": "Npb4PiXCa24Hfv60",
"funding": "credit",
"generated_from": "",
"last4": "4242",
"networks": {
"available": "["visa"]",
"preferred": ""
},
"three_d_secure_usage": {
"supported": "1"
},
"wallet": ""
},
"created": "1718890950",
"customer": "cus_QKQ6I9E8NL10uC",
"livemode": "",
"type": "card"
}
There isn't a first name field, just name
See: "name": "Ujwal2", from your response above
I need What my users are entering in First name
Ujwal2 is what I entered on Name on Card field.
Oh, are you passing that First Name field to the Stripe API anywhere?
I assumed you were passing it to the name when you were creating the PaymetnMethod
Ah wait, you are using Payment Links?
Ah okay one sec let me check
Yes, Please.
Ah you are using a Custom Field here to collect First Name?
Okay so then you need to retrieve the Checkout Session itself
Easiest way is to listen for the checkout.session.completed Event
That data will be in your Custom Fields property: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-custom_fields