Your not using stripes JavaScript? Why are you getting users c/c data?
Cashier subscription is create a duplicate
I'm having trouble figuring out why I'm seeing two identical subscriptions in my Stripe dashboard for a user on account creation in my app.
I've also done logging to be sure I know that the method is only run once.
protected function registerUser(\App\Models\User $user, CreateUserRequest $request)
{
$user
->subscription($request->get('subscription'))
->create($request->get('stripeToken'), [
'email' => $user->email,
'plan' => $request->get('subscription'),
'source' => [
'object' => 'card',
'number' => $request->get('cc-number'),
'exp_month' => $request->get('cc-exp-month'),
'exp_year' => $request->get('cc-exp-year'),
'name' => $request->get('name')
]
]);
}
Are the subscriptions identical -- i.e. they have the same Stripe reference number? Or are they just duplicates -- i.e. the user subscribed twice?
Hi Jekinny, I am using the Stripe Javascript. I'm using the stripe.js library to generate my token which is stored in my example as $request->get('stripeToken');
I think you missed the very important point that @jekinney was making.
Looking at your code, it seems that you are sending the credit card information to your server: $request->get('cc-number'), etc.
The credit card fields in your form should not even have a name attribute. You should ensure that the card data is never sent to your server -- not even for a single request, let alone for storage!
You need to read the Stripe documentation. Follow these instructions carefully.
Please or to participate in this conversation.