hey, anyone around? I had a few questions regarding Stripe.js and the PHP API, w/ regards to the new PCI DSS 3.0 rules
koopajah
MDesigner: I'm around
hover
koopajah: maybe you can help me with a JS callback function
MDesigner
I'm wondering what the correct way is to simply update a customer's default CC. of course I can gather the CC Info the usual way, Stripe.createToken($('#my-form'), callbackFunc);
hover: I can try but no promises it's like node.js + parse so...
danasf has quit
hover
koopajah: I will take another swing at it
maximski joined the channel
MDesigner
ah ok. thanks! I need to figure out how to get the customer ID. I'm hacking someone else's code to be more PCI Compliant
hover
If I can't figure it out I will ping you
koopajah
hover: I might be off for tonight but happy to help tomorrow if you're still stuck
ddurst has quit
MDesigner: the customer Id you would have saved this in your database when you created it. That way when the customer comes back on your website and logs in you know which customer in Stripe it is
MDesigner
koopajah: right, got it
johnpaulnarowski joined the channel
johnpaulnarowski
hey all
having some confusion around events, can someone help?
ta_ joined the channel
I just want to get the most recent events since event (x)
but when I try it, I get all events
jessejarvi has quit
koopajah
johnpaulnarowski: can you show you code ?
johnpaulnarowski
all(starting_after: MY_MOST_RECENT_EVENT_ID)
koopajah
johnpaulnarowski: what library are you using ?
johnpaulnarowski
ruby
gem
jessejarvi joined the channel
koopajah
johnpaulnarowski: that's the other way around
johnpaulnarowski
I am just lost as to how starting_before and ending_after works for event
koopajah
johnpaulnarowski: you list all events and you stop when you reach event XXX
johnpaulnarowski
I want to query only events that are new
that I don’t have in my system
jessejarvi has quit
koopajah
johnpaulnarowski: that's what I'm saying. Events are returned with the most recent first
johnpaulnarowski: so list all events with limit set to 100 and loop through the list until you find event X and then stop
johnpaulnarowski
so don’t use starting_before or ending_after?
jessejarvi joined the channel
rfunduk
hm, starting_after should be what you want i think
ta_ has quit
johnpaulnarowski
doesn’t work
i can’t make sense of what is returned
jonrhaider joined the channel
jonrhaider
Back :) hey @rfunduk
rfunduk
johnpaulnarowski you get back the event you specified as the 'starting_after'?
koopajah
johnpaulnarowski: I'm not sure what you mean, you will get a list of events starting with the most recent one first
flippyhead joined the channel
johnpaulnarowski
let me think on that a sec
Ivo joined the channel
danasf joined the channel
rfunduk
like if you call https://stripe.com/docs/api#list_events, and you have 3 events, id 1,2 and 3. and you say, starting_after: '2' you should only get back event id 3
MDesigner has quit
Ivo is now known as Guest58971
Guest58971
Hi, I'm trying to integrate stripe through a URL
I'd love to use the Embedded Form
rfunduk
oh, wait, maybe koopajah is right... it could be you want ending_before due to the reverse nature of the response
ta_ joined the channel
koopajah
you have event X from yesterday in your database. You use List events, and you get 100 events from today. The last ones is YYY then you list again and set `starting_after` to YYY and you get a 100 where the last one is ZZZ so you start again and set `starting_after` to ZZZ and you get a 100. And when parsing the list you see Event X so you stop
Guest58971
However, that leads me to a URL that shows a button, which needs to be clicked before the default popup shows
Is there any way I can skip the part of showing the button, but still get the default stripe popup to show?
rfunduk
koopajah, johnpaulnarowski, but you should be able to use the pagination features to not have to 'stop', the list will stop and not give you more
Guest58971, not really no. most browsers wont allow that to happen for security reasons
koopajah
yeah you add `ending_before` and set it to XXX
rfunduk
Guest58971, they require a user interaction event to show the popup
koopajah, johnpaulnarowski, ok yea. it's easy to accidentally get starting_after and ending_before backwards due to the direction the response is sorted :)
blake joined the channel
blake has quit
johnpaulnarowski
you say you only return 30 days of events?
how far back can i actually go
rfunduk
we only guarantee 30 days worth, yea
johnpaulnarowski
im trying to backfill my database
also, is events the best resource for me to track and separte updates, downgrades, activations and cancellations
rfunduk
there might be any number of extra events there for you, but they get cleaned up over time
johnpaulnarowski
seems like state isn’t present with the charge resource
rfunduk
hm, no i wouldn't say so really. webhook events are best used for behind the scenes payments and stuff
you should keep track of updates/downgrades/etc at the time you make that change in your app
Bob joined the channel
ta_ has quit
Guest58971
rfunduk, when I try to use a custom form though, I am able to directly display the form fields from calling the URL (without the user clicking anything)
Bob is now known as Guest80327
rfunduk
Guest58971, yea, it's a characteristic of stripe checkout. if you make your own form you can do wahtever you like of course
johnpaulnarowski
i need to use your api to do this
Guest58971
Unfortunately that custom form has not a nice layout
johnpaulnarowski
not my app
since sometimes we do it manaully
Guest58971
Yea I can make my own form, I was just hoping to spare me some time by using your layout
rfunduk
johnpaulnarowski, in theory you should build admin interfaces on your end to do any operations you need, so that you can keep track
johnpaulnarowski
im trying to do somethig like baremetrics
but within our own admin panel
how do they do it?
eno joined the channel
rfunduk
johnpaulnarowski, they probably do use webhooks to do that
johnpaulnarowski, but as you have already found out, it's a bit clunky :)
johnpaulnarowski
you can’t rely only on webhooks though
what if you’re down
the app isn’t responsive
you need a backup resource to use
koopajah
webhooks are sent again every hours for a day
eno
hi guys had a quick question was wondering if someone could answer it
rfunduk
yea we'll retry webhooks every hour for like 72 hours
koopajah
webhooks are here for logging and confirming state
johnpaulnarowski
well webhooks might be OK for new data but I need legacy data too
koopajah
eno: we should yes
johnpaulnarowski
i picked you guys because of your API but you’re telling me I shouldn’t use it?
rfunduk
johnpaulnarowski, yea, that's a problem, you're limited to 30 days guranteed for that
max-b has quit
johnpaulnarowski
It seemed so much cleaner than charigfy
koopajah
johnpaulnarowski: nobody is telling you that
eno
I am charging user1 on user2 behave and also an application fee have this flow implemented currently and tested and works great
my question is how can I send up stripe to send an email receipe to user1 and user2 about the transaction that took place
set up
configure stripe
koopajah
eno: so user2 would need to configure his stripe account so that it sends email receipt automatically
that's not something you can do through the API
eno
but however I did see an option
johnpaulnarowski
aside from the 30 day thing
eno
where I can configure stripe to send an email regarding the application fee
johnpaulnarowski
is there any other reason not to use events?
eno
is that correct
johnpaulnarowski
if im storing data every day on my side, woudn’t events be the best way to handle managing state changes?
rfunduk
johnpaulnarowski, well, i dont know your application or use-case really. the issue with events is that they only describe one object
and often other objects are also needed
johnpaulnarowski
just trying to store data about my subscriptions, upgrades downgrades activations and cancellations
max-b joined the channel
rfunduk
so if i was building baremetrics i would probably have my own data model that more concretely described state changes or somesuch
johnpaulnarowski
i need to know
what to use in your api to store a record that denotes all subscription state changes
if it was an activation, upgrade, downgrade or cancellation
and the amount
that’s it
koopajah
johnpaulnarowski: you look for `customer.subscription.updated` for the state changes
rfunduk
events, and then look up all the other data you need that isn't included in the event
koopajah
and you look for `invoice.payment_succeeded` for the amounts
johnpaulnarowski
yah that’s what im doing
rfunduk
yes, but the problem is for historical data you're going to look up a record as it exists NOW, not THEN