A
Anonymous
Guest
I have a page where the user buys credits on my website. I decided to make a rule where the user can buy the credits and be directed to the cart. If he initiates the purchase the value appears, otherwise he emits an empty cart message.
My code:
The problem is in this excerpt. It should display the stripe button for the user to make the purchase:
How can I solve this stretch?
My code:
Code:
<?php
if (isset($row['userid']) && $row['status'] == 0) {
//if ($userid == $userid && $status == 0) {
echo "<div class='table-responsive data-table table-striped'>";
echo "<table id='activetrontbl' class='table vertical-align' style='width:100%'>";
echo "<thead>";
echo "<tr class='text-center'>";
echo "<th>";
echo "<Label>Tokens</Label><br>";
echo "</th>";
echo "<th>";
echo "<label>Quantity</label>";
echo "</th>";
echo "<th>";
echo "<label>Total price</label>";
echo "</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr class='text-center'>";
echo "<td class='align-middle'>";
echo "<img src='../assets/images/logo/orico.png' width='42' alt='Jambo'>";
echo "<br><small>Jambo - JAM</small>";
echo "</td>";
echo "<td class='align-middle'>";
echo "<h4>$row[chainamount] JAM</h4>";
echo "</td>";
echo "<td class='align-middle'>";
echo "<h4>U$ $row[chaininusdamount]</h4>";
echo "<small>R$ ($row[chaininbrlamount])</small>";
echo "</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
echo "</div>";
echo "<form action='submit.php' method='post'>";
echo "<input type='hidden' name='amount' value='<?php echo $row[chaininbrlamount] * 100; ?>'>";
echo "<input type='hidden' name='chainamount' value='<?php echo $row[chainamount]; ?>'>";
echo "<input type='hidden' name='userid' value='<?php echo $userid; ?>'>";
echo "<input type='hidden' name='updateid' value='<?php echo $row[id]; ?>'>";
echo "<input type='hidden' name='name' value='<?php echo $fullname; ?>'>";
echo "<input type='hidden' name='email' value='<?php echo $email; ?>'>";
echo "<div class='d-flex justify-content-end'>";
echo "<script";
echo "src='https://checkout.stripe.com/checkout.js' class='stripe-button'";
echo "data-key='" . $publishablekey. "";
echo "data-amount={$row['chaininbrlamount']*100;}";
echo "data-name='chain'";
echo "data-quantity='<?php echo $row['chainamount']; ?>'";
echo "data-description='buy cryptocurrency'";
echo "data-image='../assets/images/logo/orico.png'";
echo "data-currency='brl'";
echo "data-email=<?php echo $email; ?>";
echo ">";
echo "</script>";
echo "</div>";
echo "</form>";
echo "</div>";
} else {
echo "<div class='row'>";
echo "<div class='col text-center'>";
echo "<p><i class='zwicon-sad text-orange h1'></i></p>";
echo "<p><spam class='h5'>Your cart is empty!</spam></p>";
echo "<p><spam>Add something to make me happy ;)</spam></p>";
echo "</div>";
echo "</div>";
} ?>
The problem is in this excerpt. It should display the stripe button for the user to make the purchase:
Code:
echo "<script";
echo "src='https://checkout.stripe.com/checkout.js' class='stripe-button'";
echo "data-key='" . $publishablekey. "";
echo "data-amount={$row['chaininbrlamount']*100;}";
echo "data-name='chain'";
echo "data-quantity='<?php echo $row['chainamount']; ?>'";
echo "data-description='buy cryptocurrency'";
echo "data-image='../assets/images/logo/orico.png'";
echo "data-currency='brl'";
echo "data-email=<?php echo $email; ?>";
echo ">";
echo "</script>";
How can I solve this stretch?