duanruinong0619 2019-01-18 10:31
浏览 35

Paysera捐赠按钮具有自定义金额值

I'm trying to implement into my Wordpress website a Paysera Donate Button (https://developers.paysera.com/en/payments/1.2#donate-button) but would also like to have an input field where a user would select the amount he want to donate and then when Donate button is clicked the amount is carried over from the input field. I have below php code but not sure what values should I work with to have the value of input be inserted into amount.

$request = WebToPay::buildRequest(array(
                // Čia surašyti tik keli parametrai.
                // Visų galimų parametrų su aprašymais sąrašą rasite žemiau.
                'projectid'     => 0,
                'sign_password' => '',
                'orderid'       => 0,
                'country'       => 'LT',
                'amount'        =>  100,
                'lang'          => 'LIT',
                'paytext'       => 'Parama [site_name] svetainei.',
                'accepturl'     => $self_url.'/accept.php',
                'cancelurl'     => $self_url.'/cancel.php',
                'callbackurl'   => $self_url.'/callback.php',
                'test'          => 0,
            ));
    } catch (WebToPayException $e) {
        echo $e->getMessage();
    }

?>
<form method="post" action="<?php echo WebToPay::PAY_URL; ?>">
    <?php foreach ($request as $key => $val): ?>
    <input type="hidden" name="<?php echo $key ?>"
           value="<?php echo get_magic_quotes_gpc() ? $val : addslashes($val); ?>" />
    <?php endforeach; ?>
    <input type="image" border="0" name="submit"
           src="https://developers.paysera.com/bundles/evppayseradoc/img/support-button-en.gif"
           alt="Paremkite svetainę! - mokejimai.lt tai saugu ir patikima!" />
</form> 

Is anyone able to help me with this? I appreciate your time.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示