虽然使用提取Web API进行后期请求并传递带有散列和签名作为头标参数的json数据,但每次执行代码错误时似乎都不支持文件类型,但相对于我的头标和正文正确的错误,另外我的身体参数也不是文件,所以我很困惑这里出了什么问题。 请调查一下。
fetch('https://sboxapi.lazypay.in/api/lazypay/v2/payment/eligibility',{
method: 'post',
body : occFormatResponse,
header :{
'signature' : hash,
'accessKey' : merchantAccessKey,
'Content-Type': 'application/json',
}
})
.then(function(result){
console.log('result>>>>>>>',result);
// return result;
})
.catch(function(error){
console.log('error while checking the eligibiliy>>>>>>',error);
// return error.response;
})
下面是错误
{"timestamp":1559713841465,"status":415,"error":"Unsupported Media Type","path":"/api/lazypay/v2/payment/eligibility","errorCode":"LP_GENERIC_ERROR","message":"Oops!! Something went wrong"}
身体参数
{
"userDetails" : {
"firstname" : "ravi",
"lastname" : "singh",
"mobile" : "9892197128",
"email" : "ravi.singh@adapty.com"
},
"amount" : {
"value" : 1000,
"currency" : "INR"
},
"address" : {
"address1" : "street1",
"address2" : "street2",
"city" : "pune",
"state" : "MH",
"country" : "IN",
"zip" : "411045"
},
"productSkuDetails" : {
"productId" : "10537492PK",
"description" : "test product",
"attributes" : {
"size" : "S",
"color" : "blue"
},
"imageUrl" : "www.google.com",
"shippable" : true,
"skuId" : "10537492",
"price" : 1000
},
"source" : "fabindia",
"customParams": {
"previousTransactionCount": "10",
"onboardingdate": "20-05-2009",
"usersignupdetails": "Google",
"IPaddress": "10.10.10.10"
}
}