php - Paypal 支付值(value)的形式没有通过

标签 php forms paypal payment

我正在使用此表单将值传递给 Paypal 付款。

<form style="padding: 20px; border: 2px solid #f00; background: #fff;    box-shadow: 10px 10px 20px -5px #000; border-radius: 10px; font-size:15px;" action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<div class="form-row">
    <div class="form-group col-md-12 mx-auto text-center">
        <h3 class="text-uppercase">Please Confirm Your Payment</h3>
    </div>
</div>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="paypaltestgmail.com">
<input type="hidden" name="quantity" value="1">
<div class="form-row">
    <div class="form-group col-md-4">
        <label for="fullName">Full Name</label>
        <input type="text" class="form-control" id="fullName" value="<?php echo $firstName . ' ' . $lastName; ?>" name="fullName" disabled="disabled">
    </div>
    <div class="form-group col-md-4">
        <label for="email">Email</label>
        <input type="text" class="form-control" id="email" value="<?php echo $email; ?>" name="email" disabled="disabled">
    </div>
    <div class="form-group col-md-4">
        <label for="age">Age</label>
        <input type="text" class="form-control" id="age" value="<?php echo $age; ?>" name="age" disabled="disabled">
    </div>
</div>
<div class="form-row">
    <div class="form-group col-md-4">
        <label for="sessionType">Session Type</label>
        <input type="text" class="form-control" id="sessionType" value="<?php echo $sessionType; ?>" name="item_name" disabled="disabled">
    </div>
    <div class="form-group col-md-4">
        <label for="sessionDays">Session Days</label>
        <textarea class="form-control" id="sessionDays name="sessionDays" disabled="disabled"><?php echo $sessionDays; ?></textarea>
    </div>
    <div class="form-group col-md-4">
        <label for="sessionTime">Session Time</label>
        <textarea class="form-control" id="sessionTime" name="sessionTime" disabled="disabled"><?php echo implode(', ', $_POST['sessionTime']); ?></textarea>
    </div>
</div>
<div class="form-row">
    <div class="form-group col-md-4">
        <label for="totalCost">Total Cost</label>
        <input type="text" class="form-control" id="totalCost" value="<?php echo $totalCost; ?>" name="totalCost" disabled="disabled">
    </div>
    <div class="form-group col-md-4">
        <label for="totalTax">Tax Amount</label>
        <input type="text" class="form-control" id="totalTax" value="<?php echo $totalTax; ?>" name="totalTax" disabled="disabled">
    </div>
    <div class="form-group col-md-4">
        <label for="grandTotal">Grand Total</label>
        <input type="text" class="form-control" id="grandTotal" value="<?php echo $grandTotal; ?>" name="amount" disabled="disabled">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="USD">
        <!-- <input type="hidden" name="bn" value="BuyNow"> -->
        <input type="hidden" name="return" value="http://www.example.net/payment-success/">
    </div>
</div>
<button type="submit" class="btn btn-primary btn-lg d-block mx-auto text-uppercase">Confirm & Pay</button>

我得到了这个结果:

I am getting this result

我正在获取数量但没有获取 $sessionType;在描述字段和 $grandTotal 中;在每件商品的价格(总计)字段中。我是第一次这样做。我的表格有什么错误?我无法解决这个问题。

最佳答案

使用 readonly 的魔力属性:

This attribute indicates that the user cannot modify the value of the control. The value of the attribute is irrelevant. If you need read-write access to the input value, do not add the "readonly" attribute. It is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type (such as button or submit).

关于php - Paypal 支付值(value)的形式没有通过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50587614/

相关文章:

php - 您的 SQL 语法有误;检查与您的 MySQL 服务器版本对应的手册,了解在第 1 行的 '0' 附近使用的正确语法

html - 样式表单选按钮和复选框

php - PayPal 自定义结帐表格

php - 如何获取 Paypal IPN中的item_number?

paypal - 如何在 Paypal 立即购买按钮中传递动态金额

php - 我可以在 1 个调用中结合更新和插入不同的表(带索引)吗?

php - 简单的评级系统;获取当前条目的 ID 并发布到表中

php - 如何制作 Freeswitch ESL phpmod?

javascript - html 表单不将数据传输到谷歌电子表格

jquery - 将单选按钮的值相加