#chiefmcconnell.eth

1 messages · Page 1 of 1 (latest)

atomic knollBOT
fallow oriole
#

"client_reference_id": null,

#

🤔

warm lintel
#

Can you send me the ID of the checkout session that this was for?

#

That does look like it should pass on the ID

fallow oriole
#

cs_test_a1Rwzul2Ohcn9jiH3aExSC9c5uHXFzVTv4XTsQYwvUDv67I3XxVuDjizQi

#

yeah i did everything the way it should be. consulted with another dev yesterday here to make sure

#

¯_(ツ)_/¯

warm lintel
#

Thanks for the ID, checking in to this

fallow oriole
#

thank you!

#

i love your username by the way. Italiano?

atomic knollBOT
fallow oriole
#

i can also send you the page where im using the payment method if you would like to test it that way. you would just have to create an account and then you would be able to make a test payment

warm lintel
#

Yes that would be helpful if you can send it. Apologies was trying to recreate this but other threads got busy so I wasn't able to. Trying again now

#

And thanks! Just a fan of Roman history

fallow oriole
fallow oriole
#

disregard all the other mess on the page. we are using it for testing purposes at the moment

atomic knollBOT
warm lintel
#

Interestingly when I am do this same code with my own pricing table the client reference ID is getting passed on properly

warm lintel
#

When I am on that page now I actually don't see the client-reference-id set

    </stripe-pricing-table>```
And the same console command does not show it as being set
#

Can you try reloading the page without cache and see if it changes for you?

fallow oriole
#

you made an account or did it not prompt you to make an account?

#

ahhh .it doesn't prompt you to create an account

warm lintel
#

Yeah

fallow oriole
#

so if you go to the base url... it should have a sign in page where you can create an account

#

sorry for that

#

I forgot I made the page unauthenticated

#

once you create an account you can then go to /download-files and it should then show you a user ID

warm lintel
#

Now that I am logged in the value is populated and it is properly showing up on the Checkout Session cs_test_a1FAenFDNh7c7Id2TYGCif0w84s5QJ1acDpH9bZ0MQrQjjvPouo5Ws8PVG

#

Can you try again and see if this is working for you as well?

fallow oriole
#

yep. seeing it now. so does that client_reference_id not show up in the invoice.payment_succeeded json?

#

asking because I want to be able to use it when checking status of subscription in the future. at the moment I have no access to webhooks unless I use a third party (or if you know a way to install webhooks with just javascript rather than running in node)

#

when I check the status now it will be an API call each time they log in

warm lintel
#

Yeah, I think client reference ID is only on the Checkout Session itself. I don't think the subscription or invoice objects have properties for that but you can use the initial checkout.session.completed event to set the reference ID as metadata on the subscription https://stripe.com/docs/api/metadata

#

Metadata typically isn't copied between objects but one exception is that invoice line items will pull their metadata from their related subscription. So you would be able to access the metadata from that event if it is set on the subscription

#

Or it may just be easier to save a subscription->client_reference_id mapping in your database and refer to that

fallow oriole
#

but again, i have to do all of this with api calls since I can't use webhooks inside of the page itself at the moment. i only have API and server-side API out at the moment. no API/webhooks in

unborn hawk
#

👋

#

Pompey needed to step away

fallow oriole
#

no problem. you are all busy today

unborn hawk
#

Is there something outstanding here that I can help with?

fallow oriole
#

the only outstanding thing I guess I was wondering is... setting the value I passed into client_reference_id to show up in either the invoice.payment_succeeded data or... set it in their stripe user data which I guess is what pompey said above using the api call to set it into the metadata

#

which would probably be first an api call for the payment in order to get their stripe userID and then making a second call to set what I want into their metadata

unborn hawk
#

Yep that would be the way if you aren't using Webhooks

fallow oriole
#

do you know how i could set up webhooks with just vanilla js? or is that not a thing since it is serverside only usually

#

im not 100% sure I can just import express.js and just have it work. i think it requires some node dependencies

unborn hawk
#

Yeah your Webhook handler is required to be server-side

fallow oriole
#

ok, sounds good. thanks to both of you!!! appreciate it!