我正在使用一个用于 codeigniter 的 Pay-pal 插件,在这里可以找到codeigniter 2.0+、php 5.3.13 和 apache 2.2.22。这个插件过时了吗?
所以这就是我所拥有的,有什么问题。
private function getPayPalForm( $first_name, $last_name, $amount, $registration_id ){
$this->load->library('Paypal_Lib');
$this->paypal_lib->add_field('return', site_url('/register/success/'));
$this->paypal_lib->add_field('cancel_return', site_url('/register/cancel/'));
$this->paypal_lib->add_field('notify_url', site_url('/register/ipn/'));
$this->paypal_lib->add_field('custom', $registration_id);
$this->paypal_lib->add_field('item_name', 'Registration ID - '.$registration_id." for ".$first_name." ".$last_name);
$this->paypal_lib->add_field('item_number', $registration_id );
$this->paypal_lib->add_field('amount', $amount);
return $this->paypal_lib->paypal_form();
}
这是从插件调用的函数
function paypal_form($form_name='paypal_form')
{
$str = '';
$str .= '<form method="post" action="'.$this->paypal_url.'" name="'.$form_name.'"/>' . "\n";
foreach ($this->fields as $name => $value)
$str .= form_hidden($name, $value) . "\n";
$str .= '<p>'. $this->submit_btn . '</p>';
$str .= form_close() . "\n";
return $str;
}
所有信息都出现在我的自定义视图的正确位置。这是那个观点。
<div>
<div class="innerwidget">
<div class="bubble">
<div class="rectangle"><span>Make Payment</span></div>
<div class="triangle-l"></div>
<div class="triangle-r"></div>
<div class="info">
<p>Hari Om <?php echo $firstname; ?>, you are almost done.</p>
<p> To make your payment, please click the Pay-Pal button below.</p>
<div class="form-button-container">
<?php echo( $paypal_form ); ?>
<p style="font-size: 12px; color:blue;"> <b>Check out with Paypal to pay by Paypal Account or credit card.</b></p>
</div>
</div>
</div>
</div>
</div>
所有这些都工作正常,问题是,当我点击我的按钮时没有任何反应。我没有被转发到支付宝。我正在加载 jquery 库作为我的基本模板头部分的一部分。这些库有冲突吗?
这是火灾错误输出。
<div class="form-button-container">
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_form"/>
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="business" value="mymail@gmail.com" />
<input type="hidden" name="return" value="https://www.mydomain.org/successFunction" />
<input type="hidden" name="cancel_return" value="https://www.mydomain.org/cancelFunction />
<input type="hidden" name="notify_url" value="https://www.mydomain.org/ipn" />
<input type="hidden" name="custom" value="1375" />
<input type="hidden" name="item_name" value="2013 Annual Banquet - 2 persons" />
<input type="hidden" name="amount" value="50" />
<p> <input type="image" name="add" src="https://www.mydomain.org/assets/images/buttons/btn_xpressCheckout.gif" border="0" /></p>
</form>
<p style="font-size: 12px; color:red;"> <b>Check out with Paypal to pay by Paypal Account or credit card.</b></p>
</div>
这是我第一次使用支付宝,我完全被难住了。
编辑:我应该调整插件以将输入类型说为提交而不是图像吗?插件就是这样来的。
function image()
{
$this->submit_btn = '<input type="image" name="add" src="' . base_url() . 'images/paypal-button.png" border="0" />';
}