Support the ongoing development of Laravel.io →
posted 10 years ago
Packages
Last updated 2 years ago.
0

So the only way I have figured out, is to have a setup where you pay twice. Once is the fee and once again to subscribe. Sort of annoying.

So in my case I wanted a $10 fee. So I did a field called paid_fee to my user and then did:

		$token = Input::get('stripeToken');

		Stripe::setApiKey(Config::get('services.stripe.secret'));
		Stripe_Charge::create(array( "amount" => 1000,
			"currency" => "usd",
			"card" => $token,
			"description" => "" ));

		Auth::user()->paid_fee = 1;
		Auth::user()->save();

Then send them back to page but with the button to subscribe this time.

Works. Just wish it was a better way.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

T3chn0crat t3chn0crat Joined 26 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.