#ujwal_webhooks

1 messages ยท Page 1 of 1 (latest)

dawn mountainBOT
torpid acornBOT
#

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.

dawn mountainBOT
#

๐Ÿ‘‹ 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.

neon palm
#

Can you explain further? You want to restrict trials based on card details?

lilac dust
#

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.

neon palm
lilac dust
#

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

neon palm
#

Do you have an example evt_xxx?

lilac dust
#

Yes evt_1PTjPpGCrUuSimJTlkcZZd58

dawn mountainBOT
lilac dust
#

evt_1PTP5dGCrUuSimJT5sA2x4ce

neon palm
# lilac dust Yes evt_1PTjPpGCrUuSimJTlkcZZd58

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

#

That will have the card[last4] and card[fingerprint] fields

lilac dust
neon palm
lilac dust
#

it has "OFF" inside.

#

what does this mean

#

is it because I am using test mode?

dawn bluff
#

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

lilac dust
#

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.

dawn bluff
lilac dust
#

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?

dawn bluff
#

Correct.

torpid acornBOT
lilac dust
#

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'

rustic plank
#

๐Ÿ‘‹ stepping in as vanya needs to step away

#

The two Events you want are customer.subscription.updated and customer.subscription.deleted

lilac dust
#

customer.subscription.updated is x
customer.subscription.deleted is y

Correct?

rustic plank
#

Yes

lilac dust
#

Can we use subscription_schedule.canceled in place of x

rustic plank
#

That depends on your integration

lilac dust
#

I mean will it be fired in case of event like x

rustic plank
#

That depends on if you are canceling the Subscription Schedule, but generally no.

lilac dust
#

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

rustic plank
lilac dust
#

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"
}

rustic plank
#

There isn't a first name field, just name

#

See: "name": "Ujwal2", from your response above

lilac dust
#

I need What my users are entering in First name

#

Ujwal2 is what I entered on Name on Card field.

rustic plank
#

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?

lilac dust
#

Yes

#

What I need is First name.
What I am getting is Cardholder Name

rustic plank
#

Ah okay one sec let me check

lilac dust
#

Yes, Please.

rustic plank
#

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

lilac dust
#

To retrieve the session object. I need session ID.

#

I am listening to customer.subscription.created. How to get to session ID.

rustic plank
#

Yeah you can't get it directly from customer.subscription.created

#

You should listen for checkout.session.completed instead

#

Then you retrieve the Subscription when that Event fires

#

And you will get the same data as you get from customer.subscription.created