AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayOpenWangyanTestDeleteRequest request = new AlipayOpenWangyanTestDeleteRequest();
request.setBizContent("{" +
"\"user_name\":\"1\"," +
"\"test\":{" +
"\"voucher_type\":\"DISCOUNT\"," +
"\"value_amount\":100," +
"\"threshold_amount\":90," +
"\"reduce_to_amount\":88," +
"\"original_amount\":100," +
"\"original_rate\":\"0.9\"," +
"\"discount_rate\":\"9.5\"," +
"\"valid_period\":3600," +
"\"voucher_desc\":\"使用规则\"," +
"\"threshold_quantity\":\"20\"," +
"\"desc_details\":[{" +
"\"title\":\"套餐材料\"," +
"\"details\":[" +
"\"我是描述1\",\"我是描述2\"" +
"]," +
"\"images\":[" +
"\"80fafaljl\",\"dajf90\"" +
"]," +
"\"url\":\"https://www.taobao.com\"" +
"}]," +
"\"external_goods_list\":{" +
"\"desc\":\"我是描述\"," +
"\"goods_list\":[" +
"\"123213\",\"sdfdsfasd\"" +
"]" +
"}," +
"\"limit_period_info_list\":{" +
"\"unit\":\"WEEK_DAY\"," +
"\"rule\":\"INCLUDE_INTERVAL\"," +
"\"value\":[" +
"3,4" +
"]" +
"}," +
"\"delay_minute\":0," +
"\"rounding_rule\":\"ROUNDING_UP_YUAN\"" +
"}," +
"\"aaa\":\"1\"" +
"}");
AlipayOpenWangyanTestDeleteResponse 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);
AlipayOpenWangyanTestDeleteRequest request= new AlipayOpenWangyanTestDeleteRequest() ;
request.BizContent="{" +
"\"user_name\":\"1\"," +
"\"test\":{" +
"\"voucher_type\":\"DISCOUNT\"," +
"\"value_amount\":100," +
"\"threshold_amount\":90," +
"\"reduce_to_amount\":88," +
"\"original_amount\":100," +
"\"original_rate\":\"0.9\"," +
"\"discount_rate\":\"9.5\"," +
"\"valid_period\":3600," +
"\"voucher_desc\":\"使用规则\"," +
"\"threshold_quantity\":\"20\"," +
"\"desc_details\":[{" +
"\"title\":\"套餐材料\"," +
"\"details\":[" +
"\"我是描述1\",\"我是描述2\"" +
"]," +
"\"images\":[" +
"\"80fafaljl\",\"dajf90\"" +
"]," +
"\"url\":\"https://www.taobao.com\"" +
"}]," +
"\"external_goods_list\":{" +
"\"desc\":\"我是描述\"," +
"\"goods_list\":[" +
"\"123213\",\"sdfdsfasd\"" +
"]" +
"}," +
"\"limit_period_info_list\":{" +
"\"unit\":\"WEEK_DAY\"," +
"\"rule\":\"INCLUDE_INTERVAL\"," +
"\"value\":[" +
"3,4" +
"]" +
"}," +
"\"delay_minute\":0," +
"\"rounding_rule\":\"ROUNDING_UP_YUAN\"" +
"}," +
"\"aaa\":\"1\"" +
"}";
AlipayOpenWangyanTestDeleteResponse 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 AlipayOpenWangyanTestDeleteRequest ();
$request->setBizContent("{" .
"\"user_name\":\"1\"," .
"\"test\":{" .
"\"voucher_type\":\"DISCOUNT\"," .
"\"value_amount\":100," .
"\"threshold_amount\":90," .
"\"reduce_to_amount\":88," .
"\"original_amount\":100," .
"\"original_rate\":\"0.9\"," .
"\"discount_rate\":\"9.5\"," .
"\"valid_period\":3600," .
"\"voucher_desc\":\"使用规则\"," .
"\"threshold_quantity\":\"20\"," .
"\"desc_details\":[{" .
"\"title\":\"套餐材料\"," .
"\"details\":[" .
"\"我是描述1\",\"我是描述2\"" .
"]," .
"\"images\":[" .
"\"80fafaljl\",\"dajf90\"" .
"]," .
"\"url\":\"https://www.taobao.com\"" .
"}]," .
"\"external_goods_list\":{" .
"\"desc\":\"我是描述\"," .
"\"goods_list\":[" .
"\"123213\",\"sdfdsfasd\"" .
"]" .
"}," .
"\"limit_period_info_list\":{" .
"\"unit\":\"WEEK_DAY\"," .
"\"rule\":\"INCLUDE_INTERVAL\"," .
"\"value\":[" .
"3,4" .
"]" .
"}," .
"\"delay_minute\":0," .
"\"rounding_rule\":\"ROUNDING_UP_YUAN\"" .
"}," .
"\"aaa\":\"1\"" .
"}");
$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.open.wangyan.test.delete&app_id=4100&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&biz_content=
{
"user_name":"1",
"test":{
"voucher_type":"DISCOUNT",
"value_amount":100,
"threshold_amount":90,
"reduce_to_amount":88,
"original_amount":100,
"original_rate":"0.9",
"discount_rate":"9.5",
"valid_period":3600,
"voucher_desc":"使用规则",
"threshold_quantity":"20",
"desc_details":[{
"title":"套餐材料",
"details":[
"我是描述1","我是描述2"
],
"images":[
"80fafaljl","dajf90"
],
"url":"https://www.taobao.com"
}],
"external_goods_list":{
"desc":"我是描述",
"goods_list":[
"123213","sdfdsfasd"
]
},
"limit_period_info_list":{
"unit":"WEEK_DAY",
"rule":"INCLUDE_INTERVAL",
"value":[
3,4
]
},
"delay_minute":0,
"rounding_rule":"ROUNDING_UP_YUAN"
},
"aaa":"1"
}
//为确保安全通信,需自行验证响应示例中的sign值是否为蚂蚁金服所提供。