I'm taking Credit Card info upfront for my application, but it's important that users verify their email before they can use the service (a working email address is integral to the application) so I'm forcing the verification process.
Is there a way I can hold the start of their subscription until they have verified their email?
i.e on verification, users card is charged and subscription starts
@KEL_ - Thanks @kel_ but the docs do not address my problem. The docs detail how to prompt the user to verify their email before they can use the application, but it says nothing about preventing the subscription (the payments) from starting until the email is verified.
The scenario I'm keen to avoid is this:
User registers with card details, payment is taken and subscription begins, user does not verify email and doesn't ever log in to the application, but the monthly subscription payment is still taken.
If the user has not verified their email, I want to prevent payments from being taken.
In other words, you can use " Auth::routes([‘verify’ => true]); " in the page route where the credit card information is required. Thus, unverified users will not be able to access this route.
So, your route will look as follows:
Route::get(‘/payments’, function () {
// Only verified users may enter...
})->middleware(‘verified’);
Note that you must implement Illuminate\Contracts\Auth\MustVerifyEmail.
@DIEGOAURINO - Thanks @diegoaurino. I had thought about this approach but I really need to be able to take payment info at the point of user registration so this wouldn't work for my use case.
Personally I wouldn't worry about this unless it becomes a problem in practice. Having run subscription sites for years there are definitely folk who will let you know the moment there is a problem.
@danielmeade Have you tried to create two different areas/groups in your routes? One for the registration and payments only, and other that is only accessible if the verification is confirmed?
@DIEGOAURINO - Yeah, this is how I have it set up currently. Maybe I just don't need to worry about it. I just wanted to avoid support requests and chargebacks.
@danielmeade I know that some payment processing apis let you confirm that the credit card has funds to register. You can use this feature to charge the user only after the email verification. Then you can create a listener to trigger once you get the verification back. Thus it gets easy to charge the user for the subscription.