I am using stripe basic checkout button that is looping through my products, is there a way to disable and change the text of the button after the button is submitted without affecting the button on the other products. I am having trouble trying to disable a single button after the payment is submitted that wont affect the buttons of the other products.
So what i want to happen is i click "pay with card", after i submit my information and the process goes through. The product that i just bought i want the button to be disable so i can only buy the product once.
@foreach($userproduct as $product)
<div class="col-md-6 col-lg-4">
<form id="btnst" action="{{ '/account/'.Auth::user()->slug .'/'. $product->id }}" method="POST">
{{ csrf_field() }}
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_fLAtreA6Mox2p8QVJLTfSBAH"
dat a-amount=".99"
data-name="ex"
data-description=" expired"
data-email="{{ auth::check() ? auth()->user()->email : null }}"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-panel-label=" Run Ad {{ $product->title }} Coupon"
data-locale="auto">
</script>
<script type="text/javascript">
$(document).ready(function(){
$(".stripe-button-el span").remove();
$("button.stripe-button-el").removeAttr('style').css({
"display":"inline-block",
"width":"50%",
"padding":"5px",
"background":"#d95a5c",
"color":"white",
"font-size":"1.3em",
"margin-left":"30%"}).html("Advertise");
});
</script>
<input type="hidden" name="adname" value="payment">
<input type="hidden" name="adprice" value="0.99">
<input type="hidden" name="prod_id" value="{{$product->id }}">
</form>
@endif