the error is
httpMethod = POST
name1String = customer
url = https://api.stripe.com/v1/subscriptions
value1String = cus_LEtKohIdBw3j8W
Outputs
{"http_status_code": 400 , "data":{ "error": { "code": "parameter_missing", "doc_url": "https://stripe.com/docs/error-codes/parameter-missing", "message": "Missing required param: customer.", "param": "customer", "request_log_url":
this is the post part of the code , when i did in postman the content type was .url/form is it becz of that and also there is one more req paramter i dint add , but even though i added customer its showing error
if ('POST'.equalsIgnoreCase(httpMethod)) {
hr.setMethod('POST');
String template = toSend.payloadTemplate;
if (template != null) {
template = template.replace('~'+toSend.name1String+'~','"'+toSend.value1String+'"');
template = template.replace('~'+toSend.name2String+'~','"'+toSend.value2String+'"');
template = template.replace('~'+toSend.name3String+'~','"'+toSend.value2String+'"');
template = template.replace('~'+toSend.name4String+'~','"'+toSend.value2String+'"');
template = template.replace('~'+toSend.name5String+'~','"'+toSend.value2String+'"');
hr.setBody(template);
}
hr.setEndpoint(url);
hr.setHeader('Content-Type', 'application/json');
System.debug('Hit POST with URL: '+url+' JSON: ' + template);