AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayEcoMycarParkingParkinglotinfoCreateRequest request = new AlipayEcoMycarParkingParkinglotinfoCreateRequest();
request.setBizContent("{" +
"\"city_id\":\"110101\"," +
"\"equipment_name\":\"杭州立方\"," +
"\"out_parking_id\":\"10000110001\"," +
"\"parking_address\":\"浙江省杭州市古墩路与疏港公路的交汇处\"," +
"\"longitude\":\"114.266418\"," +
"\"latitude\":\"30.548828\"," +
"\"parking_start_time\":\"07:00:00\"," +
"\"parking_end_time\":\"03:07:50\"," +
"\"parking_number\":\"10000\"," +
"\"parking_lot_type\":\"1\"," +
"\"parking_type\":\"2\"," +
"\"payment_mode\":\"1\"," +
"\"pay_type\":\"2\"," +
"\"shopingmall_id\":\"100001008\"," +
"\"parking_fee_description\":\"小车一小时10元\"," +
"\"contact_name\":\"张三\"," +
"\"contact_mobile\":\"189xxxxxxxx\"," +
"\"contact_tel\":\"0571xxxxxxxx\"," +
"\"contact_emali\":\"alipay@alipay.com\"," +
"\"contact_weixin\":\"923422342\"," +
"\"contact_alipay\":\"189xxxxxxxx\"," +
"\"parking_name\":\"城西停车场\"," +
"\"time_out\":\"13\"" +
"}");
AlipayEcoMycarParkingParkinglotinfoCreateResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", "app_id", "merchant_private_key", "json", "1.0", "RSA2", "alipay_public_key", "GBK", false);
AlipayEcoMycarParkingParkinglotinfoCreateRequest request= new AlipayEcoMycarParkingParkinglotinfoCreateRequest() ;
request.BizContent="{" +
"\"city_id\":\"110101\"," +
"\"equipment_name\":\"杭州立方\"," +
"\"out_parking_id\":\"10000110001\"," +
"\"parking_address\":\"浙江省杭州市古墩路与疏港公路的交汇处\"," +
"\"longitude\":\"114.266418\"," +
"\"latitude\":\"30.548828\"," +
"\"parking_start_time\":\"07:00:00\"," +
"\"parking_end_time\":\"03:07:50\"," +
"\"parking_number\":\"10000\"," +
"\"parking_lot_type\":\"1\"," +
"\"parking_type\":\"2\"," +
"\"payment_mode\":\"1\"," +
"\"pay_type\":\"2\"," +
"\"shopingmall_id\":\"100001008\"," +
"\"parking_fee_description\":\"小车一小时10元\"," +
"\"contact_name\":\"张三\"," +
"\"contact_mobile\":\"189xxxxxxxx\"," +
"\"contact_tel\":\"0571xxxxxxxx\"," +
"\"contact_emali\":\"alipay@alipay.com\"," +
"\"contact_weixin\":\"923422342\"," +
"\"contact_alipay\":\"189xxxxxxxx\"," +
"\"parking_name\":\"城西停车场\"," +
"\"time_out\":\"13\"" +
"}";
AlipayEcoMycarParkingParkinglotinfoCreateResponse response=client.execute(request);
Console.WriteLine(response.Body);
$aop = new AopClient ();
$aop->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
$aop->appId = 'your app_id';
$aop->rsaPrivateKey = '请填写开发者私钥去头去尾去回车,一行字符串';
$aop->alipayrsaPublicKey='请填写支付宝公钥,一行字符串';
$aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='GBK';
$aop->format='json';
$request = new AlipayEcoMycarParkingParkinglotinfoCreateRequest ();
$request->setBizContent("{" .
"\"city_id\":\"110101\"," .
"\"equipment_name\":\"杭州立方\"," .
"\"out_parking_id\":\"10000110001\"," .
"\"parking_address\":\"浙江省杭州市古墩路与疏港公路的交汇处\"," .
"\"longitude\":\"114.266418\"," .
"\"latitude\":\"30.548828\"," .
"\"parking_start_time\":\"07:00:00\"," .
"\"parking_end_time\":\"03:07:50\"," .
"\"parking_number\":\"10000\"," .
"\"parking_lot_type\":\"1\"," .
"\"parking_type\":\"2\"," .
"\"payment_mode\":\"1\"," .
"\"pay_type\":\"2\"," .
"\"shopingmall_id\":\"100001008\"," .
"\"parking_fee_description\":\"小车一小时10元\"," .
"\"contact_name\":\"张三\"," .
"\"contact_mobile\":\"189xxxxxxxx\"," .
"\"contact_tel\":\"0571xxxxxxxx\"," .
"\"contact_emali\":\"alipay@alipay.com\"," .
"\"contact_weixin\":\"923422342\"," .
"\"contact_alipay\":\"189xxxxxxxx\"," .
"\"parking_name\":\"城西停车场\"," .
"\"time_out\":\"13\"" .
"}");
$result = $aop->execute ( $request);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$resultCode = $result->$responseNode->code;
if(!empty($resultCode)&&$resultCode == 10000){
echo "成功";
} else {
echo "失败";
}
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.eco.mycar.parking.parkinglotinfo.create&app_id=4631&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&biz_content=
{
"city_id":"110101",
"equipment_name":"杭州立方",
"out_parking_id":"10000110001",
"parking_address":"浙江省杭州市古墩路与疏港公路的交汇处",
"longitude":"114.266418",
"latitude":"30.548828",
"parking_start_time":"07:00:00",
"parking_end_time":"03:07:50",
"parking_number":"10000",
"parking_lot_type":"1",
"parking_type":"2",
"payment_mode":"1",
"pay_type":"2",
"shopingmall_id":"100001008",
"parking_fee_description":"小车一小时10元",
"contact_name":"张三",
"contact_mobile":"189xxxxxxxx",
"contact_tel":"0571xxxxxxxx",
"contact_emali":"alipay@alipay.com",
"contact_weixin":"923422342",
"contact_alipay":"189xxxxxxxx",
"parking_name":"城西停车场",
"time_out":"13"
}
//为确保安全通信,需自行验证响应示例中的sign值是否为蚂蚁金服所提供。