【问题标题】:PAYPAL currency is not working [closed]PAYPAL 货币不起作用[关闭]
【发布时间】:2011-10-17 00:53:37
【问题描述】:

我正在使用 PHP 使用 Paypal 付款 这是一个购物车系统。 6个月来一切都很好。现在我们要在其中实现多种货币设施。所以我实现了一个名为

的paypal变量
currency_ code :: EUR

现在我应该可以用欧元代替美元了。但是当支付可变通行证时,Paypal 使用美元而不是欧元。这意味着价格是美元而不是欧元。什么错误?

知道这是为什么吗?

$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();

【问题讨论】:

  • 这个问题似乎是题外话,因为它是关于一个错字。

标签: php paypal shopping-cart


【解决方案1】:

如果我理解正确,你使用add to cart button 要设置货币,您应该使用此代码

<input type="hidden" name="currency_code" value="EUR">

你的按钮也是这样吗?

您可以发布按钮的孔代码吗?

【讨论】:

  • 我在我的网站上使用它而不是使用按钮
  • Ruslan,我在转到 paypal 时看到了这段代码(通过调试),但它不起作用
  • @Mazhar Ahmed: $this->paypal_class->add_field('currency_ code', $this->session->userdata ('currency')); 你的代码有错误:字段名称'currency_ code' 应该没有空格,就像这样'currency_code'
  • ohhhh,ooohhh 甜,哦,甜,它工作得很好。 jajakALLAH(非常感谢)
猜你喜欢
  • 2011-01-02
  • 2014-07-30
  • 2012-12-29
  • 1970-01-01
  • 2015-09-16
  • 2014-12-29
  • 2014-07-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多