这是我的代码: 这段代码允许我添加费率和数量到paypal,但税和运费似乎是不可能我添加。
所以,请帮我解决这个问题。 告诉我,如果在codeigniter中有一些库,或者我必须修改这段代码吗?
public function do_purchase()
{
$config['business'] = 'stars_1336125903_biz@a1professionals.com'; //Your PayPal account
$config['cpp_header_image'] = ''; //Image header url [750 pixels wide by 90 pixels high]
$config['return'] = base_url().'front/payment/notify_payment';
$config['cancel_return'] = base_url().'front/payment/cancel_payment';
$config['notify_url'] = base_url().'front/payment/notify_payment';
$config['production'] = FALSE; //Its false by default and will use sandbox
$config["shipping"] = 10;
$config["shipping2"] = 10;
$config["handling"] = 10;
$config["tax1"] = 10;
$config["invoice"] = $this->inv; //The invoice id
$config["first_name"] = $this->input->post('firstname');
$config["last_name"] = $this->input->post('lastname');
$config["address1"] = $this->input->post('address1');
$config["address2"] = $this->input->post('address2');
$config["country"] = $this->input->post('country');
$config["state"] = $this->input->post('state');
$config["city"] = $this->input->post('city');
$config["zip"] = $this->input->post('postalcode');
$config["email"] = 'testerone@a1professionals.com';
//To save shipping add
$this->load->library('paypal',$config);
foreach ($this->cart->contents() as $items)
{
#$this->paypal->add(<name>,<price>,<quantity>[Default 1],<code>[Optional]);
$this->paypal->add($items['name'],$items['price'],$items['qty'],$items['id']); //First item
}
$this->paypal->pay(); //Proccess the payment
}