演示见,酷瓜内衣商城 :[url]http://www.koogua.com[/url]
适用范围:适用于中介担保支付 (2.7版本)
官方 的支付宝 接口里没有挂地址 ,收货人,邮编等参数,从而到了支付页面 还要填写一遍地址,收货人,比较的麻烦
增加地址,收货人参数后就不再重复劳动了。
修改以下地方:
1.flow.php
找到
$order['log_id'] = insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
在其后加入:
$order['buyer_region'] = get_buyer_region($new_order_id);
在flow.php文件 底部加入如下函数:
function get_buyer_region($order_id){
$sql = "SELECT concat(IFNULL(c.region_name, ''),IFNULL(p.region_name, ''), " .
" IFNULL(t.region_name, ''), IFNULL(d.region_name, '')) AS region " .
"FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS c ON o.country = c.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS p ON o.province = p.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS t ON o.city = t.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS d ON o.district = d.region_id " .
"WHERE o.order_id = '$order_id'";
return $GLOBALS['db']->getOne($sql);
}
2.includes\modules\payment\alipy.php
找到 'seller_email' => $payment['alipay_account'],
在其后增加如下配置:
'receive_name' => $order['consignee'],
'receive_address' => $order['buyer_region'].$order['address'],
'receive_zip' => $order['zipcode'],
ps:地址是urldecode过的
官方原版的支付宝地址如下:
https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8&agent=C4335319945672464113&logistics_fee=0&logistics_payment=BUYER_PAY&logistics_type=EXPRESS¬ify_url=http://127.0.0.1/ecshop/respond.php?code=alipay&out_trade_no=200911105213010&partner=2088002692045431&payment_type=1&price=16.00&quantity=1&return_url=http://127.0.0.1/ecshop/respond.php?code=alipay&seller_email=xiaochong0302@hotmail.com&service=trade_create_by_buyer&subject=2009111052130&sign=8894ebd13e248d043f90a6e0c41b6a68&sign_type=MD5
支付宝的地址就变成如下:
https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8&agent=C4335319945672464113&logistics_fee=0&logistics_payment=BUYER_PAY&logistics_type=EXPRESS¬ify_url=http://127.0.0.1/ecshop/respond.php?code=alipay&out_trade_no=200911105213010&partner=2088002692045431&payment_type=1&price=16.00&quantity=1&receive_address= 中国广东深圳南山区竹子林1050号&receive_name=侯琳琳&receive_zip=8126743& return_url=http://127.0.0.1/ecshop/respond.php?code=alipay&seller_email=xiaochong0302@hotmail.com&service=trade_create_by_buyer&subject=2009111052130&sign=8894ebd13e248d043f90a6e0c41b6a68&sign_type=MD5
演示见(需要注册 才能测试购买,最好是自己网站测试)
酷瓜内衣商城 :[url]http://www.koogua.com[/url]
适用范围:适用于中介担保支付 (2.7版本)
官方 的支付宝 接口里没有挂地址 ,收货人,邮编等参数,从而到了支付页面 还要填写一遍地址,收货人,比较的麻烦
增加地址,收货人参数后就不再重复劳动了。
修改以下地方:
1.flow.php
找到
$order['log_id'] = insert_pay_log($new_order_id, $order['order_amount'], PAY_ORDER);
在其后加入:
$order['buyer_region'] = get_buyer_region($new_order_id);
在flow.php文件 底部加入如下函数:
function get_buyer_region($order_id){
$sql = "SELECT concat(IFNULL(c.region_name, ''),IFNULL(p.region_name, ''), " .
" IFNULL(t.region_name, ''), IFNULL(d.region_name, '')) AS region " .
"FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS c ON o.country = c.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS p ON o.province = p.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS t ON o.city = t.region_id " .
"LEFT JOIN " . $GLOBALS['ecs']->table('region') . " AS d ON o.district = d.region_id " .
"WHERE o.order_id = '$order_id'";
return $GLOBALS['db']->getOne($sql);
}
2.includes\modules\payment\alipy.php
找到 'seller_email' => $payment['alipay_account'],
在其后增加如下配置:
'receive_name' => $order['consignee'],
'receive_address' => $order['buyer_region'].$order['address'],
'receive_zip' => $order['zipcode'],
ps:地址是urldecode过的
官方原版的支付宝地址如下:
https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8&agent=C4335319945672464113&logistics_fee=0&logistics_payment=BUYER_PAY&logistics_type=EXPRESS¬ify_url=http://127.0.0.1/ecshop/respond.php?code=alipay&out_trade_no=200911105213010&partner=2088002692045431&payment_type=1&price=16.00&quantity=1&return_url=http://127.0.0.1/ecshop/respond.php?code=alipay&seller_email=xiaochong0302@hotmail.com&service=trade_create_by_buyer&subject=2009111052130&sign=8894ebd13e248d043f90a6e0c41b6a68&sign_type=MD5
支付宝的地址就变成如下:
https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8&agent=C4335319945672464113&logistics_fee=0&logistics_payment=BUYER_PAY&logistics_type=EXPRESS¬ify_url=http://127.0.0.1/ecshop/respond.php?code=alipay&out_trade_no=200911105213010&partner=2088002692045431&payment_type=1&price=16.00&quantity=1&receive_address= 中国广东深圳南山区竹子林1050号&receive_name=侯琳琳&receive_zip=8126743& return_url=http://127.0.0.1/ecshop/respond.php?code=alipay&seller_email=xiaochong0302@hotmail.com&service=trade_create_by_buyer&subject=2009111052130&sign=8894ebd13e248d043f90a6e0c41b6a68&sign_type=MD5
演示见(需要注册 才能测试购买,最好是自己网站测试)
酷瓜内衣商城 :[url]http://www.koogua.com[/url]