0

I have a problem and I don't really know how to solve it. I have a PHP form, hosted on another site outside of my woocommerce. And I need to make a payment gateway, which redirects to my PHP site and send the order data. but I don't understand how I can send the order ID and total amount and/or do the redirection when the person clicks on pay can someone guide me?

this is my php form

<?php
require('config.php');
require __DIR__ . '/vendor/autoload.php';

use Automattic\WooCommerce\Client;

$woocommerce = new Client(
  'http://localhost/websites',
  'ck_cfd99ab9134c1b8b5a3787d13123122fb659a9a3', \\ Fake
  'cs_13127021757fcbb23cf0923423423424b7096bde',
  [
    'version' => 'wc/v3',
  ]
);

?>
<html>
<head>
    <link rel="stylesheet" href="css/estilos.css">
</head>
<body>
<form action="submit.php" method="post">
    <input type="hidden" name="importe" value="<?php echo(TOTALAMOUNT); ?>">
    <input type="hidden" name="pedido" value="<?php echo($ORDERID); ?>">
    <script
        src="https://checkout.stripe.com/checkout.js" class="stripe-button"
        data-key="<?php echo $publishableKey?>"
        data-amount=  HERE I NEED TO PUT THE TOTAL AMOUNT
        data-name="Banana Shop"
        data-description="Order ID: HERE THE ORDER ID "
        data-image="https://google.com/logo.png"
        data-currency="eur"
        data-email="payments@domain.com"
    >
    </script>
    <script>
        document.getElementsByClassName("stripe-button-el")[0].style.display = 'none';
    </script>
    <button type="submit" class="bubbly-button">Button Pay</button>
</form>
</body>
</html>

0 Answers0