I am trying to show a Stripe payment element, but it's not showing.
Using dd() statements, I can tell that the user PaymentMethods is empty (as expected for a new user) and the Intent is not null.
show() method in PlanController.php:
public function show(Plan $plan, Request $request)
{
$user = $request->user();
$user->createOrGetStripeCustomer();
$paymentMethods = $user->paymentMethods();
$intent = $user->createSetupIntent();
return view('plans.show', compact('plan', 'intent'));
}
Javascript, truncated because SO won't let me post it all:
<script src="https://js.stripe.com/v3/"></script>
...
// Submit the form with the token ID.
function stripeTokenHandler(paymentMethod) {
// Insert the token ID into the form so it gets submitted to the server
var form = document.getElementById('payment-form');
var hiddenInput = document.createElement('input');
hiddenInput.setAttribute('type', 'hidden');
hiddenInput.setAttribute('name', 'paymentMethod');
hiddenInput.setAttribute('value', paymentMethod);
form.appendChild(hiddenInput);
// Submit the form
form.submit();
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2R626k7
via IFTTT
Python 3 Tkinter Menu Bar
RépondreSupprimerPython Tkinter Text Widget
Python Tkinter Combobox
Python Tkinter Combobox Event Binding
Python Tkinter Checkbutton Widget
Python Tkinter Frame Widget
PHP pagination with sortable table on header click
How to create a PDF from a form using PHP
Vader Sentiment Analysis Python
How to make a keylogger in Python