#codingwisely

1 messages ยท Page 1 of 1 (latest)

void frostBOT
vapid peak
#

Hello! The only way to do this would be to clear out all your test data

stiff kestrel
#

in progress! ๐Ÿ˜„

#

thank you so so much! ๐Ÿ˜„ its so obvious place lol

#

regardless i never saw it before ๐Ÿ™‚

#

you rock @vapid peak !

vapid peak
#

happy to help!

stiff kestrel
#

aw shoot

#

it removed my producst!

#

arght

#

can you revert it ?

#

thought this will do what i wanted to remove test users and transactions so did not read when started

#

pfew

vapid peak
stiff kestrel
#

ah never mind then

vapid peak
#

Sorry I should've double checked that you were actually okay with deleting all your test data - I assumed you wanted it all gone

stiff kestrel
#

i need to delete only test users wnd their related cards and transactions - is that possible?

vapid peak
#

YOu can delete the cusotmers and their cards, but it's not possible to delete the transactions once they've been made

stiff kestrel
#

and then i am working on my local machine

#

i create a charge

#

then i create subsription

#

etc

#

then i destroy my local database

#

and create a new one and again, sam euser i use to subscribe

#

now, when i pull charges for that user from stripe, i get bunch of them, all from before

#

and i need only one ๐Ÿ™‚

#

lets create a new product catalog and payment links lol

vapid peak
#

Instead of using the same user why don't you create a new stripe Customer and use that?

stiff kestrel
#

i am using login via social media

#

so on my saas user logs in via social media

#

and his email is used to purchase subscription

#

and i always just click - login via github

vapid peak
#

What I'm saying is that you can delete the Stripe Customer that was tied to that email (when you destroy your local database)

stiff kestrel
#

simplest way to get to subscription page

#

ah, i do so

#

i delete customers

#

but when i again create one

#

i see like history of transactions in stripe customer page

#

that are old ones, plus the one i just recreated if you got mt?

#

me

vapid peak
#

Is this in the dashboard? Or your own page that you built?

stiff kestrel
#

its in Stripe Customer page

#

on my own page i still did not finish layout ๐Ÿ™‚

#

i will now recreate products and once i manage to make again what i am talking about, i will screenshot it to you

vapid peak
#

How are you retrieving all the charges related to that customer? Are you doing it based on Customer ID

stiff kestrel
#

let me see in code

#

$charges->charges->all(['customer' => auth()->user()->stripe_id]);

#

so i am using his customer id

#

maybe you can actually advise me for the best practice here:
May i feel free to ask?

vapid peak
#

Yeah go ahead

stiff kestrel
#

I am having 3 kind of plans-
Subscriptions - monthly
Subscription - yearly
One time payment- Lifetime membership

Now, it looks very ugly in code to try to check if user get any of these plans
IF its only subscriprion i will check if user->subscribed('mobthly;) || user->subscibed('yearly') - it means he has subscibed

#

but one time payment i can check with user->subscribed()

#

($user->subscribed()) comes from Laravel cashier, and its a wrapper around Stripe php lin

#

What would be the best way to check if user has any active payment? either life time memberhsip or active subscription

vapid peak
#

We don't maintina the laravel cashier library so you'll need to check to see what they suggest. Generally, I'd say the easiest way to check this would be to store this in your own databases to easily know if they have a current subscription

stiff kestrel
#

i wish stripe has subsrition to renew every 10 years ๐Ÿ˜„

stiff kestrel
#

cool

#

i ll figure it somehow, probably make my own record for charges

#

thank you karbi

#

i appreciate you

vapid peak
#

๐Ÿ‘