1

Having some issues with opencart 1.5.5.1 and paypal standard. I'm using Paypal.com.au (In Australia) When I started there was no telephone and no state being passed from opencart to paypal. The rest of the fields (address, email, name) were all pre-populated. So I went in to the paypayl standard code and added this to the controller:

$this->data['night_phone_b'] = html_entity_decode($order_info['telephone'], ENT_QUOTES, 'UTF-8');

and this to the tpl file:

<input type="hidden" name="night_phone_b" value="<?php echo $night_phone_b; ?>" />

That worked for the phone, however, no matter what I try for the state, I can't get it to work. I looked at doing something like this:

$this->data['state'] = html_entity_decode($order_info['payment_zone_code'], ENT_QUOTES, 'UTF-8');

and the same as above but replacing ['payment_zone_code'] with ['payment_zone_id'] and ['zone_id']

and in the tpl file:

<input type="hidden" name="state" value="<?php echo $state; ?>" />

Anyway, I am stumped on getting the state passed over to paypal.

EDIT Checked here at paypal's Australian site: https://www.paypal.com/au/cgi-bin/webscr?cmd=_pdn_xclick_prepopulate_outside They don't offer any help on the issue either, all examples are for US states: "State (Must be 2 character official abbreviation)" with no help on 3 character abbreviations. Still waiting for a reply from them also

4

2 回答 2

1

似乎您可以传递一个带有全名的澳大利亚州(Paypal 买家详细信息选择表单上的值,而不是可见内容)

这感觉有点像一个狡猾的修复,但它对我有用。希望Paypal不会改变任何东西......

    $states['ACT'] = "Australian Capital Territory";
$states['NSW'] = "New South Wales";
$states['NT'] = "Northern Territory";
$states['QLD'] = "Queensland";
$states['SA'] = "South Australia";
$states['TAS'] = "Tasmania";
$states['VIC'] = "Victoria";
$states['WA'] = "Western Australia";

然后将'billing_region'而不是状态作为表单的一部分传递......

'billing_region' => $state[$fdata['u_state']]
于 2013-09-05T04:36:58.533 回答
0

使用iso_code_2混凝土国家的财产怎么样?该country表定义如下:

CREATE TABLE `oc_country` (
  `country_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL,
  `iso_code_2` varchar(2) NOT NULL,
  `iso_code_3` varchar(3) NOT NULL,
  `address_format` text NOT NULL,
  `postcode_required` tinyint(1) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`country_id`)
)

该列iso_code_2包含所需的 2 个字符的 ISO 国家/地区代码。

在您处理 PayPal 请求的情况下,您应该能够检索付款地址及其国家代码(3 个字符的 ISO 代码)或 ID - 使用此唯一值(它是iso_code_3country_id)您应该能够找到具体的国家条目和获得所需的iso_code_2值,然后将其传递给 PayPal。

编辑:

如果是州代码,您可以使用已知的付款地址来获取zone_id。但有一个问题 - 澳大利亚各州的代码不仅有 2 个字符长:

Australian Capital Territory -> ACT
New South Wales              -> NSW
Northern Territory           -> NT
Queensland                   -> QLD
South Australia              -> SA
Tasmania                     -> TAS
Victoria                     -> VIC
Western Australia            -> WA

根据Wikipedia,州的缩写和 ISO 代码都只有 2 个字符长,因此也许您也可以尝试发送 3 个字符的代码并将其余的代码放在 PayPal 上(也许描述不正确,您可以使用 3 -char. 代码)。

于 2013-05-30T14:59:00.360 回答