問題描述
PAYPAL 貨幣不起作用 (PAYPAL currency is not working)
I'm using PHP to payment using Paypal It's a shoping cart system. Everything went fine for 6 months. Now we want to implement multiple currency facility in it. So I implemented one paypal variable called
currency_ code :: EUR
now I should be able to use EUR in place of USD. But when paying variable passes but Paypal uses USD not EUR. That means the price is in Dollar not Euro. What's the error?
Any idea why is this?
$invoice= $this->session->userdata('invoice');
$money= $this->session->userdata('tk');
$desc= $this->session->userdata('desc');
$store_owner= $this->session->userdata('store_owner');
$this->paypal_class->add_field('upload', '1');
$this->paypal_class->add_field('business', $store_owner);
$this->paypal_class->add_field('return', $this->session->userdata('success'));
$this->paypal_class->add_field('cancel_return', $this->session->userdata('store'));
$this->paypal_class->add_field('notify_url', base_url().'ipn/index');
$this->paypal_class->add_field('invoice',$invoice);
$this->paypal_class->add_field('currency_ code', $this->session->userdata ('currency'));
$t = 1;
foreach ($cart as $c)
{
$this->paypal_class->add_field('item_name_'.$i, $c['product_name']);
$this->paypal_class->add_field('item_number_'.$i, $c['option_id']);
$this->paypal_class->add_field('on0_'.$i, 'Option');
$this->paypal_class->add_field('os0_'.$i, $c['option_name']);
$this->paypal_class->add_field('quantity_'.$i, $c['option_quantity']);
$this->paypal_class->add_field('amount_'.$i, $c['option_price']);
$this->paypal_class->add_field('shipping_'.$i, $c['option_shipping']);
$i++;
}
$this->paypal_class->add_field('discount_amount_cart', 5);
$this->paypal_class->add_field('tax_cart', 7.5);
$this->paypal_class->submit_paypal_post();
參考解法
方法 1:
If I understand right, you use add to cart button To set currency you should use this code
<input type="hidden" name="currency_code" value="EUR">
Is it so in your button?
Could you post hole code of your button?
(by Mazhar Ahmed、Ruslan Polutsygan)