Sagepay表格 - 输入值

时间:2014-08-14 09:01:24

标签: php sagepay

我使用sagepay表格,如下所示。此表单上的值已设置,但我需要这样客户才能自行输入金额。

   <?php
    require_once ('SagePay.php');

    $sagePay = new SagePay();
    $sagePay->setCurrency('GBP');
    $sagePay->setAmount('500');
    $sagePay->setDescription('Payment');
    $sagePay->setBillingSurname('Surname');
    $sagePay->setBillingFirstnames('First Name');
    $sagePay->setBillingCity('City');
    $sagePay->setBillingPostCode('Post Code');
    $sagePay->setBillingAddress1('Address Line One');
    $sagePay->setBillingCountry('GB');
    $sagePay->setDeliverySameAsBilling();

    $sagePay->setSuccessURL('https://www.XXXs.com/trade/success.php');
    $sagePay->setFailureURL('https://www.XXX.com/trade/fail.php');
    ?>

    <form method="POST" id="SagePayForm" action="https://test.sagepay.com/gateway/service/vspform-register.vsp">
        <input type="hidden" name="VPSProtocol" value= "2.23">
        <input type="hidden" name="TxType" value= "PAYMENT">
        <input type="hidden" name="Vendor" value= "wilsonscarpets">
        <input type="hidden" name="Crypt" value= "<?php echo $sagePay->getCrypt(); ?>">
            <input type="text" name="Amount" value= "">
        <input type="submit" value="continue to SagePay">
    </form>

这成功地转到Sagepay,价值为500,但是我想要用户在表单部分中放入自己的值,任何人都可以帮助这个。

1 个答案:

答案 0 :(得分:1)

不幸的是,不可能。您必须在Crypt字符串中使用Form事务注册传递所需的金额。