I can't send item info to Paypal

72 views Asked by At

Good Day!! I have the next code to put a Buy Now button and send my items dynamically to PayPal, but when I click on the Buy Now button, the button doesn't send the info to the paypal page, it stays in the same page and I don't know what I'm doing wrong.

<form name="cart" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
                <input type="hidden" name="cmd" value="_cart">
                <input type="hidden" name="upload" value="1">
                <input type="hidden" name="business" value="mypaypalaccount">

                    <? 
                      foreach($_SESSION['articulosEnCarrito'] as $key => $v) {
                          $clave=$_SESSION['articulosEnCarrito'][$key]['prod'];
                          $descripcion=$_SESSION['articulosEnCarrito'][$key]['descr'];
                          $precio=$_SESSION['articulosEnCarrito'][$key]['precio'];
                          $cantidad=$_SESSION['articulosEnCarrito'][$key]['cant'];
                     ?> 

                        <input type="hidden" name="item_number_<? $i?>" value="<?php $clave ?>" />
                        <input type="hidden" name="item_name_<? $i?>" value="<?php $descripcion ?>" />
                        <input type="hidden" name="quantity_<? $i?>" value="<?php $cantidad ?>">
                        <input type="hidden" name="amount_<? $i?>" value="<?php $precio ?>" />
                        <input type="hidden" name="currency_code_<? $i?>" value="MXN" />
                    <?
                          $i++;
                        } // foreach ?>
                <input type="hidden" name="return" value="http://www.gpelectromecanica.com.mx/procesar_pedido.php" />
                <input type="image" src="https://www.paypalobjects.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal, la forma más segura y rápida de pagar en línea." style="width: 150px; height: 50px; float:right;">                         
                <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
            </form>
0

There are 0 answers