<?PHP
/**
* @Description: 快钱网关接口范例
* @Copyright (c) 上海快钱信息服务有限公司
* @version 2.0
*/
class bill99_service {
	function get_link($arr_fields=array())
	{
		$merchant_id = $arr_fields["parterid"];//"879905060103109788";   ///商户编号
		$merchant_key = $arr_fields["key"];   ///商户密钥 99billKeyForTest
		$orderid = $arr_fields["orders_number"];   ///订单编号
		$amount = $arr_fields["goods_price"];   ///订单金额
		$curr = "1";   ///货币类型,1为人民币
		$isSupportDES = "2";   ///是否安全校验,2为必校验,推荐

		$merchant_url = $arr_fields["return_url"];   ///支付结果返回地址
		$pname = "";   ///支付人姓名
		$commodity_info = $arr_fields["subject"];   ///商品信息
		$merchant_param = "";   ///商户私有参数

		$pemail="";   ///传递email到快钱网关页面
		$pid="";   ///代理/合作伙伴商户编号

		$str_domain="https://www.99bill.com/webapp/receiveMerchantInfoAction.do";

		///生成加密串,注意顺序
		$ScrtStr="merchant_id=".$merchant_id."&orderid=".$orderid."&amount=".$amount.'&commodity_info='.urlencode($commodity_info)."&merchant_url=".urlencode($merchant_url)."&merchant_key=".$merchant_key;
		$mac = strtoupper(md5($ScrtStr)); 
		$str_url=$str_domain."?mac=".$mac."&".$ScrtStr;
		return $str_url;
	}
 }
?>

