I'm intending to create a product in stripe which , stripe product has product name , price id and product ID, so what im trying to do is , when i create a new product from my admin dashboard thee information I have added must go as well to the stripe product :
<form class="form-horizontal" enctype="multipart/form-data" wire:submit.prevent="addProduct">
<div class="form-group">
<label class="col-md-4 control-label" >Product Name </label>
<div class="col-md-4">
<input type="text" placeholder="Product Name" class="form-control input-md" wire:model="name" wire:keyup="generateSlug"/>
@error('name') <p class="text-danger">{{$message}}</p>@enderror
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" >Produc tPrice</label>
<div class="col-md-4">
<input type="text" placeholder="Account Slug" class="form-control input-md" wire:model="price"/>
@error('price') <p class="text-danger">{{$message}}</p>@enderror
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$('#submit-button').submit(function(e) {
e.preventDefault();
$.ajax({
type: "GET",
url: '/stripe-product/add',
data: $(this).serialize(),
});
})
})
</script>
Route web.php:
Route::get("stripe-product/add", function(){
return view('stripe-product');
});
the stripe-product.blade.php:
<?php
\Stripe\Stripe::setApiKey('sk_test_51Jxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$product = \Stripe\Product::create([
'name' => 'TEST',
]);
?>
all i want is to make the added product in my stripe's products have the name and price that i have added